solidgate/php-sdk
Composer 安装命令:
composer require solidgate/php-sdk
包简介
Php API SDK for SolidGate payment gateway
README 文档
README
PHP SDK provides API options for integrating Solidgate’s payment orchestrator into your PHP applications.
Check our
- Payment guide to understand business value better
- API Reference to find more examples of usage
Structure
| SDK for PHP contains | Table of contents |
|---|---|
src/solidgate/ – main library source code for developmentcomposer.json – script for managing dependencies and library imports
|
Requirements Installation Usage Errors |
Requirements
- PHP: 7.2 or later
- Composer: Dependency manager for PHP
- Solidgate account: Public and secret key (request via sales@solidgate.com)
Installation
To start using the PHP SDK:
- Ensure you have your public and secret key.
- Install the SDK in your project using Composer:
composer require solidgate/php-sdk
- Alternatively, add the library to your composer.json file
{ "require": { "solidgate/php-sdk": "~1.0" } } - Import the installed libraries into your application.
- Use test credentials to validate your integration.
- After successful testing, request production credentials and deploy your service.
Composer simplifies the installation and management of SDK dependencies, ensuring seamless integration.
Usage
Charge a payment
<?php use SolidGate\API\Api; $api = new Api('YourMerchantId', 'YourPrivateKey'); $response = $api->charge(['SomePaymentAttributes from API reference']);
Reconciliations
<?php use SolidGate\API\Api; $api = new Api('YourMerchantId', 'YourPrivateKey'); $dateFrom = new \DateTime("2019-01-01 00:00:00+00:00"); $dateTo = new \DateTime("2020-01-06 00:00:00+00:00"); $orderIterator = $api->getUpdatedOrders($dateFrom, $dateTo); //$orderIterator = $api->getUpdatedChargebacks($dateFrom, $dateTo); //$orderIterator = $api->getUpdatedAlerts($dateFrom, $dateTo); foreach ($orderIterator as $order) { // process one order } if ($api->getException() instanceof \Throwable) { // save exception to log and retry request (if necessary) }
Form resign
<?php use SolidGate\API\Api; $api = new Api('YourMerchantId', 'YourPrivateKey'); $response = $api->formResign(['SomePaymentAttributes from API reference']); $response->toArray(); // pass to your Frontend
Errors
Handle errors, using a try/catch block.
try { $response = $api->charge([...]); } catch (Throwable $e) { error_log($e->getMessage()); }
Looking for help? Contact us
Want to contribute? Submit a pull request
solidgate/php-sdk 适用场景与选型建议
solidgate/php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 546.03k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 02 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 solidgate/php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 solidgate/php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 546.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 30
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-04