wildan99 / global-pay
GlobalPay 套件
0.7
2024-03-29 09:50 UTC
Requires
- php: >=8.2
- doctrine/annotations: ^1.13
- doctrine/doctrine-bundle: ^2.5
- doctrine/doctrine-migrations-bundle: ^3.2
- doctrine/orm: ^2.11
- ramsey/collection: *
- ramsey/uuid: *
- symfony/dotenv: ^7.0
- symfony/framework-bundle: ^7.0
- symfony/http-client: ^7.0
- symfony/validator: ^7.0
Requires (Dev)
- phpunit/phpunit: ^10
- psalm/plugin-symfony: ^5.1
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: *
- symfony/phpunit-bridge: ^7.0
- vimeo/psalm: *
- zircote/swagger-php: ^4.8
README
安装
安装此包
composer req wildan99/global-pay
添加到 config/bundles.php
Daniil\GlobalPayBundle\GlobalPayBundle::class => ['all' => true],
复制路由
/vendor/wildan99/global-pay/config/routes/global_pay.yaml to config/routes/global_pay.yaml
在控制台运行
php bin/console doctrine:migrations:diff php bin/console doctrine:migrations:migrate --no-interaction
将以下行添加到您的 .env 文件中
###> GlobalPay ### GLOBAL_PAY_URL=<get it in GlobalPay> GLOBAL_PAY_AUTH_URL=<get it in GlobalPay> GLOBAL_PAY_SERVICE_ID=<get it in GlobalPay> GLOBAL_PAY_CLIENT_ID=<get it in GlobalPay> GLOBAL_PAY_GRANT_TYPE=<get it in GlobalPay> GLOBAL_PAY_SCOPE=<get it in GlobalPay> GLOBAL_PAY_CLIENT_SECRET=<get it in GlobalPay> GLOBAL_PAY_USERNAME=<get it in GlobalPay> GLOBAL_PAY_PASSWORD=<get it in GlobalPay> ###< GlobalPay ###
如何使用
您需要在类的构造方法中使用此服务
简单使用示例
class MyClass { public function __construct(private \Daniil\GlobalPayBundle\Service\Client $client) { } public function prepare(): void { $this->client->prepare(new PrepareRequest(shopTransactionId: 'test', sum: 1000, currency: Currency::UZS, description: '')) } }