Thanks a lot for the tutorial. Though, it would be nice to have this exact code you've written downloadable. I know there are enough samples provided in GitHub, but it really simplifies when you just have such step-by-step instructions for a downloadable code. One wouldn't have to look for chunks of required code or type them manually. Not critical, but, I think, a valid suggestion.
This is a great tutorial, thank you - I do have a question, how do I also add the users name, email and a short description of the payment? I believe I need to create the customer first - then the intent? How does that work in this workflow?
Hi Matthew-this tutorial specifically covers one-time payments. If you need to add a customer for recurring payments, you can do so through the API or the Dashboard: stripe.com/docs/billing/customer. You might find our documentation on getting started helpful for setting up this workflow: stripe.com/docs/payments/accept-a-payment.
Hi Chris, have a look at our multiple currency doc here: stripe.com/docs/connect/currencies. Any further questions, feel free to get in touch using support.stripe.com. Thanks.
My customer sells tickets in the US for us events and sells tickets in Mexico for MX events. Will the exchange rate be done automatically to dollars if a ticket is sold in Mexico?
Hey Mario-are you speaking about Automatic Currency Conversion: support.stripe.com/questions/automatic-currency-conversion-pricing? Otherwise, this doc has more information about currency conversions: stripe.com/docs/currencies/conversions.
This feature is currently limited to beta users, but you can enter in your email at the bottom of this page if you're interested in participating: stripe.com/docs/payments/checkout/present-local-currencies#:~:text=Automatic%20currency%20conversion%20allows%20you,needing%20to%20update%20your%20integration.
I have test-mode pair of publishable and secret keys, but where to get the webhook secret? Is it generated when creating endpoints? Would that be in test mode or the live? Also in the video, the publishable and secret keys, are in quote marks as in Strings, but not in the generated code.
@@StripeDev Thanks for the discord link. I will use it in the near future. But for now, having ./stripe login done, the regenerated the started project, and .env was properly populated with the keys in quote marks. As a bonus, the webhook key was there too. THANKS AGAIN.🙂
Hey there-good question! You can take a look at how to create charges which will generate a charge ID here: stripe.com/docs/api/charges/create. You'll also find more information on how to retrieve charges using the charge ID a bit further down.
Hi there, This tutorial is really helpfull. I need to know one more think. I want to set the customer name but they maybe a guest user! So how can I do this? is there any parameter to add the guest customer name?? $paymentIntent = $stripe->paymentIntents->create([ 'amount' => $amount, 'currency' => $currency, 'automatic_payment_methods' => ['enabled' => true], // 'customer' => $customer, 'description' => $description, 'receipt_email' => $receipt_email, 'metadata' => [ 'u_id' => $u_id, 'o_id' => $o_id, ], ]); Thank you!
So, we dug a little deeper from what we could grasp out of your question. The email address mentioned here: stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-email, if set to `auto` will only show as an input field when the PaymentMethod requires collecting it i.e. it will not always be displayed as an input field. What you can try is implementing the input field yourself and passing that in as part of the billing_details when confirming the PaymentIntent or SetupIntent. If you're implementing your own input field to collect the email address, you'll likely want to set it such that the Payment Element never collects the email. Alternatively, if you're willing to integrate with Link, you can take a look at this guide: stripe.com/docs/payments/link/add-link-elements-integration?link-integration-type=collect-email&defaultValues-integration-type=same#design-your-integration.
@17.49 the webhook trigger was successful, and the results are evident in the terminal. When I redirect the return_url to webhook.php, upon payment, I get the error: {"error":"Unable to extract timestamp and signatures from header"}. It is unfortunate, that the demo does not show the webhook.php in action. But all the same, thanks a ton for sharing this tutorial.
Hey T. We will certainly consider doing another video about it. For now, you can find information on changing a Charge to a Payment Intent in the official Stripe documentation: Payment Intents API: stripe.com/docs/payments/payment-intents Confirm a Payment Intent: stripe.com/docs/payments/payment-intents/quickstart#confirm-payment-intent Capture a Payment Intent: stripe.com/docs/payments/payment-intents/quickstart#capture In general, the Payment Intents API is designed to replace the Charges API, so you might also find it helpful to review the following resources for background information: Migrating to Payment Intents: stripe.com/docs/payments/payment-intents/migration Charge API vs. Payment Intents API: stripe.com/docs/payments/payment-intents/migration/charges
Hello there. Happy to help you with that. After activating Google Pay on your dashboard here: dashboard.stripe.com/settings/payment_methods, you can follow the steps on this document to set this payment method to your website: stripe.com/docs/google-pay.
Here's one for you: Using the API, I can get the payment_intent , and I can also get its associated charge for a successful purchase completed via the Stripe Hosted payment url. What I can't do is get the product that either the intent or the charge are associated to - how in the world do I get which charge or intent is associated to a product?
Hi there, you can do this by retrieving the Session and using expansion stripe.com/docs/expand, to include the 'line_item': stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items. You can also take a look at this doc for more context: stripe.com/docs/api/checkout/sessions/retrieve.
I don’t want to redirect them. Just want the charge id for the backend. How can I do this? Note: we are using stripe api. We took card data and send to srtipe. In test mood its work. But tomorrow we will live our application and today we just put the live key. And saw stripe sucks. They publish new rule we can't send raw card details. Okay perfect. This message should be with test too. So we aware and took necessary step erliery. But they didn’t and we have yo launch it tomorrow and we got this error..now I want to add stripe element but its want redirect url. Our system can't deal with this within one day. So, Stripe put us in trouble.
Really clear and complete explanation of this Stripe feature. Actually far better, practical and more concise than their documentation!
Thanks a lot for the tutorial. Though, it would be nice to have this exact code you've written downloadable. I know there are enough samples provided in GitHub, but it really simplifies when you just have such step-by-step instructions for a downloadable code. One wouldn't have to look for chunks of required code or type them manually. Not critical, but, I think, a valid suggestion.
I agree.
This is a great tutorial, thank you - I do have a question, how do I also add the users name, email and a short description of the payment? I believe I need to create the customer first - then the intent? How does that work in this workflow?
Hi Matthew-this tutorial specifically covers one-time payments. If you need to add a customer for recurring payments, you can do so through the API or the Dashboard: stripe.com/docs/billing/customer.
You might find our documentation on getting started helpful for setting up this workflow: stripe.com/docs/payments/accept-a-payment.
Regarding currencies, how do I enable multiple currency option?
Hi Chris, have a look at our multiple currency doc here: stripe.com/docs/connect/currencies. Any further questions, feel free to get in touch using support.stripe.com. Thanks.
My customer sells tickets in the US for us events and sells tickets in Mexico for MX events. Will the exchange rate be done automatically to dollars if a ticket is sold in Mexico?
Hey Mario-are you speaking about Automatic Currency Conversion: support.stripe.com/questions/automatic-currency-conversion-pricing?
Otherwise, this doc has more information about currency conversions: stripe.com/docs/currencies/conversions.
@@StripeDev Yes, this makes sense. What are the requirements to have an elegible account to have ACC enabled?
This feature is currently limited to beta users, but you can enter in your email at the bottom of this page if you're interested in participating: stripe.com/docs/payments/checkout/present-local-currencies#:~:text=Automatic%20currency%20conversion%20allows%20you,needing%20to%20update%20your%20integration.
@@StripeDev Thank you for the fast answers.
This was a fantastic tutorial. Thank you so much :)
I have test-mode pair of publishable and secret keys, but where to get the webhook secret? Is it generated when creating endpoints? Would that be in test mode or the live? Also in the video, the publishable and secret keys, are in quote marks as in Strings, but not in the generated code.
We'd be happy to explain this further. Feel free to chat with us on Discord at stripe.com/go/developer-chat
@@StripeDev Thanks for the discord link. I will use it in the near future. But for now, having ./stripe login done, the regenerated the started project, and .env was properly populated with the keys in quote marks. As a bonus, the webhook key was there too. THANKS AGAIN.🙂
Hey there-good question! You can take a look at how to create charges which will generate a charge ID here: stripe.com/docs/api/charges/create. You'll also find more information on how to retrieve charges using the charge ID a bit further down.
Hi there,
This tutorial is really helpfull. I need to know one more think. I want to set the customer name but they maybe a guest user! So how can I do this?
is there any parameter to add the guest customer name??
$paymentIntent = $stripe->paymentIntents->create([
'amount' => $amount,
'currency' => $currency,
'automatic_payment_methods' => ['enabled' => true],
// 'customer' => $customer,
'description' => $description,
'receipt_email' => $receipt_email,
'metadata' => [
'u_id' => $u_id,
'o_id' => $o_id,
],
]);
Thank you!
Great, but how can I add input to the form to collect user email and so on. And how to handle that in the back end.
Hey there-great question! Could you please elaborate on this so that we can better answer your question?
So, we dug a little deeper from what we could grasp out of your question. The email address mentioned here: stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails-email, if set to `auto` will only show as an input field when the PaymentMethod requires collecting it i.e. it will not always be displayed as an input field.
What you can try is implementing the input field yourself and passing that in as part of the billing_details when confirming the PaymentIntent or SetupIntent. If you're implementing your own input field to collect the email address, you'll likely want to set it such that the Payment Element never collects the email.
Alternatively, if you're willing to integrate with Link, you can take a look at this guide: stripe.com/docs/payments/link/add-link-elements-integration?link-integration-type=collect-email&defaultValues-integration-type=same#design-your-integration.
@17.49 the webhook trigger was successful, and the results are evident in the terminal. When I redirect the return_url to webhook.php, upon payment, I get the error: {"error":"Unable to extract timestamp and signatures from header"}. It is unfortunate, that the demo does not show the webhook.php in action. But all the same, thanks a ton for sharing this tutorial.
Perfect
can u make video on how to change charge to intent
Hey T. We will certainly consider doing another video about it. For now, you can find information on changing a Charge to a Payment Intent in the official Stripe documentation:
Payment Intents API: stripe.com/docs/payments/payment-intents
Confirm a Payment Intent: stripe.com/docs/payments/payment-intents/quickstart#confirm-payment-intent
Capture a Payment Intent: stripe.com/docs/payments/payment-intents/quickstart#capture
In general, the Payment Intents API is designed to replace the Charges API, so you might also find it helpful to review the following resources for background information:
Migrating to Payment Intents: stripe.com/docs/payments/payment-intents/migration
Charge API vs. Payment Intents API: stripe.com/docs/payments/payment-intents/migration/charges
Hello, can you guide how can we set Google pay instead of cards ?
Hello there. Happy to help you with that. After activating Google Pay on your dashboard here: dashboard.stripe.com/settings/payment_methods, you can follow the steps on this document to set this payment method to your website: stripe.com/docs/google-pay.
Here's one for you: Using the API, I can get the payment_intent , and I can also get its associated charge for a successful purchase completed via the Stripe Hosted payment url. What I can't do is get the product that either the intent or the charge are associated to - how in the world do I get which charge or intent is associated to a product?
Hi there, you can do this by retrieving the Session and using expansion stripe.com/docs/expand, to include the 'line_item': stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items.
You can also take a look at this doc for more context: stripe.com/docs/api/checkout/sessions/retrieve.
@@StripeDev Awesome, thanks for pointing me in the right direction ❤
Happy to help!
Can you share vscode theme name? :)
and font plus
I don’t want to redirect them. Just want the charge id for the backend. How can I do this?
Note: we are using stripe api. We took card data and send to srtipe. In test mood its work. But tomorrow we will live our application and today we just put the live key. And saw stripe sucks. They publish new rule we can't send raw card details. Okay perfect. This message should be with test too. So we aware and took necessary step erliery.
But they didn’t and we have yo launch it tomorrow and we got this error..now I want to add stripe element but its want redirect url. Our system can't deal with this within one day. So, Stripe put us in trouble.