Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 使用ngx条带订阅_Angular_Laravel_Stripe Payments - Fatal编程技术网

Angular 使用ngx条带订阅

Angular 使用ngx条带订阅,angular,laravel,stripe-payments,Angular,Laravel,Stripe Payments,是否有人知道或了解如何向我解释ngx stripe如何进行订阅 我试着卷曲,但做不到 我可以做代币卡,但下一步怎么办 我有mi前端和Angular,后端和laravel 我不知道我需要做代币,然后是客户,最后是订阅。但是我不知道怎么做,我已经阅读了文档,但是我仍然被卡住了在Stripe中创建订阅的主要步骤是: 创建条带客户(条带/出纳) 收取付款方式(ngx条带) 将付款方式保存给客户(条带/出纳) 创建订阅(条带/收银台) 您将只能在第二步(收集支付方法)中使用ngx stripe,并且可能在

是否有人知道或了解如何向我解释ngx stripe如何进行订阅

我试着卷曲,但做不到

我可以做代币卡,但下一步怎么办

我有mi前端和Angular,后端和laravel


我不知道我需要做代币,然后是客户,最后是订阅。但是我不知道怎么做,我已经阅读了文档,但是我仍然被卡住了

在Stripe中创建订阅的主要步骤是:

  • 创建条带客户(条带/出纳)
  • 收取付款方式(ngx条带)
  • 将付款方式保存给客户(条带/出纳)
  • 创建订阅(条带/收银台)
  • 您将只能在第二步(收集支付方法)中使用ngx stripe,并且可能在第四步(创建订阅)由于SCA而需要身份验证的情况下使用ngx stripe。首先,我将按照ngx stripe文档创建令牌:

    但是,我不会调用
    this.stripeService.createToken
    ,而是调用
    this.stripeService.createPaymentMethod

        this.stripeService
          .createPaymentMethod({
            type: 'card',
            card: this.card.element,
            billing_details: { name },
          })
          .subscribe((result) => {
            if (result.paymentMethod) {
              // Send the payment method to your server
              console.log(result.paymentMethod.id);
            } else if (result.error) {
              // Error creating the token
              console.log(result.error.message);
            }
          });
    
    PaymentMethods是Stripe收集付款详细信息的较新建议路径

    创建PaymentMethod后,您需要将PaymentMethod ID发送到服务器。在服务器中,您将创建一个客户并将PaymentMethod保存到该客户:

    使用条纹

    使用Laravel出纳

    此时,您将拥有一个具有节省的PaymentMethod的Stripe客户。最后一步是为该客户创建订阅:

    使用条纹

    • (第三代码块)
    使用Laravel出纳


    这就是要点

    在条带中创建订阅的主要步骤是:

  • 创建条带客户(条带/出纳)
  • 收取付款方式(ngx条带)
  • 将付款方式保存给客户(条带/出纳)
  • 创建订阅(条带/收银台)
  • 您将只能在第二步(收集支付方法)中使用ngx stripe,并且可能在第四步(创建订阅)由于SCA而需要身份验证的情况下使用ngx stripe。首先,我将按照ngx stripe文档创建令牌:

    但是,我不会调用
    this.stripeService.createToken
    ,而是调用
    this.stripeService.createPaymentMethod

        this.stripeService
          .createPaymentMethod({
            type: 'card',
            card: this.card.element,
            billing_details: { name },
          })
          .subscribe((result) => {
            if (result.paymentMethod) {
              // Send the payment method to your server
              console.log(result.paymentMethod.id);
            } else if (result.error) {
              // Error creating the token
              console.log(result.error.message);
            }
          });
    
    PaymentMethods是Stripe收集付款详细信息的较新建议路径

    创建PaymentMethod后,您需要将PaymentMethod ID发送到服务器。在服务器中,您将创建一个客户并将PaymentMethod保存到该客户:

    使用条纹

    使用Laravel出纳

    此时,您将拥有一个具有节省的PaymentMethod的Stripe客户。最后一步是为该客户创建订阅:

    使用条纹

    • (第三代码块)
    使用Laravel出纳

    这就是要点