Taking money in your app
The amount is recalculated on the server from the order, not taken from the browser.
Adapters for Stripe, PortOne and Toss are written and webhook signatures are verified. A merchant contract with the payment company is yours to sign. Paid plans on mypage itself are not switched on yet.
What it is for
Selling something means an amount, and an amount that a browser can edit is not an amount.
So the server reads the order again, adds it up itself, and only then opens the payment page.
What you need
A merchant account with a payment company, and two values saved in Project secrets: the secret key and the list of price identifiers you allow.
An owner notification has to be ready as well. If it is not, checkout refuses to start rather than taking money nobody hears about.
The order to do it in
Build the cart and the order screen first. Payment is the last thing you attach.
Then save the keys, and send the customer to the payment page from the order page.
Start with a test purchase. Payment companies usually issue separate test keys.
How to check it worked
Run one test purchase. The amount on the payment page and the amount on the order must match to the last unit.
Press the pay button twice on purpose. The second press must not create a second charge.
If the order changes while payment is open, it stops and asks the customer to check the cart again.
What it will not do
- Card numbers never touch our server. Your customer types them on the payment company's page.
- One payment cannot mix currencies. It is refused before it starts.
- If the price on the provider does not match the order, the payment stops.
- The payment link expires after 30 minutes. After that the customer starts again from the order page.
- Up to 1,000 checkouts per project per day.