#wagamumma_best-practices
1 messages ยท Page 1 of 1 (latest)
๐ 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.
- wagamumma_best-practices, 59 minutes ago, 6 messages
Are you referring to Stripe Express Checkout Element ?
https://docs.stripe.com/elements/express-checkout-element
If so, yes you can configure it to collect the customer's email:
https://docs.stripe.com/elements/express-checkout-element/accept-a-payment#handle-create-event
ok thanks I will have a look at this now
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
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."
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
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?
you will get these values in the billingDetails
once the customer validates the payment
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?
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
Create an event destination to receive events at an HTTPS webhook endpoint. Receiving webhook events is particularly useful for listening to asynchronous events such as when a customer's bank confirms a payment, a customer disputes a charge, a recurring payment succeeds, or when collecting subscription payments.
no not really
OK good I'll see how it goes thanks for the help
you need to listen to the payment_intent.succeeded event
so I set that up in dashboard to point to a php file on server like how Paypal IPN works?
and you can get the billing details by retrieving the PaymentMethod https://docs.stripe.com/api/payment_methods/object#payment_method_object-billing_details that is stored on the PaymentIntent Object https://docs.stripe.com/api/payment_intents/object#payment_intent_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I don't really know how IPN works but yes we need to be able to POST on your server