matthiasmullie/ogone
Composer 安装命令:
composer require matthiasmullie/ogone
包简介
Wrapper class to make Ogone implementations a lot easier
README 文档
README
Example usage
/* * Build your Ogone object; you'll need to do this to build the submission form * as well as to process the result from Ogone. */ // order details $orderID = 1; $amount = 50; $currency = 'EUR'; // your Ogone config setup (see Ogone class phpdoc for more info) $pspId = '<your-PSP-id>'; $shaIn = '<your-SHA-In>'; $shaOut = '<your-SHA-Out>'; $digest = 'SHA512'; // value can be either SHA1', 'SHA256' or 'SHA512 $environment = 'test'; // value can be either 'test' or 'prod' $method = 'post'; // value can be either 'get' or 'post' $verification = 'each'; // value can be either 'main' or 'each' // create Ogone-object use MatthiasMullie\Ogone; $ogone = new Ogone\Ogone($orderID, $amount, $pspId, $currency, $shaIn, $shaOut, $digest); // define test or production (for real payments) Ogone environment $ogone->setEnvironment($environment); $ogone->setMethod($method); $ogone->setVerification($verification); /* * Initialize a payment: build the form data to submit to Ogone. */ // add parameters (see parameter list: https://secure.ogone.com/ncol/Ogone_e-Com-ADV_EN.pdf) // here are some sample parameters $ogone->setParameter('LANGUAGE', 'nl'); $ogone->setParameter('CN', 'Matthias Mullie'); $ogone->setParameter('EMAIL', 'ogone-example@mullie.eu'); $ogone->setParameter('OWNERADDRESS', ''); $ogone->setParameter('OWNERZIP', ''); $ogone->setParameter('OWNERTOWN', ''); $ogone->setParameter('OWNERCTY', ''); $ogone->setParameter('ACCEPTURL', ''); $ogone->setParameter('DECLINEURL', ''); $ogone->setParameter('EXCEPTIONURL', ''); $ogone->setParameter('CANCELURL', ''); $ogone->setParameter('TP', ''); // ... // build form to submit $form = '<form method="POST" action="'.$ogone->getEnvironment().'">'; $parameters = $ogone->getFormParameters(); foreach($parameters as $key => $value) { $form .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />'; } $form .= '<input type="submit" value="Pay with Ogone">'; $form .= '</form>'; /* * Verify a payment. */ // verify the SHA signature if($ogone->isCorrectSHA()) { // fetch all details retrieved from Ogone... $ogoneResponse = $ogone->getDetail(); // no parameter // ... or retrieve a specific value $status = $ogone->getDetail('status'); // 'status' parameter // your business logic here }
Installation
Simply add a dependency on matthiasmullie/ogone to your composer.json file if you use Composer to manage the dependencies of your project:
composer require matthiasmullie/ogone
Although it's recommended to use Composer, you can actually include these files anyway you want.
License
Ogone is MIT licensed.
matthiasmullie/ogone 适用场景与选型建议
matthiasmullie/ogone 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.96k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2013 年 04 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 matthiasmullie/ogone 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 matthiasmullie/ogone 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-04-15