khipu / khipu-api-client
Installs: 92 802
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 10
Forks: 4
Open Issues: 1
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
Add the dependency khipu/khipu-api-client to composer.json and run
composer install
Usage
Basic usage
<?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(); } ?>