官方 Dojo PHP 库,支持 PHP 7.4+

v1.1.0 2023-12-06 10:07 UTC

README

官方 Dojo PHP 库,支持 支付 API.

安装

使用 Composer 安装 Dojo PHP 库

composer require dojo-engineering/dojo-php

构建源代码

为了构建,需要 PHP 7.4+。或者使用 VSCode devcontainer。执行以下步骤

  1. 运行
composer install
  1. 从仓库根目录运行(具有 execute 权限)
./build/generate-openapi.sh
  1. 将所有文件从 /generated/src 复制到 /src

文档

有关示例的完整列表,请查看 API 文档.

用法

use Dojo_PHP\ApiFactory;

$apiKey = "YOUR_API_KEY";
$apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey);

$req = new CreatePaymentIntentRequest();
$req->setReference("test");

$money = new Money();
$money->setValue(100);
$money->setCurrencyCode("GBP");

$req->setAmount($money);

$pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);

对于任何请求、错误或评论,请 提交一个问题提交一个拉取请求。您也可以在我们的 Discord 服务器 上联系我们。