在连接的帐户上更新元数据失败 [英] Updating MetaData on Connected account fails

查看:78
本文介绍了在连接的帐户上更新元数据失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Jaymedavis的stripe.net库的帮助下使用Stripe Connect(目的地付款).

I am using stripe connect(destination payment) with the help of stripe.net library from Jaymedavis.

我面临的问题是我无法检索目标付款ID来更新已连接帐户中的元数据.下一行返回一个空值,阻止我更新连接的帐户上的元数据.但是奇怪的是,当我登录到仪表板时,目标付款ID存在.我不确定为什么我不能在代码中检索它.

The problem that I am facing is that I am not able to retrieve the destination payment ID to update the metadata in the connected account. The following line returns a null preventing me from updating meta data on the connected account. But the strange thing is that when I log in to the dashboard the destination payment ID exists. I am not sure why I am not able to retreive it in code.

收费创建是否异步?我不知道.Stripe的连接文档也无济于事.下一行返回空值.我的代码在下面.寻求帮助.

Is the charge creation asynchronous?. I am not sure. Stripe's connect documentation does not help either. The following line returns a null. My code is down below. Seeking help.

字符串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;


 }

推荐答案

收费对象 transfer 属性不是已扩展,这意味着它只是ID为),而不是完整的传输对象.

The charge object's transfer attribute is not expanded by default, meaning it's just a string with the ID of the transfer object ("tr_..."), not a full transfer object.

根据Stripe.net的文档,您可以展开 transfer 属性:

According to Stripe.net's documentation, you can expand the transfer attribute by adding this line:

service.ExpandTransfer = True

在发送费用创建请求之前.

before sending the charge creation request.

这篇关于在连接的帐户上更新元数据失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆