chengdu-blue-brothers / openapi-php-sdk
蓝色兄弟 openapi sdk
v0.0.1
2024-01-03 05:45 UTC
Requires
- php: >=5.6
- ext-json: *
- guzzlehttp/guzzle: ^6.2 || ^7.0
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.8
- jetbrains/phpstorm-attributes: ^1.0
- mockery/mockery: ~1.3.3 || ^1.4.2
- phpunit/phpunit: ^5.7 || ^7.5 || ^8.5.19 || ^9.5.8
This package is not auto-updated.
Last update: 2025-03-26 11:36:31 UTC
README
使用Composer安装
composer require chengdu-blue-brothers/openapi-php-sdk
api 接口调用
use BlueBrothers\Openapi\Api\Client;
const testMerchantId = "23329";
const testSecretKey = "8db16e8cc8363ed4eb4c14f9520bcc32";
const isProd = false; // 是否是生产环境
try {
$client = new Client(testMerchantId, testSecretKey, isProd, 10);
$res = $client->RechargeProduct();
} catch (\Exception $e) {
echo $e->getMessage();
}
解密卡密
use BlueBrothers\Openapi\Util;
$encCode = 'ezvbQdCehTDO7M7g22FjThOCypEhk/kswonAbdEEVsY=';
// 示例的密钥key
$secretKey = '8db16e8cc8363ed4eb4c14f9520bcc32';
// 第二步:aes-256-ecb 解密
try {
$decryptedCode = Util::getDecodeCardMap($encCode, $secretKey) ;
} catch (\Exception $e) {
echo $e->getMessage();
}