lowsprofile / midtrans
此软件包已被废弃,不再维护。没有推荐替代软件包。
Midtrans API 的 PHP 封装。
1.1.0
2018-03-18 14:47 UTC
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- codeception/aspect-mock: ^1.0 | ~2.0.1
- doctrine/annotations: ~1.2.0
- goaop/framework: ^1.0.0-alpha.2 | ~2.0.0
- jakub-onderka/php-parallel-lint: ^0.9.0
- mockery/mockery: ~0.9
- php-mock/php-mock-phpunit: ^0.3 | ^1.1
- phpunit/phpunit: ^5.0
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2022-05-14 17:14:50 UTC
README
Midtrans-PHP 是 Midtrans 支付网关 API 的 PHP 封装,适用于 PHP 5.6+。它强调可读性、简洁性和灵活性——基本上提供完成任务所需的功能和灵活性,并使这些功能易于使用。
本项目遵守 贡献者行为准则。通过参与本项目及其社区,您应遵守此准则。
预览
以下是一些令人垂涎的内容。通过 order_id
或 transaction_id
获取交易状态。请注意,库自动将响应解释为 JSON 并将其解析为对象数组。有关更多示例和特定用例的方法,请参阅 Wiki 上的食谱。
<?php require 'vendor/autoload.php'; use Lowsprofile\Midtrans\Method\Midtrans; Midtrans::$server_key = 'SERVER_KEY_HERE'; $order_id = 'example-1424936368'; $status = Midtrans::status($orderid); echo json_encode($status); /* { "status_code" : "200", "status_message" : "Success, transaction found", "transaction_id" : "249fc620-6017-4540-af7c-5a1c25788f46", "masked_card" : "481111-1114", "order_id" : "example-1424936368", "payment_type" : "credit_card", "transaction_time" : "2015-02-26 14:39:33", "transaction_status" : "capture", "fraud_status" : "accept", "approval_code" : "1424936374393", "signature_key" : "2802a264cb978fbc59f631c68d120cbda8dc853f5dfdc52301c615cf4f14e7a0b09aa...", "bank" : "bni", "gross_amount" : "30000.00" } */
安装
推荐的安装方法是使用 Packagist 和 Composer。运行以下命令安装软件包并将其添加到项目 composer.json
的依赖项中:
composer require lowsprofile/midtrans
文档
请参阅 Wiki 上的最新文档。
贡献
欢迎贡献!请阅读 CONTRIBUTING 以获取详细信息。
许可
MIT 许可证 © 2017-Present Eries Trisnadi. 版权所有。