#candycan
1 messages · Page 1 of 1 (latest)
Hi there!
What is your question?
@severe summit please write your message in this thread
thanks guys!
We have a website with own shopping cart to sell foods; order ID, items' price calculation, etc done by at our end, we want a PAY button (with our order ID as product name & total amount to charge our customer).
Can I create such button? any sample code pls?
PHP or javascript is ok
I checked stripe samples, but all shows for 3 types: pay items loaded from stripe (we already have in our database, we can't add again in stripe product list), link, subscription.
But I only need simple button (just like we create in pay**l button, for example). order ID & amount will be set by our end, on cart page.
If you want user to enter their payment information directly on your website, use PaymentIntent + Payment Element. You only need to set the total amount https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
If you want users to be redirected to a Stripe hosted page, use Checkout Session. You can use Product/Price IDs or directly set the amount using price_data. https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
thank u so much! I'll check n back u 👍