奇趣 / 奇趣-api客户端
2.9.1
2019-05-27 14:21 UTC
Requires
- php: >=5.3.3
- ext-curl: *
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: ~0.6.1
- squizlabs/php_codesniffer: ~2.0
README
将依赖 奇趣/奇趣-api客户端 添加到 composer.json 并运行
composer install
用法
基本用法
<?php require __DIR__ . '/vendor/autoload.php'; $c = new Khipu\Configuration(); $c->setSecret("abc123"); $c->setReceiverId(1234); $c->setDebug(true); $cl = new Khipu\ApiClient($c); $exp = new DateTime(); $exp->setDate(2020, 11, 3); $kh = new Khipu\Client\PaymentsApi($cl); try { $opts = array( "expires_date" => $exp, "body" => "test body" ); $resp = $kh->paymentsPost("Test de api", "CLP", 1570, $opts); print_r($resp); $r2 = $kh->paymentsIdGet($resp->getPaymentId()); print_r($r2); } catch(Exception $e) { echo $e->getMessage(); } ?>