Paypal 与Braintree的每笔交易是否都需要一个付款暂时性条件?
我正在开发一个类似市场的应用程序,它支持通过Braintree进行支付处理。然而,我的大多数交易都非常小,而且考虑到Braintree的收费率,我不可能每次用户购买时都处理交易 因此,我希望在后端汇总付款,并在用户累计支出达到X美元或Y天之后向用户收费 考虑到每个Braintree交易似乎都需要一个支付时间,这种方法是否可能实现?如果没有,有人能提出替代方案吗Paypal 与Braintree的每笔交易是否都需要一个付款暂时性条件?,paypal,transactions,payment,stripe-payments,braintree,Paypal,Transactions,Payment,Stripe Payments,Braintree,我正在开发一个类似市场的应用程序,它支持通过Braintree进行支付处理。然而,我的大多数交易都非常小,而且考虑到Braintree的收费率,我不可能每次用户购买时都处理交易 因此,我希望在后端汇总付款,并在用户累计支出达到X美元或Y天之后向用户收费 考虑到每个Braintree交易似乎都需要一个支付时间,这种方法是否可能实现?如果没有,有人能提出替代方案吗 非常感谢。用一句话回答标题中的问题:不,与Braintree的每笔交易都不需要立即付款。 理论上,可以通过将买家的付款方式信息存入Bra
非常感谢。用一句话回答标题中的问题:不,与Braintree的每笔交易都不需要立即付款。 理论上,可以通过将买家的付款方式信息存入Braintree帐户,然后使用保险存储的付款方式进行收费。支付方法使用令牌存储在Braintree中。然后,可以使用支付方法令牌进行支付,而无需买方在场 但是,买方必须将付款方式授予您。这通常是由买家通过dropin表单或自定义表单向您提供他/她的付款方式信息来完成的,该表单会将nonce和信息返回给您。这要求买方在场 我建议遵循Braintree()参考部分的以下步骤
- 交易(如何进行基本一次性交易)
- 顾客
- 信用卡
- 交易(如何在买方不在场的情况下进行交易)
对于每个Braintree交易,不需要立即付款方式。买家通过dropin form或custom form提供其信息,该表单返回当前付款方式,我们将信息发送到braintree并获取
付款方式\u令牌。用python编写
@login_required
def clienttoken(request):
result = braintree.Customer.create({
"first_name": "XXXX",
"last_name": "XXX",
"company": "XXX",
"email": "XXXX",
"phone": "312.555.1234",
"fax": "614.555.5678",
"website": "www.example.com",
"credit_card": {
"cardholder_name": "XXX",
"number": "XXXX",
"expiration_date": "XXX",
"options": {
"verify_card": True,
},
},
})
client_token = braintree.ClientToken.generate({"customer_id": result.customer.id})
request.session['customer_id'] = result.customer.id
return render(request, "braintree/checkout.html", {"client_token": client_token})
@csrf_exempt
def checkout(request):
customer_id = request.session['customer_id']
nonce = request.POST['payment_method_nonce']
result = braintree.PaymentMethod.create({
"customer_id": customer_id,
"payment_method_nonce": nonce,
"options": {
"verify_card": True,
}
})
return HttpResponse(result.payment_method.token)
我们对braintree的每笔交易都使用支付方式令牌
result = braintree.Transaction.sale({
"amount": "400",
"payment_method_token": "token",
"options": {
"submit_for_settlement": "true",
}
})
您可以将API中的付款当前值保存为卡
result = braintree.Transaction.sale({
"amount": "400",
"payment_method_token": "token",
"options": {
"submit_for_settlement": "true",
}
})