#voraciocommerce_78703

1 messages ยท Page 1 of 1 (latest)

crisp voidBOT
rain umbra
#

Once you receive the event with the address, you can calculate the delivery option and respond with the details when you call resolve

#

the API ref I shared above has an example

warped salmon
#

Thanks, taking a look...

#

Not sure this helps in our case. We need to obtain the address from ApplePay.

rain umbra
#

I know, the event handler should give you the address returned by ApplePay

#

Apple may not return the full address due to security reasons, but whatever is returned should be enough to calculate shipping

warped salmon
#

OK, so at the point the user selects to pay by ApplePay, will shippingaddresschange contain some adress details ?

rain umbra
#

when the user selects the address from the Apple Pay sheet, yes it should be reflected in the event handler

warped salmon
#

Cool, we then use that to calculate our delivery options/prices... how do we pass those back?

#

Here is an example from a website I used recently where the delivery options have been passed over to ApplePay

warped salmon
#

Appreciating the help here btw

rain umbra
#

NP! ๐Ÿ™‚ Happy to help

warped salmon
#

Assume first is considered as default

rain umbra
#

I'd think so but would recommend testing it out to be 100% certain

warped salmon
#

Ok se we then look for the address change and rate change (presume with some ID) so we store on the website side...

#

IE map it back to store against the order record

#

We there is a confirm even, with extra details we can store

#

OK great, this is how we expected it would work, but couldn't find the place in the docs...

#

OK it would be within ApplePay that they add the shipping cost to the total amount (or any other such payment like GPay etc) ?

crisp voidBOT
rain umbra
#

Yup

warped salmon
#

Great

#

OK, I'm new to Discord. I have a couple of minor bugs with our current integration (not Express). Should I create a separte chat for that?

#

Many thanks for the help, we shall continue with our integration

rain umbra
#

You can continue asking questions here if you have any immediate ones.

If you need to come back later with more questions then feel free to post a new message in #dev-help

warped salmon
#

Great thanks, ok.....

#

One issue which seems intermittent...

#

When I select to pay with ApplePay, I'm getting message back saying 'Unable to show ApplePay. Please choose a different method and try again"

#

Then when I try again, it works, almost like a session time-out

rain umbra
#

You'd want to check your web console for any logs/errors

warped salmon
#

My senior developer Jakub is now on this chat

silk grail
#

Hi guys ๐Ÿ˜‰

rain umbra
#

I suspect you have some API operation happening when user clicks on "pay now" button and before apple pay modal gets shown

warped salmon
#

I don;t think you saw anything there di you Jakub? Lets take a look now

rain umbra
#

Apple has strict requirements around when the button gets clicked, the sheet should be shown in ~seconds/immediately

#

if you don't, then the call fails

#

The intermittent nature might be due to that API operation just completing faster in some cases

warped salmon
#

Hmm, ok.. could you tell me please, the way we have it now.... is that normal? Or should clicking Apple Pay automatically trigger the payment (rather than having to then click our "Pay now" button ?

rain umbra
#

no, customer needs to click "Pay now" to initiate payment process with Apple Pay

I'm assuming since you're using PaymentElement, you're calling confirmPayment on the button click correct?

warped salmon
#

Jakub is just checking...

rain umbra
#

๐Ÿ‘ if you have any other functions/logic being called/invoked on button click then you'd likely want to take that out

Apple is quite sensitive about all that. You'd want to restructure your code to handle that logic after confirmPayment does its thing

silk grail
#

Hi, just checked that and after click on Pay now we call our method by Ajax and then we call confirmPayment which might be issue as you mentioned

rain umbra
#

yup, ajax request might randomly finish faster/slower which makes it intermittent

silk grail
#

yeh, that makes sense, we will re-order calling of those methods ๐Ÿ˜‰

#

hanzo, thanks for your answers and advices, very useful ๐Ÿ˜‰

warped salmon
#

Ok fantastic thanks Hanzo, one more issue please...

#

When I choose Pay Now with ApplePay and then click to go back to the payment choice screen, its showing a message to "Please fill in your card details"

limber dagger
#

HI ๐Ÿ‘‹

I"m stepping in as @rain umbra had to go

#

Selecting Apple Pay should launch the apple pay modal window where you confirm the payment. Are you completing that step?

warped salmon
#

Hi

#

The model appears, but then when I click to close the modal (lets say I want to choose card instead), as soon as I click to close, we're getting the message to enter card details

#

"Please fill in your card details"

limber dagger
#

Okay, and what about that is unexpected?

warped salmon
#

So here, if I click the close X it then shows an error at the top of the screen saying "Please fill in your card details"

#

Like I have chosen to pay by card and clicked to pay without entering the card details, weird

limber dagger
#

The Payment Sheet is expecting you to have selected a payment method at that point, since you clicked on the Apple Pay button. But since you aborted the flow before you could complete it that is logged as an error. The intent is to make it clear to the user they have not completed their purchase.

warped salmon
#

OK, so I choose a Payment Method (ApplePay) and then decide I don't want to use that payment method, so I click the X. Seems odd that would be reported as an Error.

limber dagger
#

That errror appears to be showing up in a toast. Is this something your UI is doing?

warped salmon
#

When I click the X, ApplePay is still selected

limber dagger
#

Yes, you haven't selected anything else

warped salmon
#

Yes thats where we're showing any warnings back from Stripe, but this one isn't really relevant for the UX

limber dagger
#

In that case I would recommend you listen to the events and supress the error if it isn't relevant.

warped salmon
#

Ok yeh cool, guessed that might be the case

#

Ok thanks for the help on this chat, we are Ok for now to continue. James