How to add card holder's name to Stripe checkout using Elements?

前端 未结 4 1978
孤城傲影
孤城傲影 2021-02-04 00:43

I need to add an additional field to my custom form, I want to add the name of the credit card.

I tried in the following way:

var cardNameElement = eleme         


        
4条回答
  •  醉话见心
    2021-02-04 01:25

    I use Meta-Data for custom fields such as cardholder name:

    ... create({
                  amount: myAmount,
                  currency: 'USD,
                  description: "Put your full discription here",
                  source: tokenid,
                  metedata: {any: "set of", key: "values", that: "you want", cardholder: "name"}
               },
                 idempotency_key "my_idempotency_key"
               )}
    

    resource: https://stripe.com/docs/payments/charges-api#storing-information-in-metadata

提交回复
热议问题