如何在 PayPal 工作时保留 JavaScript 变量?

发布于 2024-12-13 18:56:36 字数 491 浏览 0 评论 0原文

我需要一些澄清:

该过程基本上如下:客户填写表格,点击“继续”按钮,然后根据表格中的数据生成一系列 PDF。我想在按下“继续”按钮后立即使用 PayPal。付款后,生成PDF。在 PDF 生成之前保留表单数据的同时注入 PayPal 的最佳方法是什么?我想使用 JSON 将其发送到 $_SESSION 数组,但我认为它不会在中断后继续存在。这是我更愿意使用的方法,除非有充分的理由不这样做。

或者

最好直接制作 PDF,但在 PayPal 完成工作之前不要发送 PDF?无论如何,当 PayPal 执行其操作时,我如何保留变量?

而且,是的,我是一个相对 PayPal 菜鸟,所以如果我遗漏了一些看起来“明显”的东西,请不要成为一个空头族,并试图通过试图让我看起来很愚蠢来获得一些里程。我在寻找答案,而不是嘲笑。我可以让贝宝“工作”,但这不是重点。我想让该网站与 PayPal 保持中间工作。

如果这不是在这里得到解答的问题,请在删除此问题之前为我指出正确的方向。

写!

i need some clarification please:

the process is essentially as follow: client fills out form, hits 'continue' button and series of PDFs get generated based on data from form. i want to use PayPal right after the 'continue' button gets pressed. after payment, PDFs get generated. what is the best way to inject PayPal WHILE preserving form data BEFORE PDFs get cranked out? i wanted to use JSON to send it to the $_SESSION array, but i don't think it will survive the interruption. this is the method i'd prefer to use, unless there's a good reason not to.

OR

would it be best to just go ahead and crank out the PDFs but just NOT send the PDFs until after PayPal does its thing? regardless, how do i preserve variables while PayPal does its thing?

and, yes, i'm a relative PayPal noob, so if there's something i'm missing that would seem 'obvious', don't be a noughthead and try to get some mileage by trying to make me look stupid. i'm looking for answers, not ridicule. i can get PayPal 'working' but that's not the point. i want to keep the site working with PayPal working in the middle.

and if this isn't the kind of question that gets' answered here, please point me in the right direction before you delete this.

WR!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

向地狱狂奔 2024-12-20 18:56:36

如果我正确理解你的问题,这不是支付处理器的工作方式。

填写完表单后,您可以将信息保存在数据库中并返回一个 ID,该 ID 可以发送到 PayPal(使用“自定义”字段)。

然后使用 PayPal 的 IPN 服务,一旦该过程完成,该服务将向您的服务器发送 ping。

您可以参考如下指南:

http: //net.tutsplus.com/tutorials/php/using-paypals-instant- payment-notification-with-php/

一旦您收到 IPN 帖子,您的脚本需要读取“自定义”变量,并读取数据库详细信息,生成 PDF 并将其通过电子邮件发送给您的用户。

If I have understood your question correctly, this is not how payment processors work.

After filling out the form, you can save the information in a DB and return an ID, this ID can be sent to PayPal (using the "custom" field).

Then use PayPal's IPN service which will send a ping to your server once the process is complete.

You can refer to a guide like:

http://net.tutsplus.com/tutorials/php/using-paypals-instant-payment-notification-with-php/

Once you receive the IPN post, your script needs to read the "custom" variable, and read the DB details, generate the PDFs and email them to your user.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文