Stripe payments 条带支付网关异常,向条带中创建的客户付款
Stripe.StripeException: '客户上的地址无效。非印度卢比费用要求在.net core 3.0中输入印度境外的名称和地址,同时以条带形式向客户付款。第行出现错误Stripe payments 条带支付网关异常,向条带中创建的客户付款,stripe-payments,asp.net-core-webapi,Stripe Payments,Asp.net Core Webapi,Stripe.StripeException: '客户上的地址无效。非印度卢比费用要求在.net core 3.0中输入印度境外的名称和地址,同时以条带形式向客户付款。第行出现错误 Charge charge = chargeService.Create(chargeOptions); 代码如下: public ResponseModel StripeCreateCustomer() { ResponseModel res = new ResponseM
Charge charge = chargeService.Create(chargeOptions);
代码如下:
public ResponseModel StripeCreateCustomer()
{
ResponseModel res = new ResponseModel();
StripeConfiguration.ApiKey = _paymentSettings.Value.SecretKey;
// Create a Customer:
var customerOptions = new CustomerCreateOptions
{
Source = "tok_mastercard",//SourceToken
Email = "BillReleford@example.com",
Name = "JOHN2 SMITH",
};
var customerService = new CustomerService();
Customer customer = customerService.Create(customerOptions);
// Charge the Customer instead of the card
var chargeOptions = new ChargeCreateOptions
{
Amount = 1000,
Currency = "usd",
Customer = customer.Id,
Description = "Testing Payment",
};
var chargeService = new ChargeService();
Charge charge = chargeService.Create(chargeOptions);
res.Message = charge.Status;
res = returnResultModel(res.Message, (int)HttpStatusCode.OK, true, 0, string.Empty);
return res;
}
我刚刚得到一个解决方案…在stripe帐户中,选择的国家是“印度”,当我将其更改为“美国”时,它起了作用。我看到您在那里做的所有工作都是基于来源、电子邮件和名称三个值创建客户-没有看到您在任何地方创建/设置地址。“StripeConfiguration.ApiKey”包含一个复制的stripe密钥,它分别使用“customerService.Create(customerOptions)”和“chargeService.Create(chargeOptions)”创建和支付客户;API密钥本身不会创建任何内容。在您的客户选项中,任何地方都没有指定地址。我将名称和地址放在那里,但错误仍然存在。请编辑您的问题以显示您当时实际尝试的内容。