Merge pull request #4792 from devansh-webkul/master
Paypal partner attribution ID added
This commit is contained in:
commit
4208f4ef4e
|
|
@ -33,6 +33,13 @@ class SmartButton extends Paypal
|
|||
*/
|
||||
protected $code = 'paypal_smart_button';
|
||||
|
||||
/**
|
||||
* Paypal partner attribution id.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $paypalPartnerAttributionId = 'Bagisto_Cart';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
|
|
@ -63,6 +70,7 @@ class SmartButton extends Paypal
|
|||
public function createOrder($body)
|
||||
{
|
||||
$request = new OrdersCreateRequest;
|
||||
$request->headers['PayPal-Partner-Attribution-Id'] = $this->paypalPartnerAttributionId;
|
||||
$request->prefer('return=representation');
|
||||
$request->body = $body;
|
||||
return $this->client()->execute($request);
|
||||
|
|
@ -77,6 +85,7 @@ class SmartButton extends Paypal
|
|||
public function captureOrder($orderId)
|
||||
{
|
||||
$request = new OrdersCaptureRequest($orderId);
|
||||
$request->headers['PayPal-Partner-Attribution-Id'] = $this->paypalPartnerAttributionId;
|
||||
$request->prefer('return=representation');
|
||||
$this->client()->execute($request);
|
||||
}
|
||||
|
|
@ -112,6 +121,7 @@ class SmartButton extends Paypal
|
|||
public function refundOrder($captureId, $body = [])
|
||||
{
|
||||
$request = new CapturesRefundRequest($captureId);
|
||||
$request->headers['PayPal-Partner-Attribution-Id'] = $this->paypalPartnerAttributionId;
|
||||
$request->body = $body;
|
||||
return $this->client()->execute($request);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue