#SlamDuncan
1 messages · Page 1 of 1 (latest)
Hi there
You pass the Customer ID to the customer parameter just like you would do with a non-destination charge: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-customer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
cool. I'll give it a shot real quick
👍
That's working. However, in test mode, it says the charge couldn;t be captured because the customers hasn't entered a payment method. See in screenshot the customer has a default paymnet method
Hi đź‘‹
For Payment Intents it will only use the default payment method on the Customer if confirm=true:
payment_method
If this parameter is omitted with confirm=true, customer.default_source will be attached as this PaymentIntent’s payment instrument to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the payment_method going forward.
k let me look
Would I remove automatic paymnet methods from this curl? And replace it withdefault paymnet method? curl https://api.stripe.com/v1/payment_intents
-u sk_test_51LzYI4HFcjPV6MZvvJ2yqUikHAIrNciHMTNkSHcOjMZGNC3SosYzkRJoVal46NBS4SGZpoKVE19Y63G4II3DK6Th00RX0U6xI7:
-d amount=1000
-d currency="usd"
-d "automatic_payment_methods[enabled]"=true
-d "transfer_data[destination]"="{{CONNECTED_STRIPE_ACCOUNT_ID}}"
the automatic_payment_methods["enabled"] here means that, if you confirmed this with the Payment Element, it would work for all applicable Payment Methods given your account settings and the currency the charge is in.
No I am saying you would need to add confirm=true and include a Customer. Then it would charge the default PM for that customer
k. give me a few mins
Sorry and thanks for the patience. I'm close but still a little confused. Could you edit this curl to include the confirm=true? That should get me there.
curl https://api.stripe.com/v1/payment_intents
-u sk_test_51LzYI4HFcjPV6MZvvJ2yqUikHAIrNciHMTNkSHcOjMZGNC3SosYzkRJoVal46NBS4SGZpoKVE19Y63G4II3DK6Th00RX0U6xI7:
-d amount=1000
-d currency="usd"
-d "automatic_payment_methods[enabled]"=true
-d "transfer_data[destination]"="{{CONNECTED_STRIPE_ACCOUNT_ID}}"
No, let's take a step back. What are you trying to accomplish?
I an app with users and hosts. The hosts will have an express connect account. Users will be charged on the platform. I'm trying to create destination charge and charge the user/platform customer, so the charge is contributed to the connect acct/host
I have an app*
Okay, and the first question you asked was about how to charge the platform customer, which my colleague explained. However, i do not see the "customer" parameter in any of your curl examples.
I just want to make sure we aren't missing anything here
Yeah I added it later after you told me to. The charge then worked, but not captured, because the default paymnet method wasnt used.
-d confirm="true" will only automatically charge the default Payment Method if the Customer has one.
Okay so try adding both the confirm parameter and the customer and see if that processes all the way through.
Keep automatic payment methods too?
That won't matter in this case
Can you provide me the request ID for that request? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_kC59atnt8ieIWN
You provided a value of 174 for confirm. This is a boolean field, it only accepts true/false
Happy to help 🙂
Have a great day