#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/1347178940804104253
๐ 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, 3 hours ago, 7 messages
- wagamumma_best-practices, 6 days ago, 45 messages
- wagamumma_best-practices, 6 days ago, 15 messages
- wagamumma_code, 6 days ago, 89 messages
ok thank you appreciate it
can I also ask an unrelated question, we're using the "stripe elements" integration, in the dashboard they'd like it to display the customers name, which seems to be blank in all transactions except if using apple pay? Can you tell me how we'd always put the customer's name into this to make it easier for them to find orders etc?
so to answer your first question by default we only allow synchronous payments on Paypal
would you mind pasting the PaymentIntent ID pi_xxx for one of your Paypal payments?
py_3Qzd3fIDAO7vvncv0ISfpxM7
also this isn't just with paypal, payments by card don't display the name either
I think you're not creating a customer or not filling the billingDetails
I just need to look at the payment to understand your integration
pm_1QzcUhIDAO7vvncvQWiJr0WZ
ok thats a card one too if it helps, thanks
like i say its just the elements method we use so we're not creating customers or anything but assumed somehow we could just pass the name they use for billing/shipping address on the website maybe?
yes so you're not really creating a Customer for these PaymentIntents
so you need to fill in the billingDetails when you submit the payment
the billing_details.name is empty
ok I see, is there an easy way to do this whatever payment method they use then?
for ApplePay we fill these automatically for you
if you're using the PaymentElement
or by passing it manually to the confirmParams https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method_data-billing_details
so would that go in here?
// Create a PaymentIntent with amount and currency
$paymentIntent = $stripe->paymentIntents->create([
'amount' => get_cart_total()*100,
'currency' => 'gbp',
'automatic_payment_methods' => [
'enabled' => true,
],
]);
isn't that all served from stripes server though I'm not sure how i can edit that except through the dashboard? sorry
it's through your frontend code
when you call stripe.confrimPayment in your js code
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
// Make sure to change this to your payment completion page
return_url: "https://www.gordonsmithmalvern.co.uk/checkout_complete_stripe/",
},
});
OK so i found that now thanks, how do i add just a name in here or does it need full billing details,
yes within the confirmParams
you pass paymentMethodData: { billingDetails: {name: "xyz"}}
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
paymentMethodData: { billingDetails: {name: "John Doe"}}
// Make sure to change this to your payment completion page
return_url: "https://www.gordonsmithmalvern.co.uk/checkout_complete_stripe/",
},
});
so that should work?
probably needs a comma at the end i guess
ok brilliant i will try that now
it doesn't seem to like that
tried card and paypal and it says this
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
paymentMethodData: { billingDetails: {name: "John Doe"}},
// Make sure to change this to your payment completion page
return_url: "https://www.gordonsmithmalvern.co.uk/checkout_complete_stripe/",
},
});
that's the exact code including comma at end of the first line now
what's the error?
"message": "Received unknown parameter: paymentMethodData. Did you mean payment_method_data?"
oh sorry
thats in the dashboard the website justr said unknown error
yes you're totally right
ok i'll try updating that
payment_method_data.billing_details
so this?
const { error } = await stripe.confirmPayment({
elements,
confirmParams: {
payment_method_data: { billing_details: {name: "John Doe"}},
// Make sure to change this to your payment completion page
return_url: "https://www.gordonsmithmalvern.co.uk/checkout_complete_stripe/",
},
});
that seems to be working thanks so much!
sure let me know if you need any more help