小编Gau*_*hra的帖子

使用 Paypal 交易存储自定义元数据

我正在扩展一个当前使用 stripe 作为支付处理器的应用程序。该架构的实现方式是,为了满足合规性,我不会在应用程序数据库中存储任何交易和客户信息。因此,所有数据都作为交易元数据存储在 Stripe 中。

现在我需要扩展应用程序以添加 Paypal 支付网关,但在浏览文档后,我找不到 PayPal 交易 API 中可用的元数据选项,就像 Stripe 中的元数据选项一样。

我已经按照 v1 https://developer.paypal.com/docs/business/checkout/server-side-api-calls/create-order/中的建议尝试了 PayPal 的带有元数据的创建订单 API

createOrder: function(data, actions) {
    return actions.order.create({
      metadata:{
        "cid":1233,
        "dgn":"AH-GHGJTTHHHJ",
        "ct":"X-HGD898989","tfn":"xyz params",
        "type":"2",
        "lo":"lorem ipsum is a dummy text and hope it works"
      },
      purchase_units: [
        {
            "description":'xyz P30 Pro mobile',
            "amount":{"currency_code":"USD","value":199}
        }]
    });
  },
Run Code Online (Sandbox Code Playgroud)

但是在通过 TX_ID 检索事务时,我没有取回元数据对象。

因此,任何过去面临过这一挑战并能提出解决方法来通过 PayPal 实现这一目标的人都会受到高度赞赏。

paypal paypal-sandbox

4
推荐指数
1
解决办法
2198
查看次数

Google驱动器api文件已上传但未列出

我是Google Drive API的新手。我正在将文件从服务器上传到Google Drive。

在我的Gmail帐户中

  1. 创建一个服务帐户,下载密钥并上传到服务器
  2. 提供对Drive Api和SDK Api的访问。
  3. 添加了一个与Google通信的Controller,具体如下:

        set_include_path(get_include_path() . PATH_SEPARATOR . ROOT .DS. "vendors");
        require_once('Google/Client/Google_Client.php');
        require_once('Googl
    
    Run Code Online (Sandbox Code Playgroud)

e / Client / contrib / Google_DriveService.php');

    define('CLIENT_ID','my_client_here....');
    define('SERVICE_ACCOUNT_NAME','my_account_name here');
    define('KEY_FILE',VENDORS.'Google/Client/key/privatekey.p12');  // what i was availed by google.       

    if(is_file(KEY_FILE)){
        $client = new Google_Client();
        $key = file_get_contents(KEY_FILE);
        $client->setClientId(CLIENT_ID);
        $client->setAssertionCredentials(new Google_AssertionCredentials(
          SERVICE_ACCOUNT_NAME,
          array('https://www.googleapis.com/auth/drive'),
          $key)
     );


     $service = new Google_DriveService($client);


            $file = new Google_DriveFile();
            $file->setTitle('Any sample file title');
            $file->setDescription('An experiment to upload text file via server to server');
            $file->setMimeType('text/plain');

            $data = "Lorem ipsum is …
Run Code Online (Sandbox Code Playgroud)

php web-services google-api google-drive-api

1
推荐指数
1
解决办法
2039
查看次数

在centos下运行的aws ec2实例上的php7.2 php-xml、php-soap实例

我真的真的需要帮助在我的一个 aws ec2 实例上启动和运行moodle,我在 centos 上安装和启用 php-xml 扩展遇到了困难。我尝试了所有在线可用的解决方案,但没有一个对我有用。

这是我到目前为止尝试过的:

在一个新的 aws ec2 实例上,完成以下操作;

sudo yum update -y
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
sudo yum --enablerepo=remi,remi-php72 install php-xml
Run Code Online (Sandbox Code Playgroud)

//这会安装扩展,但由于某种原因扩展没有加载。我可以看到/etc/php.d/20-dom.ini,但这里似乎没有加载

http://ec2-52-66-197-132.ap-south-1.compute.amazonaws.com/info.php http://ec2-52-66-197-132.ap-south-1.compute .amazonaws.com/test.php

我从这个stackoverflow线程中获取了这个参考

我也遵循了这里提出的解决方案:https : //www.digitalocean.com/community/questions/can-t-install-php-xml-php-mbstring-etc-in-php-7-0

curl 'https://setup.ius.io/' -o setup-ius.sh
sudo bash setup-ius.sh
Run Code Online (Sandbox Code Playgroud)

我收到消息“不是 EL 发行版”

将非常感谢任何快速帮助。

谢谢

php moodle amazon-ec2 amazon-web-services totara

1
推荐指数
1
解决办法
2366
查看次数