#wagamumma_best-practices

1 messages ยท Page 1 of 1 (latest)

young coyoteBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1362033255112769588

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

gloomy timber
young coyoteBOT
grave saffron
#

ok thanks I will have a look at this now

static dust
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

grave saffron
#

const options = {
emailRequired: true,
phoneNumberRequired: true,
mode: 'payment',
amount: carttotal,
currency: 'gbp',
// Customizable by using the Appearance API.
appearance: {/.../},
paymentMethods: { link: "never" },
paymentMethodOrder: ["apple_pay","google_pay"],
};

    // Set up Stripe.js and Elements to use in checkout form.
    const elements = stripe.elements(options);

    // Create and mount the Express Checkout Element
    const expressCheckoutElement = elements.create('expressCheckout',options);
    
    expressCheckoutElement.mount('#express-checkout-element');
#

is this the wrong place for this? it's making it error if I add email/phone to the options?

#

"IntegrationError: Instead of passing emailRequired, phoneNumberRequired on click, provide the param(s) on create or update instead."

static dust
#

you're using the same options for the elements creation and the ECE creation

#

you need to create 2 different options objects

#

the one with emailRequired and phoneNumberRequired should be passed to the ECE creation

grave saffron
#

ok thank you will try that now

#

OK it seems to accept that now, but it didn't ask for an email or phone number anywhere, how do I get these values if they're being returned via the Google account details? Or should it prompt the customer to enter these as that didn't happen?

static dust
#

you will get these values in the billingDetails

#

once the customer validates the payment

grave saffron
#

is there an example of this anywhere in the docs please? not sure where this would be done quite or how to use it

#

// Create the PaymentIntent and obtain clientSecret
const res = await fetch('https://www.gordonsmithmalvern.co.uk/stripe-components/public/express-intent.php', {
method: 'POST',
});
const {client_secret: clientSecret} = await res.json();

      const {error} = await stripe.confirmPayment({
        // `elements` instance used to create the Express Checkout Element
        elements,
        // `clientSecret` from the created PaymentIntent
        clientSecret,
        confirmParams: {
          return_url: 'https://www.gordonsmithmalvern.co.uk/checkout_complete_stripe/',
        },
      });
#

I have this but obvious I need access to billingDetails before it redirects to the return url and update the order in PHP somehow?

static dust
#

the billingDetails will be automatically filled and sent to Stripe

#

I have this but obvious I need access to billingDetails before it redirects to the return url and update the order in PHP somehow?
this should happen asynchronously

#

using webhooks

grave saffron
#

OK thanks is this quite difficult to set up?

#

I will have a read

static dust
grave saffron
#

OK good I'll see how it goes thanks for the help

static dust
#

you need to listen to the payment_intent.succeeded event

grave saffron
#

so I set that up in dashboard to point to a php file on server like how Paypal IPN works?

static dust
#
static dust