paysera / lib-wallet-bundle
用于与Paysera钱包API集成的Symfony2组件
0.1.1
2017-12-26 13:33 UTC
Requires
- php: >=5.3.3
- evp/paysera-wallet-php-client: ^1.0.0
- symfony/symfony: ^2.3|^3.0
This package is auto-updated.
Last update: 2024-09-10 20:12:35 UTC
README
安装
composer require paysera/lib-wallet-bundle
在 AppKernel.php
$bundles = array(
// other bundles
new Paysera\Bundle\WalletBundle\PayseraWalletBundle(),
);
配置
在 config.yml
如果使用共享密钥
paysera_wallet:
client_id: %wallet_api_client_id%
secret: %wallet_api_secret%
如果使用证书凭证
paysera_wallet:
client_id: %wallet_api_client_id%
certificate:
private_key_path: %kernel.root_dir%/config/keys/wallet.key
private_key_password: %wallet_api_private_key_password%
certificate_path: %kernel.root_dir%/config/keys/wallet.crt
使用
$walletApi = $container->get('paysera_wallet_api');
$walletClient = $walletApi->walletClient();
$response = $walletClient->get('client');