zikraauliya / flip-connector
使用 Saloon PHP 集成 Flip 商业 API
v0.2.3
2024-06-23 14:10 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- saloonphp/saloon: ^3.0
- spatie/laravel-data: ^4.7
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
这是一个我为自己的个人项目使用的非官方包,因此这个包非常具有主观性。您仍然可以使用它为自己的项目使用,自行承担风险,或者作为灵感进行分支。
安装
您可以通过 composer 安装此包
composer require zikraauliya/flip-connector
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="flip-connector-config"
这是已发布配置文件的内容
return [ /* |-------------------------------------------------------------------------- | Secret Key |-------------------------------------------------------------------------- | | This value is the secret key found in your Flip Business account. This value is used when the | package needs to generate a base64 encoded encryption for Flip Business authorization. | */ 'secret_key' => env('FLIP_SECRET_KEY'), /* |-------------------------------------------------------------------------- | Environment |-------------------------------------------------------------------------- | | This value is determines the enviroment of Flip Business API endpoint. Available options are 'big_sandbox_api' | for testing, 'kyc' (Know-Your-Client) for Non-PJP Agent Money Transfer or 'api' for live production integration, | default value is 'big_sandbox_api'. | */ 'env' => env('FLIP_ENV', 'big_sandbox_api'), /* |-------------------------------------------------------------------------- | Base URL |-------------------------------------------------------------------------- | | This value is the base URL of Flip Business API endpoint. This value is based on env('FLIP_ENV'). | */ 'base_url' => 'https://bigflip.id/'.env('FLIP_ENV'), /* |-------------------------------------------------------------------------- | Validation Token |-------------------------------------------------------------------------- | | This value is the validation token found in your Flip Business account. This value is used when | we need to ensure whether the callback is actually from Flip server. | */ 'validation_token' => env('FLIP_VALIDATION_TOKEN'), /* |-------------------------------------------------------------------------- | Private Key |-------------------------------------------------------------------------- | | This value is the private section of public/private key ssh pair. | In this example we're storing private key in .ENV file, you can store it however you want. | In production environment you're highly recommended to store it as safe as possible. | */ 'private_key' => env('SSH_PRIVATE_KEY'), ];
用法
$flipConnector = new ZikraAuliya\FlipConnector(); $request = new GetBankInfoRequest; $response = $flip->send($request);
有关更多用法信息,请参阅 Flip 文档
测试
composer test
变更日志
请参阅 CHANGELOG 了解最近更改的信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全漏洞
请审查 我们的安全策略 了解如何报告安全漏洞。
致谢
许可
MIT 许可证 (MIT)。请参阅 许可文件 了解更多信息。