rpay/prestashop-pokpay-payments-sdk

PokPay的Prestashop PHP SDK用于Checkout REST API

1.1.0 2022-10-28 09:03 UTC

This package is not auto-updated.

Last update: 2024-09-25 17:31:55 UTC


README

PokPay的Prestashop PHP SDK用于Checkout REST API

安装和用法

需求

PHP 7.0及更高版本。也应该与PHP 8.0兼容,但尚未进行测试。

Composer

$ composer require rpay/prestashop-pokpay-payments-sdk

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/pok-payments-sdk/vendor/autoload.php');

使用API密钥登录

请遵循安装过程,然后运行以下命令

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

// Create the configuration for the API calls
// getDefaultConfiguration accepts a parameter to specify whether the production environment is used
// By default the staging environment is used
// The same configuration is later used for all the other API classes
$config = RPay\POK\PaymentsSdk\Configuration::getDefaultConfiguration(true);

$apiInstance = new RPay\POK\PaymentsSdk\Api\AuthApi(
    $config,
    new GuzzleHttp\Client(),
);

$keyId = 'PokPay Key Id';
$keySecret = 'PokPay Key Secret';

$payload = new \RPay\POK\PaymentsSdk\Model\LoginSdkPayload($keyId, $keySecret); // \RPay\POK\PaymentsSdk\Model\LoginSdkPayload

try {
    $result = $apiInstance->login($payload);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthApi->login: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI在生产环境中相对于https://api.pokpay.io,在预发布环境中相对于https://api-staging.pokpay.io

模型

授权

jwt

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

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

RPay Ltd

关于此包

此PHP包是由OpenAPI Generator项目自动生成的

  • API版本:1.0.0
  • 构建包:org.openapitools.codegen.languages.PhpClientCodegen