#jperf
1 messages ยท Page 1 of 1 (latest)
Hello! Do you have an underlying error you can share?
Like what is the result of the promise it returns?
The promise should resolve to an object with an error property, and that error should have more details.
umm it returns the following
{"error": {"code": "Canceled", "declineCode": null, "localizedMessage": "The payment has been canceled", "message": "The payment has been canceled", "stripeErrorCode": null, "type": null}}
But it's doing that without you interacting with the payment sheet at all?
yea i do not do anything. These are the two states i see
Have you completed steps 1โ5 here? https://stripe.com/docs/apple-pay?platform=react-native#merchantid
yea I can process apple pay payment through the normal paymentSheet logic within the same app.
Hm. Not seeing anything amiss in your code. The Payment Intent looks like it's in the correct state... although I'm curious about something; can you try creating a Payment Intent without the klarna payment_method_type and see if that changes anything?
i was able to do it one time with the klarna type so i doubt it is that. but i can try
I don't think that should matter, just want to rule it out.
this is using the payment sheet flow
I haven't found anything on my end; did removing klarna change anything?
Also wondering if there's any additional detail in the Xcode debugger when this happens? Any logs or info about why Apple Pay failed?
i am launching the app via react native scripts
Can you access the debugger output somehow?
Using the shake gesture I think?
Yeah, that's how React Native does it: https://reactnative.dev/docs/debugging.html#content
You do the shake gesture, that should bring up a menu, and you can open the debugger from there.
yea give me a moment... using flipper right?
Don't know what flipper is (not a React dev). This is something you do in the iOS simulator.
When your app is running.
well what errors are you looking for specifically?
Not sure, that's why I'm looking for them. ๐
Apple Pay, or some part of the process it depends on, is failing for some unknown reason. The errors will hopefully tell us the reason once we find them.
Can you get that "Open Debugger" menu item to show up?
doesn't really have any errors.... just these
'contact', { target: 4359,
shippingContact:
{ phoneNumber: '',
postalAddress:
{ subAdministrativeArea: '',
street: '',
postalCode: '30303',
state: 'GA',
isoCountryCode: 'US',
subLocality: '',
country: 'United States',
city: 'Atlanta' },
name:
{ nameSuffix: '',
middleName: '',
nickname: '',
familyName: '',
givenName: '',
namePrefix: '' },
emailAddress: '' } }
{
"date": "2023-07-24T18:21:05.495Z",
"pid": 58928,
"tid": 1552282,
"tag": "ntwrkMobile",
"message": "{ error: \n { stripeErrorCode: null,\n declineCode: null,\n localizedMessage: 'The payment has been canceled',\n message: 'The payment has been canceled',\n type: null,\n code: 'Canceled' } }",
"type": "info",
"count": 1
}
then that later
๐ค
Have you been using the same Payment Intent pi_3NXSPeFdV4bT3T5F0LJ7DXCv the whole time, or different ones?
swapped it a while ago but currently using
pi_3NXSPeFdV4bT3T5F0LJ7DXCv_secret_v1oEL3zAXAnLAUxCMhHOoOJRF
Looks like something is failing in the app itself; not seeing any failed requests to try and confirm this Payment Intent, so it seems like it's not getting that far.
That error is usually thrown when the user cancels the payment, or when you programatically dismiss the payment sheet. Could either of those be happening somehow?
after prompting the sheet i do nothing and this happens
Oh, wow, that takes a long time. Seems like it's timing out because something isn't happening...
yea that is what it seems like
Does createPlatformPayPaymentMethod work? Wondering if it's something to do with the Payment Intent... this approach doesn't involve a Payment Intent at all, so it would help determine if that might be the cause: https://stripe.dev/stripe-react-native/api-reference/index.html#createPlatformPayPaymentMethod
Hm. And isPlatformPaySupported returns a promise which resolves to true?
Yep, that should be fine.
I think the next step would be to make a new, minimal test project that does nothing except it tries to use Apple Pay in this same way. If that works that will tell you the cause is something in your current app/project and you can compare differences to find it.
๐ฅ
Yeah, it's a bit of a pain, but I'm not sure how else to approach the issue. It seems like something is timing out, and that could be caused by who knows what, and we don't have useful errors/logs to go on.
to confirm there is no functionality to auto confirm apple pay payments right?
Correct.
this wa sthe one that worked
pi_3NXS5qFdV4bT3T5F1Qv8IaXR1 but if there any additional logs ๐คท๐ปโโ๏ธ
That worked with the PaymentSheet you mean?
Are you sure that's the correct ID? I think there might be a character missing.
no i believe that was the native sheet or w.e.
yea sorry this is the correct ID pi_3NXS5qFdV4bT3T5F1Qv8IaXR
i created a new sim with no saved addresses and it did not auto confirm fwiw
once all data was entered automatically transition to processing
and did the same "timeout" type error as before
When you specify that you're collecting shipping info you need to respond with updates to the payment calculations once a shipping address is selected.
Did you implement that?
i don't think so
when you write "When you specify that you're collecting shipping info"
what does that mean ? just requiring shipping?
Yeah, you're requiring a shipping address.
so do this "need to respond with updates to the payment calculations once a shipping address is selected"
do the cartItems need to cahnge?
Yeah, I'm looking for the specific thing, not sure how to do it in React Native...
<PlatformPayButton
onShippingContactSelected={(event => {
console.log("contact", event)
})}
onShippingMethodSelected={(event) => {
console.log("method", event)
}}
style={{height: 48}} onPress={handleCheckoutCart}/>
</View>
i am using this component fwiw
they have those two callback methods
when opening the sheet the onShippingContactSelected is triggered with the following
contact {"shippingContact": {"emailAddress": "", "name": {"familyName": "", "givenName": "", "middleName": "", "namePrefix": "", "nameSuffix": "", "nickname": ""}, "phoneNumber": "", "postalAddress": {"city": "Sausalito", "country": "United States", "isoCountryCode": "US", "postalCode": "94965", "state": "CA", "street": "", "subAdministrativeArea": "", "subLocality": ""}}, "target": 4217}
but like what do you mean by "implement"
You MUST update the Apple Pay sheet in your callback using the updatePlatformPaySheet function, otherwise the Apple Pay sheet will hang and the payment flow will automatically cancel.
That's the issue.
gotcha ok
let me verify one moment
ok that was the issue
both onShippingMethodSelected and onShippingContactSelected needed to call updatePlatformPaySheet
Cool beans!
would be cool if there was better error messaging with that ๐
thank you for the assistance