Skip to content

Commit

Permalink
Add subtotal and shipping for doExpressCheckout. (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakogn authored and srmklive committed Apr 4, 2018
1 parent e7969d6 commit b861d52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Services/ExpressCheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ public function getExpressCheckoutDetails($token)
*/
public function doExpressCheckoutPayment($data, $token, $payerid)
{
$this->setItemSubTotal($data);

$this->post = $this->setCartItems($data['items'])->merge([
'TOKEN' => $token,
'PAYERID' => $payerid,
'PAYMENTREQUEST_0_ITEMAMT' => $data['total'],
'PAYMENTREQUEST_0_ITEMAMT' => $this->subtotal,
'PAYMENTREQUEST_0_AMT' => $data['total'],
'PAYMENTREQUEST_0_PAYMENTACTION' => !empty($this->config['payment_action']) ? $this->config['payment_action'] : 'Sale',
'PAYMENTREQUEST_0_CURRENCYCODE' => $this->currency,
Expand All @@ -197,6 +199,8 @@ public function doExpressCheckoutPayment($data, $token, $payerid)
'PAYMENTREQUEST_0_NOTIFYURL' => $this->notifyUrl,
]);

$this->setShippingAmount($data);

return $this->doPayPalRequest('DoExpressCheckoutPayment');
}

Expand Down

0 comments on commit b861d52

Please sign in to comment.