Paypal using API Sales tax issue

824 Views Asked by At

I am using Paypal with API Integration code in my PHP website. I am getting two issues in this integration.

1 ) I set sales tax for CANADA in Paypal sales tax option. But sales tax is not adding to my transactions. I am using Paypal Express code. Using variable Country="CA". I searched in google, but no luck. Can anybody please give my suggestion why it is not working.

2) Item description is showing Empty in Paypal receipt. But it showing while first time redirect to Paypal page in left hand side. What may be the reason.

                 $padata =   '&TOKEN='.urlencode($token).
                            '&PAYERID='.urlencode($playerid).
                            '&PAYMENTACTION='.urlencode("SALE").
                            '&AMT='.urlencode($ItemTotalPrice).
                            '&CURRENCYCODE='.urlencode($PayPalCurrencyCode).
                            '&COUNTRY='.urlencode($country);

        //We need to execute the "DoExpressCheckoutPayment" at this point to Receive payment from user.
        $paypal= new MyPayPal();
        $httpParsedResponseAr = $paypal->PPHttpPost('DoExpressCheckoutPayment', $padata, $PayPalApiUsername, $PayPalApiPassword, 
1

There are 1 best solutions below

4
On

1) Express Checkout does not work off your PayPal profile rules for shipping or tax. With Express Checkout you have to calculate those values yourself and include them in your API request(s).

2) Sounds like you're including the item details in your SetExpressCheckout request but you forgot to also include the same details in DoExpressCheckoutPayment. You either need to make sure to include those same details in DECP, or you could make use of the new USESESSIONPAYMENTDETAILS parameter. If you include that and set it to true then DECP will use the same details that were passed into SEC without the need to include them again.