#Masud
1 messages · Page 1 of 1 (latest)
Can you elaborate on what you mean by 'custom params'?
i wanna send a user_id:string so i know who subscribed so i can update my database.
I assume i put it somewhere in here
session = Stripe::Checkout::Session.create({
line_items: [{
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
price: 'price_1Ls5u0IWc5b6XPSDoTgMatgM',
quantity: 1,
}],
mode: 'subscription',
success_url: domain + '/customs/new',
cancel_url: domain + '/cancel.html',
})
@payment_url = session.url
You'd use the metadata param: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Or maybe client_reference_id: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-client_reference_id
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
client_reference_id makes more sense thx
This client_reference_id should show up on the webhook endpoint for checkout.session.completed, right?
Not sure if i put it in incorrectly
Stripe.api_key = stripe_api_key
domain = 'https://queue.ngrok.io'
session = Stripe::Checkout::Session.create({
line_items: [{
# Provide the exact Price ID (e.g. pr_1234) of the product you want to sell
price: price,
quantity: 1,
}],
mode: 'subscription',
success_url: domain + '/customs/new',
cancel_url: domain + '/cancel.html',
client_reference_id: Organization.last.token
})
@payment_url = session.url
It will, yep! Looks good to me
Not appearing for me, and there's a SO post about it
i'll try again to double check.
nvm it shows thanks
All good?
yep thanks!