#jperf

1 messages ยท Page 1 of 1 (latest)

serene waspBOT
silver bay
#

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.

covert spindle
#

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}}
silver bay
#

But it's doing that without you interacting with the payment sheet at all?

covert spindle
#

yea i do not do anything. These are the two states i see

silver bay
covert spindle
#

yea I can process apple pay payment through the normal paymentSheet logic within the same app.

silver bay
#

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?

covert spindle
#

i was able to do it one time with the klarna type so i doubt it is that. but i can try

silver bay
#

I don't think that should matter, just want to rule it out.

covert spindle
#

this is using the payment sheet flow

silver bay
#

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?

covert spindle
#

i am launching the app via react native scripts

silver bay
#

Can you access the debugger output somehow?

#

Using the shake gesture I think?

#

You do the shake gesture, that should bring up a menu, and you can open the debugger from there.

covert spindle
#

yea give me a moment... using flipper right?

silver bay
#

Don't know what flipper is (not a React dev). This is something you do in the iOS simulator.

#

When your app is running.

covert spindle
#

well what errors are you looking for specifically?

silver bay
#

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?

covert spindle
#

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

silver bay
#

๐Ÿค”

#

Have you been using the same Payment Intent pi_3NXSPeFdV4bT3T5F0LJ7DXCv the whole time, or different ones?

covert spindle
#

swapped it a while ago but currently using

pi_3NXSPeFdV4bT3T5F0LJ7DXCv_secret_v1oEL3zAXAnLAUxCMhHOoOJRF

silver bay
#

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?

covert spindle
silver bay
#

Oh, wow, that takes a long time. Seems like it's timing out because something isn't happening...

covert spindle
#

yea that is what it seems like

silver bay
covert spindle
#

yea give me a moment

#

it seems to have the same beavhior

silver bay
#

Hm. And isPlatformPaySupported returns a promise which resolves to true?

covert spindle
#

yea that resolves to true

#

i am doing this all on the simulator fwiw

silver bay
#

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.

covert spindle
#

๐Ÿ˜ฅ

silver bay
#

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.

serene waspBOT
covert spindle
#

to confirm there is no functionality to auto confirm apple pay payments right?

silver bay
#

Correct.

covert spindle
#

this wa sthe one that worked
pi_3NXS5qFdV4bT3T5F1Qv8IaXR1 but if there any additional logs ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

silver bay
#

That worked with the PaymentSheet you mean?

#

Are you sure that's the correct ID? I think there might be a character missing.

covert spindle
#

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

silver bay
#

Oh, hang on!

#

I think I might know what's going on.

covert spindle
#

once all data was entered automatically transition to processing

#

and did the same "timeout" type error as before

silver bay
#

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?

covert spindle
#

i don't think so

#

when you write "When you specify that you're collecting shipping info"

#

what does that mean ? just requiring shipping?

silver bay
#

Yeah, you're requiring a shipping address.

covert spindle
#

so do this "need to respond with updates to the payment calculations once a shipping address is selected"

#

do the cartItems need to cahnge?

silver bay
#

Yeah, I'm looking for the specific thing, not sure how to do it in React Native...

covert spindle
#
<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

silver bay
#

Yeah, there they are!

#

You need to actually implement those.

covert spindle
#

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"

silver bay
#

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.

covert spindle
#

gotcha ok

#

let me verify one moment

#

ok that was the issue

#

both onShippingMethodSelected and onShippingContactSelected needed to call updatePlatformPaySheet

silver bay
#

Cool beans!

covert spindle
#

would be cool if there was better error messaging with that ๐Ÿ˜…

silver bay
#

Yeah... I'm going to flag that internally.

#

Done!

covert spindle
#

thank you for the assistance