gpt4 book ai didi

c# - Paypal payKey 将我带到错误的付款

转载 作者:太空宇宙 更新时间:2023-11-03 12:48:23 25 4
gpt4 key购买 nike

我正在尝试创建一个 API 调用来创建拆分付款。创建 AdaptivePaymentService 并调用 Pay 方法后,它会返回一个显示 SUCCESSPayResponse。但是,当我获得 payKey 并打开位于 https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey= 的页面时,它将我带到某个随机页面,该页面通常会显示一些错误信息,例如“此交易已获批准。请访问您的 PayPal 帐户概览以查看详细信息。”,在右上角,它会显示“Fiverr .com”或其他一些随机网页。我已验证我收到的 payKey 是随 SUCCESS 消息一起发送的,所以我不明白为什么这是无效的。以下代码是我正在使用的。

        ReceiverList receiverList = new ReceiverList();
receiverList.receiver = new List<Receiver>();
RequestEnvelope requestEnvelope = new RequestEnvelope("en_US");

Dictionary<string, string> configurationMap = new Dictionary<string, string>();

configurationMap.Add("account1.apiUsername", "----");
configurationMap.Add("account1.apiPassword", "----");
configurationMap.Add("account1.apiSignature", "----");
configurationMap.Add("account1.applicationId", "APP-80W284485P519543T");

configurationMap.Add("mode", "sandbox");

Receiver receiver1 = new Receiver();
receiver1.amount = ((decimal?)9.00);
receiver1.email = "rbxtrade-seller@gmail.com";

receiverList.receiver.Add(receiver1);

Receiver receiver2 = new Receiver();
receiver2.amount = ((decimal?)2.00);
receiver2.email = "rbxtrade-buyer@gmail.com";

receiverList.receiver.Add(receiver2);

PayRequest request = new PayRequest(requestEnvelope, "PAY", "https://devtools-paypal.com/guide/ap_parallel_payment/dotnet?cancel=true", "USD", receiverList, "https://devtools-paypal.com/guide/ap_parallel_payment/dotnet?success=true");

AdaptivePaymentsService service = new AdaptivePaymentsService(configurationMap);
PayResponse response = service.Pay(request);

if (!response.responseEnvelope.ack.ToString().Trim().ToUpper().Equals(AckCode.FAILURE.ToString()) && !response.responseEnvelope.ack.ToString().Trim().ToUpper().Equals(AckCode.FAILUREWITHWARNING.ToString()))
{
Process.Start("https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=" + response.payKey); //opens the webpage
}
else
{
Console.WriteLine("E:" + String.Join("\n", response.error.Select((x) => x.message)));
}

最佳答案

我目前在 java 中遇到这个问题。

尝试返回到此:“https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=” + paykey。它应该与此一起使用。

这就是我找到的所有内容,但对我不起作用。

关于c# - Paypal payKey 将我带到错误的付款,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36465256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com