ois/gbusiness-api-php-sdk

Satispay GBusiness API PHP SDK

1.3.0 2020-12-17 10:24 UTC

This package is auto-updated.

Last update: 2024-09-11 11:08:40 UTC


README

Packagist Version Packagist Downloads

安装

运行以下命令

composer require satispay/gbusiness-api-php-sdk

如果您不想使用Composer,请导入init.php文件。

require_once("/path/init.php");

文档

https://developers.satispay.com

使用RSA签名进行认证

登录到您的仪表板(business.satispay.com),点击“Negozi Online”或“Negozi Fisici”,然后点击“Genera un token di attivazione”以生成激活令牌。

使用authenticateWithToken函数使用激活令牌生成并交换RSA密钥对。

将密钥保存在您的数据库中或在不允许从您的网站访问的安全位置。

// Authenticate and generate the keys
$authentication = \SatispayGBusiness\Api::authenticateWithToken("XXXXXX");

// Export keys
$publicKey = $authentication->publicKey;
$privateKey = $authentication->privateKey;
$keyId = $authentication->keyId;

认证后重新使用密钥。

// Keys variables
$publicKey = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhk...";
$privateKey = "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBg...";
$keyId = "ldg9sbq283og7ua1abpj989kbbm2g60us6f18c1sciq...";

// Set keys
\SatispayGBusiness\Api::setPublicKey($publicKey);
\SatispayGBusiness\Api::setPrivateKey($privateKey);
\SatispayGBusiness\Api::setKeyId($keyId);

启用沙盒

要启用沙盒,请使用setSandbox函数。

\SatispayGBusiness\Api::setSandbox(true);

变更日志

1.3.0

  • 添加了\SatispayGBusiness\Api::getPlatformHeader()方法。

  • 添加了\SatispayGBusiness\Api::setPlatformHeader()方法。

  • 添加了\SatispayGBusiness\Api::getTrackingHeader()方法。

  • 添加了\SatispayGBusiness\Api::setTrackingHeader()方法。

  • 添加了\SatispayGBusiness\Request::HEADER_OS常量,用于x-satispay-os请求头。

  • 添加了\SatispayGBusiness\Request::HEADER_OS_VERSION常量,用于x-satispay-osv请求头。

  • 添加了\SatispayGBusiness\Request::HEADER_APP_VERSION常量,用于x-satispay-appv请求头。

  • 添加了\SatispayGBusiness\Request::HEADER_APP_NAME常量,用于x-satispay-appn请求头。

  • 添加了\SatispayGBusiness\Request::HEADER_DEVICE_TYPE常量,用于x-satispay-devicetype请求头。

  • 添加了\SatispayGBusiness\Request::HEADER_TRACKING_CODE常量,用于x-satispay-tracking-code请求头。

  • \SatispayGBusiness\Request中将头部键从X-Satispay-Platformv更改为x-satispay-osv

  • \SatispayGBusiness\Request中将头部键从X-Satispay-Plugin-Version更改为x-satispay-appv

  • \SatispayGBusiness\Request中将头部键从X-Satispay-Plugin-Name更改为x-satispay-appn

  • \SatispayGBusiness\Request中将头部键从X-Satispay-Type更改为x-satispay-devicetype

1.2.1

  • 添加了\SatispayGBusiness\ApiAuthentication类。
  • 执行代码重构以符合PSR2编码标准。

1.2.0

  • 添加了\SatispayGBusiness\PreAuthorizedPaymentToken类。

1.1.1

  • 修复了composer文件版本。

1.1.0

  • 移除了\SatispayGBusiness\Api::testAuthentication()方法。

  • 移除了\SatispayGBusiness\Api::getSecurityBearer()方法。

  • 移除了\SatispayGBusiness\Api::setSecurityBearer()方法。

  • 添加了\SatispayGBusiness\Api::getPlatformVersionHeader()方法。

  • 添加了\SatispayGBusiness\Api::setPlatformVersionHeader()方法。

  • 添加了\SatispayGBusiness\Api::getPluginVersionHeader()方法。

  • 添加了\SatispayGBusiness\Api::setPluginVersionHeader()方法。

  • 添加了\SatispayGBusiness\Api::getPluginNameHeader()方法。

  • 添加了\SatispayGBusiness\Api::setPluginNameHeader()方法。

  • 添加了\SatispayGBusiness\Api::getTypeHeader()方法。

  • 添加了\SatispayGBusiness\Api::setTypeHeader()方法。