#johnc_84245
1 messages · Page 1 of 1 (latest)
hi! what does your code look like at the moment, what APIs do you use to process the payment e.g. Checkout or PaymentIntents?
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.
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?
$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.
I followed a tutorial on this page to put a payment form on my site, but I cannot figure out how to change the payment amount: https://www.codexworld.com/stripe-payment-gateway-integration-php/
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?
Yes @harsh vigil
The problem is (again), no tutorials I've watched show how to add a price dynamically. (javascript/jquery)
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