我无法从 Stripe 的成功付款记录中检索/查看我设置的元数据。在 .NET 核心服务器端,我正在创建一个支付意图并将意图秘密返回给客户端,如下所示使用条带 .NET Core SDK:
[HttpGet]
public async Task<IActionResult> Index()
{
StripeConfiguration.ApiKey = stripeSecretKey;
var options = new PaymentIntentCreateOptions
{
Amount = 2999,
Currency = "CAD",
PaymentMethodTypes = new List<string>(){"card"},
Metadata = new Dictionary<string,string>()
{
{"stripePaymentFormId", "value1"}
{"camperId", "value2"}
}
};
var service = new PaymentIntentService();
var paymentIntent = service.Create(options);
return View(paymentIntent.ClientSecret);
}
在客户端,我使用 intentClient Secret 执行“confirmCardPayment”操作:
stripe.confirmCardPayment(intentClientSecret, {
payment_method: {
card: card,
type: 'card',
billing_details: {
name: `${billingName} ${billingLastName}`
}
},
}).then(function (result) {
//Handle success and errors
}
处理成功后,“付款成功”记录将添加到仪表板(不同的 ID)。金额和货币是从原始意图结转的,但是这个新的支付对象缺少元数据:
问题:
答案 0 :(得分:0)
result
调用在 confirmCardPayment
对象中获取的元数据。元数据可能包含敏感项目,因此您只能通过使用秘密 API 密钥检索 PaymentIntent 来查看元数据。