Stripe Connect refund with transfer reversal:资金不足



我们目前正在使用Stripe Connect代表外部平台接受支付。付款过程运行良好(我们使用的是转账,在付款时直接将资金转移到连接的账户),如下所示:

PaymentIntentCreateParams.Builder paramsBuilder = PaymentIntentCreateParams
.builder()
.setAmount(getFinalPurchasePrice())
.setCustomer(customerStripeId)
.setPaymentMethod(getStripePaymentMethodId())
.setConfirm(true)
.setOffSession(true)
.setOnBehalfOf(stripeConnectedAccountId)
.setTransferData(PaymentIntentCreateParams.TransferData.builder()
.setAmount(getFinalTransferPrice())
.setDestination(stripeConnectedAccountId)
.build())
.setCurrency(getCurrency().toString().toLowerCase());

现在我们面临退款的问题。在测试模式下,它们工作得很好(和预期的一样)。但在直播模式中,我们却"资金不足"。这是我们的请求:

RefundCreateParams refundCreateParams = RefundCreateParams.builder()
.setReverseTransfer(true)
.setCharge(charge.getId())
.setAmount(amount)
.setReason(RefundCreateParams.Reason.REQUESTED_BY_CUSTOMER)
.build();
Refund.create(refundCreateParams, requestOptions);

结果如下:

"error": {
"message": "Insufficient funds in your Stripe balance to refund this amount.",
"request_log_url": "xxxx",
"type": "invalid_request_error"
}
}

使用的收费是一个成功的收费,并且超过这里指定的金额。连接帐户的余额也足够高,可以支付退款。

我们的账户目前没有足够的余额来支付退款中指定的金额,但由于我们使用的是转账反转,所以我假设反向转账负责支付这笔费用。是我错了,还是我们做错了什么?

在与Stripe支持人员聊天后回答我自己的问题。正如我所说,我们使用Stripe Connect与转账,立即将一定金额转移到连接的帐户,并为自己保留一部分。

如果我们以转账反转开始退款,它需要这个"削减";考虑并计算它需要从连接的帐户中收取多少费用以及从平台帐户中收取多少费用。这导致了"资金不足"。错误,因为我们的平台账户目前没有足够的资金支付这部分费用。