Download the PHP package mycoolpay/php-sdk without Composer
On this page you can find all versions of the php package mycoolpay/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-sdk
My-CoolPay PHP SDK
My-CoolPay official SDK for PHP
Note
This PHP package let you easily integrate My-CoolPay Payment API to your application or your website. Before you start using this package, it's highly recommended to check resources below depending on your use case.
Table of contents
- 1. Requirements
- 2. Installation
- 3. Interact with API
- 3.1. Paylink
- 3.1. Payin
- 3.1. OTP
- 3.1. Payout
- 3.1. Check status
- 3.1. Get balance
- 4. Security helpers
- 4.1. IP verification
- 4.1. Callback request integrity
- More assistance
- Contributors
1. Requirements
2. Installation
2.1. Install Composer package
First of all, install Composer package from your CMD or your Terminal.
2.2. Initialize SDK object
Now you need to initialize the SDK object with your API keys.
Recommendations:
- It is better for you to save your keys outside the source code, in places like environment variables and just load them from source code
- Logger object is optional, it is used for debug purposes. To know more about My-CoolPay Logger class see My-CoolPay PHP Logger
- Both Logger and MyCoolPayClient objects don't need to be instantiated every time you need them, just instantiate them once (either at application startup or at first use) then share the instances within whole app with patterns such as Singleton or Dependency Injection
Logger constructor parameters:
MyCoolPayClient constructor parameters:
Parameter | Type | Default | Description |
---|---|---|---|
$public_key |
string |
Your API public key | |
$private_key |
string |
Your API private key | |
$logger |
?LoggerInterface |
null |
Logger object |
$debug |
boolean |
false |
true enables debug mode |
3. Interact with API
3.1. Paylink
Method description:
- @param
array
$data
- @return
MyCoolPay\Http\Response
- @throws
MyCoolPay\Http\Exception\HttpException
Data description:
For full $data
description check Paylink section in API Docs
3.2. Payin
Method description:
- @param
array
$data
- @return
MyCoolPay\Http\Response
- @throws
MyCoolPay\Http\Exception\HttpException
Data description:
For full $data
description check Payin section in API Docs
3.3. OTP
Method description:
- @param
array
$data
- @return
MyCoolPay\Http\Response
- @throws
MyCoolPay\Http\Exception\HttpException
Data description:
For full $data
description check OTP section in API Docs
3.4. Payout
Method description:
- @param
array
$data
- @return
MyCoolPay\Http\Response
- @throws
MyCoolPay\Http\Exception\HttpException
Data description:
For full $data
description check Payout section in API Docs
3.5. Check status
Method description:
- @param
string
$transaction_ref
- @return
MyCoolPay\Http\Response
- @throws
MyCoolPay\Http\Exception\HttpException
More information:
For more information check Status section in API Docs
3.6. Get balance
Method description:
- @return
MyCoolPay\Http\Response
- @throws
MyCoolPay\Http\Exception\HttpException
More information:
For more information check Balance section in API Docs
4. Security helpers
4.1. IP verification
Method description:
- @param
string
$ip
- @return
true
- @throws
MyCoolPay\Exception\UnknownIpException
More information:
For more information check Security section in API Docs
4.2. Callback request integrity
Method description:
- @param
array
$callback_data
- @return
true
- @throws
MyCoolPay\Exception\KeyMismatchException
- @throws
MyCoolPay\Exception\BadSignatureException
More information:
For more information check Security section in API Docs
More assistance
ℹ️ If you need further information or assistance, our teams are available at [email protected]. You can also get help from the developer community 💬
Contributors
All versions of php-sdk with dependencies
ext-curl Version *
ext-json Version *
mycoolpay/php-rest-client Version ^1.0