#batler2657
1 messages · Page 1 of 1 (latest)
Should be a server request
You create a PaymentIntent server-side, passing the payment_method id there
Okay, I've been using the search feature but using the word charge doesn't give me anything relevant. This is a lot like when I was trying to "add card" to a customer and that was some old documentation (with no, "are you looking for ..." appended. It turned out to be "Attach a PaymentMethod to a Customer". So could you please point me to the correct part of the documentation please?
Sure. You can take a look at this flow and especially this step https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=web&type=payment#submit-payment
Okay, figured out what was wrong here with that documentation; it's node.js code for the server.
How is the server code referenced on the API page here please?
https://stripe.com/docs/api
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sorry didn't follow the last question. On that page you can search for any API and choose the backend language
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But the Doc I gave earlier should have better step by step explanation
Feel free to request to reopen the thread if you are back
Okay, thank you. So I had some success, maybe...
$url = 'https://api.stripe.com/v1/payment_intents';
via cURL + PHP.
The results:
Array
(
[id] => pi_3NatKPCbr9UflH1h0B8OFczb
[object] => payment_intent
[amount] => 2500
[amount_capturable] => 0
[amount_details] => Array
(
[tip] => Array
(
)
)
[amount_received] => 0
[application] =>
[application_fee_amount] =>
[automatic_payment_methods] =>
[canceled_at] =>
[cancellation_reason] =>
[capture_method] => automatic
[client_secret] => pi_3NatKPCbr9UflH1h0B8OFczb_secret_tvLAuVXLeXJdKDlzrbW0ADayy
[confirmation_method] => automatic
[created] => 1691037601
[currency] => usd
[customer] => cus_ONCfFhBUjc2Jka
[description] =>
[invoice] =>
[last_payment_error] =>
[latest_charge] =>
[livemode] =>
[metadata] => Array
(
)
[next_action] =>
[on_behalf_of] =>
[payment_method] => pm_1NaqR8Cbr9UflH1h9hfPNQGs
[payment_method_options] => Array
(
[card] => Array
(
[installments] =>
[mandate_options] =>
[network] =>
[request_three_d_secure] => automatic
)
)
[payment_method_types] => Array
(
[0] => card
)
[processing] =>
[receipt_email] =>
[review] =>
[setup_future_usage] => off_session
[shipping] =>
[source] =>
[statement_descriptor] =>
[statement_descriptor_suffix] =>
[status] => requires_confirmation
[transfer_data] =>
[transfer_group] =>
)
However on the Stripe dashboard (yes, in test mode) no charges appear. So...?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Here
Thank you, why does it say incomplete?
Because you just create a PaymentIntent, but haven't confirmed it. You can try passing confirm: true
uh, okay, I'll update the POST variables to include confirm=true...
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Thank you! Any suggestions or bits of advice?
I see you have a succeeded PI https://dashboard.stripe.com/test/payments/pi_3NatVOCbr9UflH1h0CCKAbHO. It's working isn't it?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes and I reloaded for a successful second charge.
So if customers save their card I can have them charge it again in the future so that covers the most critical parts that I needed to figure out,.
Keep in mind that if the PaymentIntent requires 3DS, it will transite into requires_action state. And you will need to bring back your customer online to authenticate it
What condition triggers a 3DS so I can test that too please?
You can use some of our Test cards
I've got the contents saved...do you know offhand which card(s) will trigger the 3DS?
I've been documenting EVERYTHING that works. It took me MONTHS to get this far with Square about six years ago and I've only been doing this for five days.
this page :
https://stripe.com/docs/testing#regulatory-cards lists down the cards that will trigger 3DS. Each card is used to test a slightly different scenario so you should go through that list to see what scenario you're testing and use the appropriate card