hkulekci / mmo-payment-client
MMO支付系统
v2.1
2019-05-27 12:15 UTC
Requires
- php: >=5.6, >=7.0
- ext-json: *
- ext-openssl: *
This package is not auto-updated.
Last update: 2024-09-10 13:11:38 UTC
README
使用composer安装或克隆该存储库到您的代码库中。此客户端可以帮助您创建重定向URL以访问支付页面。
您需要提供基础URL、UUID和密钥才能使用此库。
<?php
require __DIR__ . '/../vendor/autoload.php';
define(P_UUID, '123456');
define(P_SECRET_KEY, '123456');
define(P_BASE_URL, 'http://127.0.0.1:7070/');
$hashedContent = new \MmoPaymentClient\HashedContent('identifier', 'Name Surname', 1050);
$hashedContent->addParam('sicilNo', '12344');
$hashedContent->addVisibleParam('Sicil No', '12344');
$hashedContent->addParam('tcKimlikNo', '123445345346');
$hashedContent->addVisibleParam('TC Kimlik No', '123445345346');
$parameters = new \MmoPaymentClient\Parameters(P_UUID, $hashedContent);
$url = \MmoPaymentClient\BuildUrl::buildFromParameters(
P_BASE_URL,
P_SECRET_KEY,
$parameters
);
echo $url . PHP_EOL;
URL将如下所示
https://base-url-for-payment-system.com/payment/start?uuid=your-uuid&content=hashed-content-with-secret
支付流程
用户:使用支付系统进行付款的人。客户端:希望在自身项目中使用支付系统的人。提供商:支付系统的提供者。
- 客户端将在弹出窗口中提供重定向操作以访问支付页面。
- 提供商将显示支付方式和支付页面。
- 用户将对应用程序进行支付。
- 提供商将页面重定向到客户端的重定向URL。
- 客户端将从URL中获取提供商的响应。