c# - 如何在c#中的paypal自适应链式支付系统中使用PaymentAction

标签 c# paypal chained-payments

我正在从事 MVC 项目,我需要在其中使用具有授权和捕获功能的自适应链式支付系统。

现在,我正在关注此链接:-

https://xadaptivepayments.codeplex.com/

此代码适用于在多个帐户中转移付款。但是我不知道如何在重定向到沙箱帐户进行付款时添加 paymentaction 参数,以便卖家可以捕获付款。

我的代码如下:-

    IPayPalAdaptivePaymentService _paysvc = new PayPalAdaptivePaymentService();
        Uri redirectUrl = new Uri(ConfigurationManager.AppSettings["REDIRECT-URL"]);
        Uri returnUrl = new Uri(ConfigurationManager.AppSettings["PAYPAL-RETURNURI"]);
        Uri cancelUrl = new Uri(ConfigurationManager.AppSettings["PAYPAL-CANCELURI"]);
        string str = "asdsadsadsads";
        string seller = ConfigurationManager.AppSettings["PAYPAL-SELLER"];
        string paymentref = "test123";
        string currency = "USD";
        List<x.paypal.model.Receiver> receivers = new List<x.paypal.model.Receiver>();
        receivers.Add(new x.paypal.model.Receiver { Amount = "3", Email = "payments-facilitator@akaritutoring.com", InvoiceId = str, Description = "test paypal payment" });
        receivers.Add(new x.paypal.model.Receiver { Amount = "7", Email = "yashsharmanice1@gmail.com", InvoiceId = str, Description = "test paypal payment 1" });
         IPayRequest payRequest = new x.paypal.model.PayRequest().CreateRequest().WithPaymentReference(paymentref).WithReturnUri(returnUrl).WithCancelUri(cancelUrl).Currency(currency).ReceiverList(receivers);
         var resp = _paysvc.RequestPayment(payRequest);
         return Redirect("https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_ap-payment&paymentaction=authorization&paykey=" + resp.PayKey);

请帮我解决这个问题。

提前致谢...

最佳答案

actionType 确定自适应支付中的支付操作。 Adaptive Payments 中没有支付操作,例如 sale、order 或 auth。 您可以使用 PAY_PRIMARY 的 actionType 来延迟支付,以指定支付给主要接收者而不是次要接收者。

您需要运行 ExecutePaymentAPI捕获付款

关于c# - 如何在c#中的paypal自适应链式支付系统中使用PaymentAction,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34029270/

相关文章:

php - Paypal 真正的一键加售

paypal - 自适应支付部分退款功能

php - Paypal 自适应支付(链式)- 链式支付中不允许单边接收方

c# - 在 Process.Start 中接受多行字符串

c# - 我们如何获得对当前 HttpRuntime 的引用?

regex - 使用 htaccess 将 Paypal 回调重新格式化为自定义 URL 格式

ruby-on-rails - Paypal 与 Rails 集成

c# - 如何使视频或音频文件 HTTP 响应始终下载而不是在浏览器中播放?

c# - Rest Sharp 没有序列化日期

cordova - 用于移动网络的 Paypal 链式支付