首页 > 解决方案 > Angular/node.js Stripe Checkout 集成(1 个账户,方便第三方付款人向第三方收款人付款)

问题描述

伙计,我已经有几天了,找不到一个好的解决方案。我想使用我的帐户(通过公钥和私钥)来促进从一个帐户到另一个帐户的付款(没有任何东西会进入我的帐户)。在前端我有:

  checkout(amount) {
    const strikeCheckout = (<any>window).StripeCheckout.configure({
      key:  environment.PRODUCTION==='true'?stripeLiveClientId:stripeTestClientId,
      locale: 'auto',
      token:  (stripeToken: any) => {
        if(stripeToken){
          console.log(stripeToken)
          this.createCharge(stripeToken,amount)
        }
      }
    });
  
    strikeCheckout.open({
      name: 'Camel Stripe',
      description: 'Stripe Checkout',
      amount: amount
    });

  }

只是一个小片段,但本质上这只是捕获信用卡和电子邮件,并确保它是一张有效的信用卡,然后制作一个条带令牌。然后我将此令牌传递给节点后端并执行以下操作:

stripe.paymentIntents.create({
     amount: priceInPence,
     currency: 'usd',
     source: stripeTokenId,
     capture: false,  // note that capture: false
  }).then(charge => {
    return res.json({ success: true, message: 'Success', result: charge })
  }).catch(error => {
    res.status(400).json({ success: false, status: 400, message: error });
  });
//})
};

无论我如何构建它,它总是最终将付款发送到我的帐户,即具有公钥/私钥的帐户。有谁知道我可以使用这个令牌的方法,因为它有必要的信息,并将钱汇到另一个账户?

标签: node.jsangularstripe-paymentspayment-gateway

解决方案


除非您使用Connect ,否则您无法接受付款并将资金转移到完全不同的 Stripe 帐户中。


推荐阅读