I am working on MVC Project in which i need to use adaptive chained payment system with authorization and capture.
Right Now, I am following this link:-
https://xadaptivepayments.codeplex.com/
This code is working fine for transferring Payments in more than one account. But I don't know how can i add paymentaction parameter while it redirects to sandbox account for payment so that Seller Can Capture Payment.
My Code is As Follows:-
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);
Please help me Out in this one.
Thanks in Advance...