C# 交易可以';无法完成付款授权操作
问题是我不能授权或订购付款。 如果可以的话,请帮我解决我的问题。 这是我的代码: 有什么想法吗C# 交易可以';无法完成付款授权操作,c#,asp.net,authentication,C#,Asp.net,Authentication,问题是我不能授权或订购付款。 如果可以的话,请帮我解决我的问题。 这是我的代码: 有什么想法吗 private static bool DoExpressCheckoutPaymentSandBox(string expressCheckoutToken, string expressCheckoutPayerID, string orderTotalValue, PayPalCurrency currency) { bool success = fals
private static bool DoExpressCheckoutPaymentSandBox(string expressCheckoutToken, string expressCheckoutPayerID, string orderTotalValue, PayPalCurrency currency)
{
bool success = false;
PayPalAPIHelper.PayPalSandboxWS.PaymentDetailsType paymentDetails = new PayPalSandboxWS.PaymentDetailsType();
paymentDetails.OrderTotal = new PayPalSandboxWS.BasicAmountType();
paymentDetails.OrderTotal.currencyID = ConvertProgramCurrencyToPayPalSandbox(currency);
paymentDetails.OrderTotal.Value = orderTotalValue;
paymentDetails.PaymentAction = PayPalSandboxWS.PaymentActionCodeType.Authorization;
paymentDetails.TransactionId = paymentDetails.TransactionId;
paymentDetails.AllowedPaymentMethod = PayPalSandboxWS.AllowedPaymentMethodType.InstantPaymentOnly;
PayPalAPIHelper.PayPalSandboxWS.DoExpressCheckoutPaymentReq payReq = new PayPalAPIHelper.PayPalSandboxWS.DoExpressCheckoutPaymentReq()
{
DoExpressCheckoutPaymentRequest = new PayPalAPIHelper.PayPalSandboxWS.DoExpressCheckoutPaymentRequestType()
{
Version = Version,
DoExpressCheckoutPaymentRequestDetails = new PayPalAPIHelper.PayPalSandboxWS.DoExpressCheckoutPaymentRequestDetailsType()
{
Token = expressCheckoutToken,
PaymentAction = PayPalAPIHelper.PayPalSandboxWS.PaymentActionCodeType.Authorization,
PaymentActionSpecified = true,
PayerID = expressCheckoutPayerID,
PaymentDetails = new PayPalAPIHelper.PayPalSandboxWS.PaymentDetailsType[] { paymentDetails },
}
}
};
PayPalAPIHelper.PayPalSandboxWS.DoExpressCheckoutPaymentResponseType doResponse =
BuildPayPalSandboxWebservice().DoExpressCheckoutPayment(payReq);
HandleErrorSandbox(doResponse);
success = true;
return success;
}