我正在尝试创建定期付款资料。我能够成功创建订阅。现在我想创建首付款订阅。我添加了以下代码:
CurrencyCodeType currency = (CurrencyCodeType)Enum.Parse(typeof(CurrencyCodeType), "USD");
BasicAmountType intialPaymentAmount = new BasicAmountType(currency, "4000");
scheduleDetails.ActivationDetails.InitialAmount = intialPaymentAmount;
但是上面这段代码抛出空引用对象错误。
这确实给我带来了错误:
scheduleDetails.ActivationDetails.InitialAmount = intialPaymentAmount;
但在 Debug模式下,intialPaymentAmount
中包含所有内容。
我做错了什么?
最佳答案
这样我就解决了问题
BasicAmountType intialPaymentAmount = new BasicAmountType(currency, "4000");
ActivationDetailsType acd = new ActivationDetailsType();
acd.InitialAmount = intialPaymentAmount;
acd.FailedInitialAmountAction = FailedPaymentActionType.CANCELONFAILURE;
scheduleDetails.ActivationDetails = acd;
关于c# - 具有初始金额的定期 paypal 付款的空引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27740232/