PayPal Express Checkout useraction and paymenttype

2019-08-20 07:06发布

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条回答
做个烂人
2楼-- · 2019-08-20 07:26

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);
查看更多
登录 后发表回答