ezeasorekene/credo-payments
Composer 安装命令:
composer require ezeasorekene/credo-payments
包简介
This package is for communicating with credocentral.com and credodemo.com API
README 文档
README
This package is for communicating with credocentral.com and credodemo.com API
Getting Started
Install the package using composer.
Run composer require ezeasorekene/credo-payments
Define your api keys
Define your $apiKeys variable as an array with the public and private keys. You should get the keys from environment variables. Also define CREDO_MODE environment key with parameters DEMO | LIVE
$apiKeys = [ 'publicKey' => getenv("CREDO_MODE") == 'LIVE' ? getenv("CREDO_LIVE_PUBLIC_KEY") : getenv("CREDO_TEST_PUBLIC_KEY"), 'secretKey' => getenv("CREDO_MODE") == 'LIVE' ? getenv("CREDO_LIVE_SECRET_KEY") : getenv("CREDO_TEST_SECRET_KEY"), ];
Instantiating Transaction
$credo = new CredoPay( $apiKeys, getenv("CREDO_MODE") );
Set data to post using array. Please note that the serviceCode is an optional field. It is used when you want to split payments between different accounts
$credodata = [ 'reference' => uniqid(), 'amount' => 20000, //in kobo 'bearer' => 0, 'callbackUrl' => 'http://example.com/callback/credo', 'currency' => 'NGN', 'customerFirstName' => 'Credo', 'customerLastName' => 'Package', 'customerPhoneNumber' => '234080111111111', 'email' => 'credotest@gmail.com', 'channels' => array('card', 'bank'), 'serviceCode' => 'XXXXXXXXXXX', "metadata" => [ "customFields" => [ [ 'display_name' => 'Custom Field Display 1', 'variable_name' => 'Custom Field Variable 1', 'value' => 'Custom Field Value 1' ] ] ], ];
Response is a JSON encoded object. So to decode, perform a json_decode
$response = json_decode($credo->initialize($credodata));
Verifying Transaction
$credo = new CredoPay( $apiKeys, getenv("CREDO_MODE") ); $verify = json_decode($credo->verify($reference));
ezeasorekene/credo-payments 适用场景与选型建议
ezeasorekene/credo-payments 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 49 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 03 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ezeasorekene/credo-payments 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ezeasorekene/credo-payments 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-03