ethercreative / web-payments

Web Payments for Craft Commerce
Other
5 stars 7 forks source link

Pay button testing #31

Open malcolmhmaclean opened 1 year ago

malcolmhmaclean commented 1 year ago

Hi, I am testing out implementing this for an existing clients commerce checkout.

I am having trouble consistently tryjng to show the Google Pay / Apple pay buttons.

Is there a way to have some logic as to whether a Pay Button will appear - as i wil need ot hide the billing address as its not needed if using Apple {ay

Any ideas much appreciated Malcolm

alexjcollins commented 1 year ago

Hi Malcolm,

A few answers below:

  1. My guess is the Browserstack phones don't have a payment method setup in the wallet. When that's the case an ApplePay button won't show. You can test this by visiting this page on the device on BrowserStack. You should see something like I've attached below.
  2. Is it definitely turned off on both production and test modes in Stripe? If it is, this might be something to get in touch with Stripe about.
  3. I think this is Stripe's generic Web Payments button that is shown when it doesn't know what (web) payment methods are available. There's a bit of discussion about it here.

With regards to determining the existence of the pay button, you might be able to listen to the js variable the button creates; if it exists, you'll know the button is present.

I have to say, I've never really thought about it like that, though. Given a web payment button is an 'all-in-one' checkout solution, the user probably won't interact with any of the conventional checkout fields if it's at the top of the checkout flow.

CleanShot 2023-04-25 at 14 31 40

malcolmhmaclean commented 1 year ago

Thanks so much for the detailed answers Alex - really appreciate it

alexjcollins commented 1 year ago

Pleasure; I hope they help you get your integration over the line.

I'm going to close this, but if you have anything further, feel free to reopen the issue, or ping us an email at dev [at] ethercreative.co.uk.

malcolmhmaclean commented 1 year ago

Hi Alex

Apologies for dropping you another line - i thought it was all working ok but its not quite there as yet.

I am testing on GPay Desktop and Mobile and also Apple Pay on my iphone. When i click the Pay button the pop/slide up all comes up fine and the details within all look fine (amount,desc etc) but when i click pay for Apple it buzzes the phone then the payment prompt dissapears and for GPay it tries to process then just comes back to the same screen (in the popup) with the PAY button ready to press again. In either case i cannot see any transaction attempts in Craft Orders or in Stripe itself.

Any idea if i missing something simple?

This is my code:

         {{ craft.webPayments.button({
            cart: craft.commerce.carts.cart,
            requestDetails: ['name', 'phone'],
            onComplete: {
                    redirect: '/commerce/order?number={number}&success=true',
                    js: 'window.paymentCompleted(cwp.number);',
            },
        }) }} 

Malcolm

alexjcollins commented 1 year ago

Hi Malcolm

Do you think you'd be able to share some screen recordings of what you're seeing on the computer and device? Feel free to email them over to the dev address above so that they're not public. I'm trying to get my head around what you're seeing and the order of events unfolding.

Thanks