我试图找到类似的问题,但显然没有,所以希望我没有创建重复的线程。
无论如何,我已经尝试过PayPal SDK,并使用developer.paypal.com上的开发者帐户获得的适当客户端ID和客户端密码填写OAuthTokenCredential。
然而,当我尝试拨打Payment.Create(Api)的Payment对象时,我收到了PayPalException:
无效的HTTP响应远程服务器返回错误:(404)Not Found。
[ConnectionException:HTTP响应无效远程服务器返回错误:(404)Not Found。] PayPal.HttpConnection.Execute(String payLoad,HttpWebRequest httpRequest)+1275
[PayPalException:HttpConnection中的异常执行:无效的HTTP响应远程服务器返回错误:(404)Not Found。] PayPal.PayPalResource.ConfigureAndExecute(APIContext apiContext,HttpMethod httpMethod,String resource,Dictionary`2 headersMap,String payLoad)+1981 PayPal.PayPalResource.ConfigureAndExecute(APIContext apiContext,HttpMethod httpMethod,String resource,String payLoad)+93 PayPal.Api.Payments.Payment.Create(APIContext apiContext)+186
我不太确定,但是我们应该在开发者帐户本身处理它还是我的代码中缺少某些东西?
谢谢!
FundingInstrument fundingInstrument = new FundingInstrument();
CreditCardToken creditCardToken = new CreditCardToken();
creditCardToken.credit_card_id = GetSignedInUserCreditCardID(email);
fundingInstrument.credit_card_token = creditCardToken;
List<FundingInstrument> fundingInstrumentList = new List<FundingInstrument>();
fundingInstrumentList.Add(fundingInstrument);
Payer payer = new Payer();
payer.funding_instruments = fundingInstrumentList;
payer.payment_method = paymntMethod.ToString();
Payment pyment = new Payment();
pyment.intent = "sale";
pyment.payer = payer;
pyment.transactions = transactions;
try
{
pay = pyment.Create(Api);
}
catch(Exception ex){}