代码之家  ›  专栏  ›  技术社区  ›  xiaolingxiao

在生产中保存客户时,在何处查找Stripe的源令牌

  •  0
  • xiaolingxiao  · 技术社区  · 6 年前

    https://stripe.com/docs/saving-cards

    特别是在保存客户信息时:

    (async function() {
      // Create a Customer:
      const customer = await stripe.customers.create({
        source: 'tok_mastercard',
        email: 'paying.user@example.com',
      });
    
      // Charge the Customer instead of the card:
      const charge = await stripe.charges.create({
        amount: 1000,
        currency: 'usd',
        customer: customer.id,
      });
    
      // YOUR CODE: Save the customer ID and other info in a database for later.
    
    })();
    

    source: 'tok_mastercard' 它按预期运行,但是当使用时,令牌在生产中会是什么 sk_live_...

    1 回复  |  直到 6 年前
        1
  •  1
  •   koopajah MKumar    6 年前

    当您使用以下两种方法安全地收集卡的详细信息时,您可以在客户端创建令牌 Stripe Elements Stripe Checkout . 这些可以让你交换卡的细节,一个唯一的id条纹令牌 tok_12345

    推荐文章