Paypal付款数据传输无法在沙箱中运行(Paypal Payment Data Transfer not working in sandbox)
我试图让Paypal在交易后重定向到我的网站并检索有关交易的信息。 到目前为止,Paypal确实重定向到了正确的位置,但之后我回到Paypal的php curl操作检索了一个错误页面而不是我期望的SUCCESS / FAIL消息:
对不起 - 您的上一个操作无法完成
[...]
我们目前无法完成您的请求。 请单击“重试”或稍后重试。 我们对不便表示抱歉。
消息3004
我试过让我的代码在屏幕上打印'tx'参数,手动构建我的请求并将其直接放在浏览器中,即:
但是返回上面描述的相同错误页面。
我已登录到我的沙盒paypal帐户,'at'参数包含与我的沙盒商家测试帐户关联的正确的付款数据传输身份令牌。
我的请求缺少什么吗? 我没有用我的实际Paypal帐户测试它,因为我不想要任何真正的货币兑换,直到我知道它有效。
I'm trying to get Paypal to redirect to my website after a transaction and retrieve information about the transaction. So far, Paypal does redirect to the correct location, but the php curl operation that I make back to Paypal afterwards retrieves an error page instead of the SUCCESS/FAIL message I'm expecting:
Sorry — your last action could not be completed
[...]
We are unable to complete your request at this time. Please click Retry or try again later. We apologize for the inconvenience.
Message 3004
I've tried simply having my code print the 'tx' parameter on screen, building my request manually and putting it directly in the browser, ie:
But the same error page described above gets returned.
I'm logged in to my sandbox paypal account, and the 'at' parameter holds the correct payment data transfer identity token associated with my sandbox merchant test account.
Is my request missing anything? I haven't tested it with my actual Paypal account since I don't want any real money exchanges until I know it works.
原文:https://stackoverflow.com/questions/11622493
最满意答案
正如评论中所提到的,最简单的方法是始终返回Promise,并使用已完成的Promise包装非异步操作。 要将值包装在已完成的promise中,只需使用static
pure
方法:public static Promise<Result> doSomethingAsync() { if (...) { return getData(); } else { return F.Promise.pure(ok(...)); } }
As mentioned in the comment, the easiest would be to always return a Promise, and wrap non-async actions with a completed Promise. To wrap a value in a completed promise, simply use the static
pure
method:public static Promise<Result> doSomethingAsync() { if (...) { return getData(); } else { return F.Promise.pure(ok(...)); } }
相关问答
更多-
当您执行昂贵且相对耗时的操作时使用承诺。 例如,如果您正在对数据库进行密集查询,则在收集所有记录时,您不希望让前端用户等待。 在这种情况下,您将返回Promise而不是Result。 这将阻止前端挂起,因为它正在等待密集计算的响应。 一旦计算完成,它将收到实际结果。 承诺在单独的线程中运行,因此只有在必要时才使用它们。 在大多数情况下,你只需要使用一个结果。 Play中有一个很好的页面! 讨论所有关于异步HTTP编程的框架文档: Promise最终将以Result类型的值进行兑换。 通过使用Promise而 ...
-
你需要的是switchMap ,它将你的间隔映射到另一个Observable的输出。 我不知道如何更好地描述它。 public static getWifiInfos(): Observable
{ return > Observable .interval(3000) .switchMap(() => Observable.fromPromise(Hotspot.getConnectio ... -
使用库dom-to-image按顺序返回promise结果(Return a promise result in order using the library dom-to-image)[2021-09-03]
据我所知,你可以使用Promise.all 。 像这样的东西: let pages = document.querySelectorAll('.page'); Promise.all(Array.prototype.slice.call(pages,0) .map(page =>domtoimage.toPng(page) ).then((pages)=>{.... your handler....}); 有关Promise.all的更多信息,您可以从MDN获得 As I understand for ... -
期望并应该使用Promise对象而不是解析结果(Expect and should use the Promise object instead of the resolved result)[2022-03-13]
我发现了错误。 问题是,正确的语法不是。 .should.to.be但是必须是.should.eventually.be I found the mistake. The problem is that the correct syntax is not .should.to.be but has to be .should.eventually.be -
我想你可以尝试通过以下方式内联@volatile var resp : def getItems(param: String): LiftResponse = { param.toLowerCase match { case "something" => val req = Async call returning a Future req.onComplete { case Success(items ...
-
正如评论中所提到的,最简单的方法是始终返回Promise,并使用已完成的Promise包装非异步操作。 要将值包装在已完成的promise中,只需使用static pure方法: public static Promise
doSomethingAsync() { if (...) { return getData(); } else { return F.Promise.pure(ok(...)); } } As mentioned in the commen ... -
从方法返回承诺结果(Return promise result from method)[2022-03-12]
不确定这是否是正确的方法,但它解决了我的问题。 我删除了latestId()方法,并围绕setNotification()代码包装了promise,这样它就不会尝试在promise被解析之前创建通知。 见下文: var notify = { alertTime: function() { t = new Date(); t.setSeconds(t.getSeconds() + 10); return t; }, clearAll: function() { $c ... -
你只需要添加2回报: module.exports = function () { // one return agentsSheet.useServiceAccountAuthAsync(creds).then(function(){ var data_promises = priceCols.map(function (col) { return agentsSheet.getCellsAsync(1, { 'min-row': 2, 'max ...
-
是的,这是完全合理的代码。 你甚至可以把它写成: return new Promise((resolve) => { resolve(some_list.filter((item) => { return item.count > 2; })); }); Yes, that's perfectly reasonable code to have. You could even write it as: return new Promise((resolve) => { ...
-
AWS开发工具包使用guzzle / promises,可以使用wait方法同步解析它们: return $promise->then(function () { return 'ok'; })->wait(); 请参阅https://github.com/guzzle/promises#synchronous-wait和http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/promises.html 。 The AWS SDK uses guzzle ...