PayPal Express Checkout useraction and paymenttype parameters in SDK

拟墨画扇 提交于 2019-12-25 02:47:36

问题


I'm using both the merchant .net SDK and the payflow .net sdk.

The documentation talks about being able to set a "useraction" property to "commit". I can't figure out how to set that property in either of the SDKs.

Also...

The payflow SDK allows me to set PaymentType to "instantonly".

ECSetRequest setRequest = new ECSetRequest();
setRequest.PaymentType = "instantonly";

The merchant SDK allows me to do the following.

PaymentDetailsType paymentDetails = new PaymentDetailsType();
paymentDetails.AllowedPaymentMethod = AllowedPaymentMethodType.INSTANTPAYMENTONLY;

Hopefully these two are equivalent


回答1:


You attach the useraction in the URL you are redirecting to.. eg:

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=<TOKEN>&useraction=commit

The two PaymentTypes you have listed are the same according to the API.

Also, based on this sample code you should be able to add the useraction=commit with the MerchantSDK.

Line 420 shows:

CurrContext.Items.Add("Response_redirectURL", ConfigurationManager.AppSettings["PAYPAL_REDIRECT_URL"].ToString()
  + "_express-checkout&token=" + setECResponse.Token);

and can be changed to:

CurrContext.Items.Add("Response_redirectURL", ConfigurationManager.AppSettings["PAYPAL_REDIRECT_URL"].ToString()
  + "_express-checkout&useraction=commit&token=" + setECResponse.Token);


来源:https://stackoverflow.com/questions/23523761/paypal-express-checkout-useraction-and-paymenttype-parameters-in-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!