Paypal自适应支付结果
本文关键字:结果 自适应 Paypal | 更新日期: 2023-09-27 18:08:15
我是paypal的新手,下面的代码是我的代码
ReceiverList receiverList = new ReceiverList();
receiverList.receiver = new List<Receiver>();
Receiver secondaryReceiver = new Receiver((Decimal)1.00);
secondaryReceiver.email = "platfo_1255170694_biz@gmail.com";
receiverList.receiver.Add(secondaryReceiver);
Receiver primaryReceiver = new Receiver((Decimal)2.00);
primaryReceiver.email = "platfo_1255612361_per@gmail.com";
primaryReceiver.primary = true;
receiverList.receiver.Add(primaryReceiver);
RequestEnvelope requestEnvelope = new RequestEnvelope("en_US");
string actionType = "PAY";
string returnUrl = "https://www.facebook.com/";
string cancelUrl = "https://www.facebook.com/";
string currencyCode = "USD";
PayRequest payRequest = new PayRequest(requestEnvelope, actionType, cancelUrl, currencyCode, receiverList, returnUrl);
payRequest.ipnNotificationUrl = "http://replaceIpnUrl.com";
Dictionary<string, string> sdkConfig = new Dictionary<string, string>();
sdkConfig.Add("mode", "sandbox");
sdkConfig.Add("account1.apiUsername", "ryanano89-facilitator_api1.gmail.com");
sdkConfig.Add("account1.apiPassword", "KNQ6M7MH3SJKVGQ8");
sdkConfig.Add("account1.apiSignature", "AJ2gHJOSiReCgvozz1y4PVUNExXxA1jzzgOvl4pQaW6Ll2KWgHK6.hd3");
sdkConfig.Add("account1.applicationId", "APP-80W284485P519543T");
AdaptivePaymentsService adaptivePaymentsService = new AdaptivePaymentsService(sdkConfig);
PayResponse payResponse = adaptivePaymentsService.Pay(payRequest);
object dsa = payResponse.error;
现在我所做的是,我使用了一个简单的按钮,并将上面的内容分配给它。但最终当我点击按钮,它没有任何paypal灯箱弹出,以便让买家支付付款。我可以知道我还缺少什么吗?
最后,我只需要从响应中获得paykey,并重定向到
的urlResponse.Redirect("https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=" + payResponse.payKey);
和一切都将是正确的