更新已连接帐户的元数据失败
Updating MetaData on Connected account fails
我在 Jaymedavis 的 stripe.net 库的帮助下使用 stripe connect(destination payment)。
我面临的问题是我无法检索目标付款 ID 来更新关联帐户中的元数据。以下行 returns 为空,阻止我更新连接帐户上的元数据。但奇怪的是,当我登录到仪表板时,目标付款 ID 存在。我不确定为什么我无法在代码中检索它。
费用创建是异步的吗?。我不知道。 Stripe 的连接文档也无济于事。下面一行 returns 为空。我的代码在下面。寻求帮助。
String deschargeID = result.Transfer.DestinationPayment;
这是我正在使用的代码
var service = new StripeChargeService(ZambreroSecretKey);
var result = (Stripe.StripeCharge) null;
try {
result = service.Create(newCharge);
if (result.Paid) {
//get the chargeID on the newgen account and update the metadata.
//Returns null even though it exists in the dashboard
String deschargeID = result.Transfer.DestinationPayment;
var chargeService = new StripeChargeService(newgenSecretKey);
StripeCharge charge = chargeService.Get(deschargeID);
charge.Metadata = myDict;
Response.Redirect("PgeCustSuccess.aspx?OrderID=" + OrderID);
}
} catch (StripeException stripeException) {
Debug.WriteLine(stripeException.Message);
stripe.Text = stripeException.Message;
}
charge object's transfer
attribute is not expanded by default, meaning it's just a string with the ID of the transfer object("tr_..."
),不是完整的传输对象。
根据 Stripe.net 的 documentation,您可以通过添加以下行来扩展 transfer
属性:
service.ExpandTransfer = True
在发送费用创建请求之前。
我在 Jaymedavis 的 stripe.net 库的帮助下使用 stripe connect(destination payment)。
我面临的问题是我无法检索目标付款 ID 来更新关联帐户中的元数据。以下行 returns 为空,阻止我更新连接帐户上的元数据。但奇怪的是,当我登录到仪表板时,目标付款 ID 存在。我不确定为什么我无法在代码中检索它。
费用创建是异步的吗?。我不知道。 Stripe 的连接文档也无济于事。下面一行 returns 为空。我的代码在下面。寻求帮助。
String deschargeID = result.Transfer.DestinationPayment;
这是我正在使用的代码
var service = new StripeChargeService(ZambreroSecretKey);
var result = (Stripe.StripeCharge) null;
try {
result = service.Create(newCharge);
if (result.Paid) {
//get the chargeID on the newgen account and update the metadata.
//Returns null even though it exists in the dashboard
String deschargeID = result.Transfer.DestinationPayment;
var chargeService = new StripeChargeService(newgenSecretKey);
StripeCharge charge = chargeService.Get(deschargeID);
charge.Metadata = myDict;
Response.Redirect("PgeCustSuccess.aspx?OrderID=" + OrderID);
}
} catch (StripeException stripeException) {
Debug.WriteLine(stripeException.Message);
stripe.Text = stripeException.Message;
}
charge object's transfer
attribute is not expanded by default, meaning it's just a string with the ID of the transfer object("tr_..."
),不是完整的传输对象。
根据 Stripe.net 的 documentation,您可以通过添加以下行来扩展 transfer
属性:
service.ExpandTransfer = True
在发送费用创建请求之前。