#SlamDuncan

1 messages · Page 1 of 1 (latest)

spark muskBOT
dry cypress
#

Hi there

green wraith
#

cool. I'll give it a shot real quick

dry cypress
#

👍

green wraith
#

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

urban otter
#

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.

green wraith
#

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}}"

urban otter
#

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

green wraith
#

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}}"

urban otter
#

No, let's take a step back. What are you trying to accomplish?

green wraith
#

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*

urban otter
#

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

green wraith
#

Yeah I added it later after you told me to. The charge then worked, but not captured, because the default paymnet method wasnt used.

urban otter
#

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

green wraith
#

Keep automatic payment methods too?

urban otter
#

That won't matter in this case

green wraith
#

cool. let me try

urban otter
green wraith
#

req_kC59atnt8ieIWN

urban otter
#

You provided a value of 174 for confirm. This is a boolean field, it only accepts true/false

green wraith
#

Ok. It works now. 200's

#

Thanks dude!

urban otter
#

Happy to help 🙂

green wraith
#

Have a great day