ongoua / pvit
用于使用 PVit 支付网关的包
dev-main
2021-06-03 04:31 UTC
Requires
- ext-curl: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
This package is auto-updated.
Last update: 2024-09-29 05:49:08 UTC
README
用于使用 PVit 支付网关的 composer 包
安装
使用 Composer
composer require ongoua/pvit
用法
提交请求
<?php use Ongoua\OngouaPvit; const TEL_MARCHAND = "077000000"; const TOKEN = "PVIT_TOKEN"; $clientPvit = new OngouaPvit(TEL_MARCHAND, TOKEN); $clientPvit->setMontant(100); $clientPvit->setRef("PROD66784"); $clientPvit->setTelClient("074567890"); try { $response = $clientPvit->send(); echo $response->getStatut(); } catch (Exception $e) { echo 'Error message: ' . $e->getMessage(); }
在您的 PVit 回调中
<?php use Ongoua\OngouaPvit; try { // $xmlPVit contains XML response provided by PVit $xmlPVit = "XML response from PVit"; $data = OngouaPvit::parse($xmlPVit); echo $data->getStatut(); } catch (Exception $e) { echo 'Error message: ' . $e->getMessage(); }
报告错误
在 Twitter 上私信我 @DimitriONGOUA