paypal / here-sideloader-api-samples

Sideloader API samples that enable to integrate PayPal Here into other apps
Other
25 stars 32 forks source link

PayPal Here / Sideloader not using returnURL #69

Open hanji866 opened 4 years ago

hanji866 commented 4 years ago

I've been banging my head on this. I'm currently testing with my Android 9 phone / PayPal Here v.3.7.5 and PayPal Here Sideloader API. My initial tests using CC input would create the proper handling with the returnURL passing variables.

I just received my PayPal Here card reader (chip and swipe) and testing with the chip, the returnURL is not being picked up.

I've tried with paypalhere://takePayment and paypalhere://takePayment/v2

Not specifying v2, after 'No Thanks' and 'New Sale' it just loops back to PayPal here. I do see in my logs my browser hitting the returnURL but passing Type=UNKNOWN.

If I specify v2 it sends me back to my payment page (which launched PayPal here), but doesn't pass variables.

In both cases, the card is charged properly. I see the transaction in PayPal. My invoice is correct when viewing it in PayPal Here as well. So it's just about the return.

Here is my returnUrl code:

var returnUrl = 'https://www.example.com/return/';
var retUrl = encodeURIComponent(returnUrl + "?{result}?Type={Type}&InvoiceId={InvoiceId}&Tip={Tip}&Email={Email}&TxId={TxId}");

var pphereUrl = "paypalhere://takePayment/v2?returnUrl=" + retUrl;

pphereUrl = pphereUrl + "&accepted=card,paypal"
pphereUrl = pphereUrl + "&step=choosePayment";
pphereUrl = pphereUrl + '&invoice=' + escape(JSON.stringify(invoice));

So in version v2, it sends me back to https://www.example.com/payment/ and not to the /return/ path as it should. Basically, just brings back the browser stuck on the page it was on when payment was initiated.