-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple Pay plugin: "The data couldn't‚ [...] isn't in the correct format." #125
Comments
Also planning to hook this up to Stripe as the next step - has anyone done this? - I imagine I just pass that something of that object to a backend function that talks to Stripe. |
I'm currently using this one for Stripe: https://github.com/triniwiz/nativescript-plugins/tree/master/packages/nativescript-stripe But would be nice to have one single plugin for payment |
I've been trying to integrate that but running into problems with 3dsecure and right now we just need a "Pay with Apple Pay"-button anyway. (if you have a couple hours this week and want to do get freelance $, let me know, my contact details is in my bio) |
@KATT when you get a chance could you try something? Open this file:
On line 42, change it to this:
Save that and try in your app directly to see if any better. If you still see issue, that error is usually related to an unfinished json string (still receiving the full json data) - see here for few more suggestions you could try - if you find one the fixes your case we can add some extra condition handling in there: |
@NathanWalker no visible change on that unfortunately - crashes as well.
|
@KATT - did you solve this? As for integrating with Stripe, if that is your approach, Stripe would be your payment processor with this workflow, this plugin provides the Apple Pay button (official API from Apple) and Apple handles the confirmation of the transaction with the user info on the device. Outside of that, is where you'd need your payment processor (Stripe, FirstData, etc.) to handle the actual payment/charge of the card. Do you have your merchant ID for apple pay setup? The README links to the steps Apple forces you to do in order to use the Apple Pay APIs. Without following those steps, it is possible the error/crash is happening because your Apple Dev account isn't setup correctly. |
@NathanWalker, @bradmartin , I'm hitting the same issue now. I applied the change you suggested but still getting the error. Btw, I'm on simulator, is that an issue? Also, I added log messages in the file you referred to, and the error is definitely happening at line 42. UPDATE: To answer Brad earlier question to OP, yes I made sure the merchant ID is updated in xcode and reflecting correctly, as well as using the same id in the code snippet. |
We stopped using NativeScript altogether after we got the MVP in place - we used this third party plugin. I've unsubscribed from this issue - feel free to close it. |
It has been a couple months since I worked on this but from Apple docs:
|
@bradmartin, thank for your reply. I'll spare sometime for testing on an iphone later, but wanted to hear from you first. I'll have a look and revert back here with what I find. |
I know the plugin should be working fine, one of the pain points i had in developing this was the encryption of the data to the payment provider. Testing this with all the various providers isn't something that can be done simply so I only know 100% that Payeezy/FirstData works 100% with this plugin. So it's possible other providers might have different encryption needs on the data. |
Environment:
Setup
Registering the button in my
main.js
like this:In component
Using the button like this:
<ApplePayBtn @tap="buy" buttonType="Buy" />
When clicking the button, here's my buy code (commented some stuff out as we haven't reached that point yet)
methods.buy
:After clicking the button
createPaymentRequest()
seem to create it all right because the Apple Pay stuff comes up but after selecting payment methodFull error
The text was updated successfully, but these errors were encountered: