将 Paypal 与 Phalcon 3 集成

Integrating Paypal with Phalcon 3

我想在我的 Phalcon 3 网络应用程序中集成贝宝。如果有人能在这个过程中帮助我,那就太好了。

进行 google 搜索后;我遇到了这些资源:https://github.com/MiladAlshomary/paypal_phalcon and https://github.com/paypal/PayPal-PHP-SDK

具体来说,我正在寻找一个 example/tutorial,它告诉我如何在 phalcon 3 中集成 paypal。

这里要求的是我的代码的样子:

我的 config.php 看起来像这样:

"paypal" => [
    "apiUsername" =>"xxxx",
    "apiPassword" =>"xxxxx",
    "apiSignature" =>"",
    "apiLive" => "false",
    "returnUrl" => "http://paypal/confirm/",
    "cancelUrl" => "http://paypal/cancel/",
    "payment_description" => "Purchasing with paypal",
    "payment_amount" => 50
    ],

xxxx 替换为我的沙箱凭据。我正在使用来自控制器的 buyAction 进行这些更改。

$config = new Phalcon\Config\Adapter\Php(__DIR__ . '/../../app/config/config.php');

我已将库包含在 index.php 中,位于 public 文件夹中,代码如下所示:include DIR . "/../library/Paypal.php";

阅读 https://developer.paypal.com/ 的 paypal API 让我了解了如何解决这个问题。

如果您有任何替代解决方案,请随时与我分享。