PayPal DoDirectPayment中的空引用异常

时间:2017-09-17 17:34:48

标签: paypal paypal-sandbox payment

在PayPal的DoDirectPayment方法中,我面临空引用异常。尝试解决此问题时,根据更新的API将其他属性设置为传递给方法的对象。

正在使用虚拟信用卡进行付款。根据PayPal文档,DoDirectPayment方法仅适用于Website Payments Pro订阅。

在了解此问题后,我尝试使用沙盒帐户的专业订阅,但出现了同样的例外情况。关于这个问题的主要问题是相同的代码在网站的实时版本中工作,但在开发服务器中却没有。

例外情况如下

An exception of type 'System.NullReferenceException' occurred in 
PayPalCoreSDK.dll but was not handled in user code

Object reference not set to an instance of an object.

堆栈跟踪如下所示。

at PayPal.APIService.MakeRequestUsing(IAPICallPreHandler apiCallHandler)
at PayPal.BasePayPalService.Call(IAPICallPreHandler apiCallHandler)
at 
PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService
.DoDirectPayment(DoDirectPaymentReq doDirectPaymentReq, String apiUserName)
at 
PayPal.PayPalAPIInterfaceService.PayPalAPIInterfaceServiceService
.DoDirectPayment(DoDirectPaymentReq doDirectPaymentReq)

使用的PayPalCoreSDK版本是1.3.0.0。

0 个答案:

没有答案