Stripe - 是否可以在收取费用之前编辑金额?
Stripe - Is it possible edit amout before capture a charge?
如您在 Stripe Api Reference 中所见,要获取您只需要的费用:
import stripe
stripe.api_key = "sk_test_whatever"
ch = stripe.Charge.retrieve("ch_whatever")
ch.capture()
但是是否可以在捕获之前编辑检索到的费用金额?
此时:
ch = stripe.Charge.retrieve("ch_whatever") # Here you have the charge object
所以你可以看到它的数量
ch.amount
# 7000
我想知道我是否可以在捕获费用之前对其进行编辑。我试过:
ch.amount = 9000
ch.save()
# This is what I get
InvalidRequestError: Request req_whatever: Received unknown parameter: amount
API 文档状态:
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
This request accepts only the description, metadata, receipt_email, fraud_details, and shipping as arguments.
您无法更新费用金额。
当您调用 capture charge
api 时,您可以获取少于请求金额的金额。卡网络不允许您获取超过您授权的金额。
如您在 Stripe Api Reference 中所见,要获取您只需要的费用:
import stripe
stripe.api_key = "sk_test_whatever"
ch = stripe.Charge.retrieve("ch_whatever")
ch.capture()
但是是否可以在捕获之前编辑检索到的费用金额?
此时:
ch = stripe.Charge.retrieve("ch_whatever") # Here you have the charge object
所以你可以看到它的数量
ch.amount
# 7000
我想知道我是否可以在捕获费用之前对其进行编辑。我试过:
ch.amount = 9000
ch.save()
# This is what I get
InvalidRequestError: Request req_whatever: Received unknown parameter: amount
API 文档状态:
Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
This request accepts only the description, metadata, receipt_email, fraud_details, and shipping as arguments.
您无法更新费用金额。
当您调用 capture charge
api 时,您可以获取少于请求金额的金额。卡网络不允许您获取超过您授权的金额。