问题
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