Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Unable to get invoice id, number.... #49

Open
EddieLukeAtmey opened this issue Sep 16, 2016 · 0 comments
Open

Unable to get invoice id, number.... #49

EddieLukeAtmey opened this issue Sep 16, 2016 · 0 comments

Comments

@EddieLukeAtmey
Copy link

EddieLukeAtmey commented Sep 16, 2016

Hi, we're having trouble with getting the invoice id, taxId, number id.... and after checking your site (web-sideload), I've found out the reason:

The return URL need to fully encode to percent character. Hence, in your sample code, this won't get us the all the params we need (invoice id, tax id...)

NSString *encodedReturnUrl = [@"myapp://handler?{result}?Type={Type}&InvoiceId={InvoiceId}&Tip={Tip}&Email={Email}&TxId={TxId}" stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];

I fix this by using these:

NSCharacterSet *URLCombinedCharacterSet = [[NSCharacterSet characterSetWithCharactersInString:@" {}\"!#$&'()*+,/:;=?@[]%"] invertedSet];
NSString *encodedReturnUrl = [@"ppxpos://handler?Type={Type}&InvoiceId={InvoiceId}&Tip={Tip}&Email={Email}&TaxId={TxId}&Number={Number}"
                                  stringByAddingPercentEncodingWithAllowedCharacters:URLCombinedCharacterSet];

And then we could get all those params, except for the TxId, we still don't receive it. However, since it's trivial, I won't ask for it for now.

Please confirm and update the sample for everyone who'll need this. Thanks!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant