疯狂雪花 / payop-test
1.0.0
2022-05-02 15:24 UTC
Requires
- php: ^8.0.2
- guzzlehttp/guzzle: ^7.4
README
要安装,可以运行以下命令:
$ php composer.phar require crazysnowflake/payop-test "^1.0@dev"
或者将以下内容添加到你的 composer.json
文件的 require
部分:
"crazysnowflake/payop-test": "^1.0@dev"
to the require
section of your composer.json
file.
用法
use Crazysnowflake\PayopTest\PayopTest; $client = new PayopTest($public_key, $secret_key, $jwt_token); try { $invoiceID = $client->setPaymentMethod($method) ->setInvoiceResultUrl('Some Url') ->setInvoiceFailPath('Some Url') ->createInvoice($order, $customer); $card_token = $client->createCardToken($invoiceID, $card); $result = $client->setCheckStatusUrl('Some Url') ->checkout($invoiceID, $customer, $card_token['token']); $transaction = $client->getTransaction($result['txid']); $status = $client->checkInvoiceStatus($invoiceID); } catch (\GuzzleHttp\Exception\GuzzleException $e) { }
更多示例请查看 index.php
许可证
payop-test 采用 MIT 许可证发布。详情请参阅捆绑的 LICENSE.md
文件。