简体   繁体   English

多个帐户的条纹付款问题

[英]Stripe Payment issue to multiple account

Requirement: In my project I have to process sum of multiple payment.要求:在我的项目中,我必须处理多次付款的总和。 For ex: $1+$2=$3.例如:$1+$2=$3。 So I have to process the payment of $3 in stripe and want to transfer the $1 and $2 in different account of Connect after successfull payment.所以我必须处理3美元的支付,并希望在支付成功后将1美元和2美元转移到Connect的不同账户中。 So How can I achieve this.那么我怎样才能做到这一点。 here is my implementation but this is giving me an error "You have insufficient funds in your Stripe account."这是我的实现,但这给了我一个错误“您的 Stripe 帐户中资金不足”。 and getting an error at line "Transfer transfer = Transfer.create(transferParams);"并在“Transfer transfer = Transfer.create(transferParams);”行出现错误

@PostMapping("/multiple-payment")
public Object multiplePaymentIntent(@RequestBody MultiplePaymentRequest multiple) throws StripeException {
  Stripe.apiKey = stripeApiKey;
  PaymentIntentCreateParams params =
    PaymentIntentCreateParams.builder()
      .addPaymentMethodType("card")
      .setAmount(multiple.getTotalAmount()*1L)
      .setCurrency("usd")
      .setReceiptEmail("example@gmail.com")
      .setTransferGroup("{ORDER10}")
      .build();
  PaymentIntent paymentIntent = PaymentIntent.create(params);
  for(int i=0;i<multiple.getAccount().size();i++){
    TransferCreateParams transferParams =
      TransferCreateParams.builder()
        .setAmount(multiple.getAmount().get(i)*1L)
        .setCurrency("usd")
        .setDestination(multiple.getAccount().get(i))
        .setTransferGroup("{ORDER10}")
        .build();

    Transfer transfer = Transfer.create(transferParams);

  }
  return paymentIntent.toJson();
}

and RequestBody is和 RequestBody 是

public class MultiplePaymentRequest {
  Integer totalAmount;
  List<String> account;
  List<Integer> amount;
}

You can't transfer immediately because the funds haven't settled yet to be available in your Stripe platform balance, that takes a few days.您无法立即转账,因为资金尚未结算到您的 Stripe 平台余额中,这需要几天时间。

You'd generally use source_transaction here so you can call the Transfer API and link it to the payment.您通常会在此处使用source_transaction ,因此您可以调用 Transfer API 并将其链接到付款。 https://stripe.com/docs/connect/charges-transfers#transfer-availability https://stripe.com/docs/connect/charges-transfers#transfer-availability

See also this: Why I am getting 'insufficient funds' when trying Stripe Transfers even though I added TEST mode funds in my Account?另请参阅: 即使我在帐户中添加了 TEST 模式资金,为什么在尝试 Stripe Transfers 时仍收到“资金不足”?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM