machour / clictopay
ClicToPay PHP SDK
0.0.1
2022-09-07 15:25 UTC
Requires
- php: ^7.3|^7.4|^8.0|^8.1
- ext-json: *
README
安装
composer require machour/clictopay
使用
use Machour\ClicToPay\Gateway; use Machour\ClicToPay\Exception; $ctp = new Gateway('login', 'password'); try { $response = $ctp->register([ 'amount' => 10000, 'orderNumber' => '123456', 'description' => 'Pack Standard', 'returnUrl' => 'https://example.com/success', ]); // store $response->orderId and then header('Location: ' . $response->formUrl); exit; } catch (Exception $e) { }
API
/** * Authorization request * * @param array $params * @return UrlResponse * @throws Exception */ public function register(array $params): UrlResponse