简体   繁体   English

在 Stripe Checkout 中接受自定义付款

[英]Accept custom payment in Stripe Checkout

So I have a simple react frontend connected to stripe checkout, right now I created a product on stripe for 10 dollars and capture it with the API.所以我有一个连接到条带结帐的简单反应前端,现在我以 10 美元的价格在条带上创建了一个产品,并使用 API 捕获它。 I would like to implement something where the user can enter a custom amount and send it.我想实现一些用户可以输入自定义金额并发送的东西。 Is this possible to do using the stripe checkout only?这可以仅使用条带结帐吗? I do not want to setup a backend or something too complicated.我不想设置后端或太复杂的东西。 Any ideas will be appreciated thank you:)任何想法将不胜感激谢谢:)

lineItems:[
        {
            price: process.env.REACT_APP_PRODUCT,
            quantity: 1,
        },
    ],
    mode:"payment",
    cancelUrl: window.location.origin,

Yes, it's possible.是的,这是可能的。 You can do it like this:你可以这样做:

https://jsfiddle.net/captainapollo/atgycd2s/ https://jsfiddle.net/captainapollo/atgycd2s/

console.log("I can't put a JSFiddle link without code so here's some code.");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM