【问题标题】:Stripe checkout , getting data after payment条纹结帐,付款后获取数据
【发布时间】:2021-09-04 07:12:12
【问题描述】:

我有一个条带结帐功能,可将用户重定向到他们这边的默认条带结帐页面,付款完成后,它会重定向到我的网站页面。问题是我需要从付款中获取一些数据,并且我阅读了文档,但我无法弄清楚如何接收这些数据。

我知道我必须放入条带结帐创建代码,但我需要某种函数来接收我传递的数据。


 const stripe = await this.stripePromise;
 const { error } = await stripe.redirectToCheckout({

     mode: 'subscription',

     lineItems: [{ price: this.priceId, quantity: this.quantity }],

     clientReferenceId: this.userEmail,
     billingAddressCollection: this.userAdress,


     successUrl: `page`,
     cancelUrl: `page`,

   }); 

我正在传递 clientReferenceId 和 billingAddressCollection,但是如何在成功页面上接收呢?

我需要一些条带功能吗?

【问题讨论】:

    标签: javascript angular stripe-payments


    【解决方案1】:

    监听 webhook 事件,例如 payment_intent.succeeded。由于您使用的是 Checkout,请收听 checkout.session.completed 事件。

    【讨论】:

      猜你喜欢
      • 2018-05-26
      • 1970-01-01
      • 1970-01-01
      • 2022-06-10
      • 1970-01-01
      • 2023-03-21
      • 2023-02-03
      • 2015-03-12
      • 1970-01-01
      相关资源
      最近更新 更多