zipmoney/merchantapi-php

1.0.11 2021-02-03 03:37 UTC

README

ZipMoney 商户 API 初始构建

  • API 版本:2017-03-01

要求

PHP 5.3 及以上版本

安装与使用

Composer

要通过 Composer 安装绑定,请在 composer.json 中添加以下内容:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/zipMoney/merchantapi-php.git"
    }
  ],
  "require": {
    "zipMoney/merchantapi-php": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/merchantapi-php/autoload.php');

测试

要运行单元测试

composer require 
phpunit

入门

请按照 安装流程 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Authorization
\zipMoney\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
\zipMoney\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Bearer');
\zipMoney\Configuration::getDefaultConfiguration()->setEnvironment('ENVIRONMENT HERE'); // Allowed values are  ( sandbox | production )
\zipMoney\Configuration::getDefaultConfiguration()->setPlatform('PLATFORM HERE'); // E.g. Magento/1.9.1.2

$api_instance = new zipMoney\Api\ChargesApi();
$id = "id_example"; // string | The id of the authorised charge
$idempotency_key = "idempotency_key_example"; // string | The unique idempotency key.

try {
    $result = $api_instance->chargesCancel($id, $idempotency_key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ChargesApi->chargesCancel: ', $e->getMessage(), PHP_EOL;
}

?>

API 端点文档

所有 URI 都相对于 https://api.zipmoney.com.au/merchant/v1

模型文档

授权文档

授权

  • 类型:API密钥
  • API密钥参数名:Authorization
  • 位置:HTTP头

作者