paysera/lib-wallet-bundle

用于与Paysera钱包API集成的Symfony2组件

安装次数: 21,340

依赖关系: 0

建议者: 0

安全性: 0

星级: 1

关注者: 9

分支: 2

开放问题: 1

类型:symfony-bundle

0.1.1 2017-12-26 13:33 UTC

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');