Open latheesan-k opened 8 years ago
If you set the returnUrl to be a web page - like www.google.com or some such, what happens? Also, what if your return URL is myappurlschema://takePayment/ without the result bit?
Hi.
Nothing happens. I've already tested this.
Sent from my iPhone
On 1 Mar 2016, at 21:23, Max Metral notifications@github.com<mailto:notifications@github.com> wrote:
If you set the returnUrl to be a web page - like www.google.comhttp://www.google.com or some such, what happens? Also, what if your return URL is myappurlschema://takePayment/ without the result bit?
Reply to this email directly or view it on GitHubhttps://github.com/paypal/here-sideloader-api-samples/issues/41#issuecomment-190911254.
After many hours of trial and error, I sort of have a semi-working version now. This is what I have so far:
// Open paypal here
var retUrl = Titanium.Network.encodeURIComponent(
"myappurlschema://takePayment/{result}?Done"+
"&PaymentType={Type}"+
"&InvoiceId={InvoiceId}"+
"&TxId={TxId}"+
"&GrandTotal={GrandTotal}"+
"&AmountDue="+ e.amountDue +
"&DiscountAmount="+ e.discountAmount +
"&DiscountReason="+ e.discountReason +
"&UsePoints="+ e.usePoints +
"&EarnPoints="+ e.earnPoints);
var pphereUrl = "paypalhere://takePayment?accepted=card,paypal&returnUrl="+ retUrl;
pphereUrl += "&as=b64&step=choosePayment";
var request = pphereUrl +"&invoice="+ Titanium.Utils.base64encode(JSON.stringify(paypalInvoice));
request = request.replace(/(\r\n|\n|\r)/gm, "");
Titanium.Platform.openURL(request);
With the above; when code executes, this is the flow:
PaymentType
, InvoiceId
, TxId
etc...)So... I am not sure what happened. Did the flow get updated or something? I distinctly remember previously, when you clicked "No Receipt" it immediately returned you back to the app with the result. Now you have to click "No Receipt" and then "New Sale" to return to app with result.
Running into same problem. This work around didn't work for me. No Receipt to New Sale either does nothing or with v2 will just load the calling site, but not pass anything.
I am using Titanium Appcelerator to build an iOS application that lets users charge their customer using PayPal Here sideloader api.
I open the paypal here app like this:
This correctly opens the paypal here app with my basket contents (i.e. invoice lines).
I am able to select card payment type, enter my details and charge. Once the transaction is completed, I click No Receipt, but nothing happens.
I should be taken back to my app as per specified
returnUrl
.I have already verified my app's url schema is registered by opening the safari browser and visiting
myappurlschema://takePayment
and it opens my app, therefore paypal should have no trouble opening my app also.I've also tried wrapping the
returnUrl
value withencodeURIComponent()
but that did not help either.