#batler2657

1 messages · Page 1 of 1 (latest)

uneven frigateBOT
sleek aspen
#

Should be a server request

#

You create a PaymentIntent server-side, passing the payment_method id there

lilac stag
#

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?

sleek aspen
lilac stag
#

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

sleek aspen
#

Sorry didn't follow the last question. On that page you can search for any API and choose the backend language

#

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

lilac stag
#

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...?

sleek aspen
#

Here

lilac stag
#

Thank you, why does it say incomplete?

sleek aspen
#

Because you just create a PaymentIntent, but haven't confirmed it. You can try passing confirm: true

lilac stag
#

uh, okay, I'll update the POST variables to include confirm=true...

#

Thank you! Any suggestions or bits of advice?

sleek aspen
lilac stag
#

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,.

sleek aspen
#

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

lilac stag
#

What condition triggers a 3DS so I can test that too please?

sleek aspen
#

You can use some of our Test cards

lilac stag
#

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.

ebon wren
#

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

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.