remitano / remitano-php
Remitano API Client
Requires
- php: >= 7.2
- ext-json: *
- guzzlehttp/guzzle: ^7.3
- spomky-labs/otphp: ^10.0
Requires (Dev)
- phpunit/phpunit: >=8.0
This package is not auto-updated.
Last update: 2025-03-19 06:56:52 UTC
README
Feel free to fork, modify & redistribute under the MIT license.
Installation
Via Composer
$ composer require remitano/remitano-php
Or clone this repository and include it in your project
Usage
Create API Key
Visit https://remitano.com/settings/api_key to create API key.
Get Authenticator secret
Visit https://remitano.com/settings/authenticator to get your authenticator secret.
Note: This is needed to perform actions which need 2FA authentication like withdrawals, otherwise, you won't need it.
Setup Remitano client
$client = new Remitano\Api\RemitanoClient([ 'apiKey' => 'your-api-key', 'apiSecret' => 'your-api-secret', 'authenticatorSecret' => 'your-authenticator-secret' ]);
Payment gateway
Visit https://developers.remitano.com/api-explorer - Merchant section for more information.
Charges
Get
$merchant_charges = new Remitano\Api\Merchant\Charge($client); $merchant_charges->get($id);
Create
- With coin currency:
$merchant_charges->create([ "coin_currency" => "usdt", "coin_amount" => 10.99, "cancelled_or_completed_callback_url" =>"https://example.com/payments/callback?id=example", "description" => "Example charge" ]);
Note: For now, we only support usdt
as the price coin currency.
- With fiat:
We support fiat currency of 56 countries that Remitano are supporting, i.e.,
USD
,AUD
. (You could find entire list in our developer docs).
$merchant_charges->create([ "fiat_currency" => "AUD", "fiat_amount" => 100.99, "cancelled_or_completed_callback_url" =>"https://example.com/payments/callback?id=example", "description" => "Example charge" ]);
Withdrawals
Get
$merchant_withdrawals = new Remitano\Api\Merchant\Withdrawal($client); $merchant_withdrawals->get($id);
Create
- Withdraw to external coin address
$merchant_withdrawals->create([ "merchant_withdrawal_ref" => "123", "coin_currency" => "btc", "coin_amount" => 1, "receiver_pay_fee" => true, "cancelled_or_completed_callback_url" => "http://sample.com/123/callback", "coin_address" => "3CpwViK5RAMzT8AmaMFHVHyfoyQSwNPB6y" ]);
- Withdraw to other remitano account
$merchant_withdrawals->create([ "merchant_withdrawal_ref" => "123", "coin_currency" => "btc", "coin_amount" => 1, "receiver_pay_fee" => true, "cancelled_or_completed_callback_url" => "http://sample.com/123/callback", "remitano_username" => "receiver123", "remitano_phone_number" => "+234 1 123 4567" ]);
Callbacks
Charges
Whenever a charge is changed to completed or cancelled in our system:
- we will send a POST request to
charge.cancelled_or_completed_callback_url
withremitano_id
param. - if user is still on our site, we will also redirect user to
object.cancelled_or_completed_callback_url
withremitano_id
param (GET request).
After receiving these callbacks, you could call $merchant_charges->get($params['remitano_id'])
to get the updated information and process accordingly.
Withdrawals
Whenever a withdrawal is changed to completed or cancelled in our system:
- we will send a POST request to
withdrawal.cancelled_or_completed_callback_url
withremitano_id
param.
After receiving these callbacks, you could call $merchant_withdrawals->get($params['remitano_id'])
to get the updated information and process accordingly.
Other API calls
Visit https://developers.remitano.com/api-explorer for more API specs, APIs can be called directly by using method get
, post
, put
of $client
$client->get('users/coin_accounts'); $client->post('offers/best', [ "country_code" => "my", "offer_type" => "buy", "coin_currency" => "btc", "coin_amount" => 1 ]);
Errors
When receiving non 200-299 http code, an Error will be raised.
Sandbox testing
We have a Testnet at https://remidemo.com.
You could register an account there, then submit a request at this google form with your Remidemo username, so we could help to setup your testing account as a merchant.
After that, you could start your sandbox testing by setting ENV variable: putenv("REMITANO_SANDBOX=1")
.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request