#01nish_api

1 messages ¡ Page 1 of 1 (latest)

rough thicketBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1300898400924864654

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

wide mountain
#

Hello
I'm not sure I follow.. How/where are you getting the client secret and card token from?
Can you provide more context?

scarlet fulcrum
#

Hello

#

Yes sure

#

i am embedding beat api of greece country with stripe payment gateway

#

we are creating subscription

#

Adding a payment card is a 3-step process:

Create a setup intent.
Use the setup intent with Stripe to get a payment method.
Post the payment method back to us.

The process works the same if you are doing this through signup or at any point later.

(paymenttype = 3 means Stripe, we do support other payment methods but no other methods are enabled for Jukebooks.)

curl -X POST https://api.prod.antenna.beat.no/v2/billing/setupintents
-H "Authorization: Bearer $TOKEN"
-d '{
"paymenttype": 3,
"payment_method_subtype": "card",
"product_id": "1"
}'

This will give you back an object with a setup intent code (always starts with `seti) that can be passed to Stripe Elements (not Stripe Checkout as far as I know).

Once you are done with Stripe, you can take the payment method you now have, and give it to us:

curl -X POST https://api.prod.antenna.beat.no/v2/billing/paymentmethods
-H "Authorization: Bearer $TOKEN"
-d '{
"payment_type": 3,
"reference": "pm_adsjkflja92831iojalsdf"
}'

Note that the payment method reference from Stripe always starts with pm`.
keep that somewhere and go carefully through the instructions

#

i have this from api developer

#

*we just want to update card in beat dashboard for subscription payment

wide mountain
#

Sounds like Beat is a third-party platform that you're trying to integrate to. We (Stripe) won't know anything about how they use our APIs in their infrastructure. Your best bet would be to talk to their developers and work with them directly.

The flow they've described in the text you shared above is this guide here - https://docs.stripe.com/payments/save-and-reuse?platform=web&ui=elements

I'd recommend reading through it as it explains pretty much everything you need to do step by step.

scarlet fulcrum
#

can we update card by setup intent and card token?

#

??

wide mountain
#

Like I mentioned earlier, you're using Beat (which is a third party platform) who I guess creates the subscriptions for you. So we (Stripe) won't know much about what they do with the PaymentMethod you generate using the guide I shared above..

You'd need to ask them if that's all they (Beat) expect

#

SetupIntents are used to collect payment method details from end customers. So yeah, you can collect new card details and update the subscription on high level

scarlet fulcrum