1. Go to this page and download the library: Download xplicit-dev/mamopay library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xplicit-dev / mamopay example snippets
use MamoPay\Api\MamoClient;
$client = (new MamoClient('API_KEY'));
$client = (new MamoClient('API_KEY',true));
// $client->class()->function() to access the API
//Example
$client->links()->get($linkId);
$client->me();
$client->mybalance();
use MamoPay\Api\MamoClient;
$client = (new MamoClient('API_KEY'));
$params = ['card_id' => $card_id, 'amount' => $amount, 'currency' => $currency];
$response = $client->httpClient->sendRequest('end_point',$params,HttpClient::METHOD_POST);
$params = ['is_widget' => true , 'save_card'=>true];
$response = $client->links()->create($title,$amount,$returnUrl,$params);
// subscription payment link (recommended): create the subscription first, then attach it
$subscription = $client->subscription()->create('monthly', 1);
$params = ['link_type' => 'inline', 'subscription_id' => $subscription->identifier];
$response = $client->links()->create($title,$amount,$returnUrl,$params);
$client->payout()->issue($account_no, $amount, $first_name, $last_name = '', $reason = '', $transfer_method = 'BANK_ACCOUNT');
// pay out to a saved recipient instead of raw bank details (optional trailing params)
$client->payout()->issue(null, $amount, '', '', $reason, 'BANK_ACCOUNT', $recipient_id);
use MamoPay\Api\Objects\Disbursement;
$client = (new MamoClient());
$disbursement[0] = (new Disbursement())->set([
'account' => 'AE080200000123223333121',
'amount' => 10,
'first_name_or_business_name' => 'John',
'last_name' => 'Doe',
]);
$disbursement[1] = (new Disbursement())->set([
'account' => 'AE080200000123223333121',
'amount' => 20.5,
'first_name_or_business_name' => 'John',
'last_name' => 'Doe',
'reason' => 'refund for lorem ipsum',
]);
// payouts to saved recipients can also be issued in bulk via the recipient_id property
$disbursement[2] = (new Disbursement())->set([
'recipient_id' => 'REP-6BB7CA8DC7',
'amount' => 15,
'reason' => 'payout to saved recipient',
]);
$disbursements = $client->payout()->issueMultiple($disbursement);
$response = $client->payout()->createInternational($recipient_id,$reason,$source_amount,null,'description');
// an Idempotency-Key header is always sent; pass your own as the last argument to control retries
$response = $client->payout()->createInternational($recipient_id,$reason,$source_amount,null,'description','my-idempotency-key');
$response = $client->invoice()->create(
amount: 100.00,
email: '[email protected]',
amount_currency: 'AED', // AED, USD, EUR, GBP or SAR
description: 'Consulting services',
);
// additional documented options are available as optional params:
// customer_type, first_name, last_name, phone_number, vat_enabled,
// plus via $params: additional_heading, additional_details, additional_cc_emails,
//
bash
export MAMO_API_KEY="your-sandbox-key"
export MAMO_SANDBOX=true # false for production keys
export MAMO_RUN_INTEGRATION=1 # integration tests skip without this
export MAMO_WEBHOOK_URL="https://your-public-endpoint/hook" # optional; must be publicly reachable
vendor/bin/phpunit --testsuite Integration
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.