#johnc_84245

1 messages · Page 1 of 1 (latest)

hallow bearBOT
echo frigate
#

hi! what does your code look like at the moment, what APIs do you use to process the payment e.g. Checkout or PaymentIntents?

neon gazelle
#

currently, I have a registration form. User selects a code. when submitted, I send the user to Stripe's credit-card payment site.

#

I'd like to do this on my site, but cannot figure out how to change the amount in the tutorials I've tried to implement.

#

I mean, I'd like to have the payment form on my site.

echo frigate
#

so what does your code look like at the moment?

I send the user to Stripe's credit-card payment site.
so that means you're using the CheckoutSession API?

neon gazelle
#

$session = \Stripe\Checkout\Session::create([

#

'unit_amount' => $payment_choice,

#

$payment_choice is from code based on the user's form selection.

#

I know having a cc-payment form on my site changes how the code is written.

hallow bearBOT
neon gazelle
harsh vigil
#

To be clear, are you saying that right now you are using the Stripe-hosted Checkout page but now you want to move to having a form that is on a page on your site?

neon gazelle
#

Yes @harsh vigil

#

The problem is (again), no tutorials I've watched show how to add a price dynamically. (javascript/jquery)

harsh vigil
#

We have docs that show how to make the form, but as far as I know none of them show that specific piece of how to set the price. That implementation detail is up to you. I think this flow may give you a straightforward way to do that.
https://stripe.com/docs/payments/accept-a-payment-deferred

neon gazelle
#

Thanks @harsh vigil I'll check it out.

#

Hrmmm! That gives me some ideas to play with. More promising that I've been in days.