我有一个网站,处理我的用户的客户支付并转入他们(我的用户)的PayPal账户。我创建了一个PayPal应用程序,并在第三方设置中加入了处理借记卡和信用卡付款的功能。使用第三方帐户,我通过第三方权限授予了我的用户名访问权限。通过这些步骤,我相信我已经在PayPal方面授予了适当的访问权限。
以下是我的c#代码,其中我设置了配置:
Dictionary<string, string> PaypalConfig = new Dictionary<string, string>();
PaypalConfig.Add("account1.apiUsername", "my api username");
PaypalConfig.Add("account1.apiPassword", "my api password");
PaypalConfig.Add("account1.apiSignature", "my api signature");
PaypalConfig.Add("subject", "email address of my user");
PaypalConfig.Add("account1.applicationId", "my app id");
PaypalConfig.Add("mode", "live");
OAuthTokenCredential tokenCredential = new OAuthTokenCredential("my client id", "my client secret", PaypalConfig);
string accessToken = tokenCredential.GetAccessToken();
//Code to fill in the transaction details
//Create Payment
Payment payment = new Payment();
payment.intent = "sale";
payment.payer = payer;
payment.transactions = transactions;
Payment createdPayment = payment.Create(accessToken);
当我运行交易时,支付会被批准,但似乎忽略了主题,并将资金存入“我的账户”。 我在https://developer.paypal.com/docs/classic/invoicing/ht_invoicing-3p/上找到了有关向第三方发送发票的文档,但在REST API中,我确实没有看到任何关于处理第三方付款的内容。看起来我在使用第三方账户方面遗漏了一些东西。 感谢您提供任何帮助!