### Install MamoPay via Composer Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Use Composer to install the MamoPay package. Ensure you have PHP 5.6.0 or higher. ```bash composer require xplicit-dev/mamopay ``` -------------------------------- ### GET /me Source: https://context7.com/xplicit-dev/mamopay/llms.txt Fetch information about the authenticated business account. ```APIDOC ## GET /me ### Description Retrieves the profile information for the authenticated business account. ### Method GET ### Endpoint /me ### Response #### Success Response (200) - **id** (string) - The unique identifier of the business. ``` -------------------------------- ### GET /links Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all payment links associated with the business account. ```APIDOC ## GET /links ### Description Lists all payment links created by the business. ### Method GET ### Response #### Success Response (200) - **links** (array) - A list of payment link objects containing id, title, amount, and status. ``` -------------------------------- ### Access API Resources Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Resources are accessed via the $client object using a class()->function() pattern. Example shown for fetching a link. ```php // $client->class()->function() to access the API //Example $client->links()->get($linkId); ``` -------------------------------- ### GET /transactions Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all transactions with pagination. ```APIDOC ## GET /transactions ### Description Lists transactions associated with the account. ### Method GET ### Parameters #### Query Parameters - **page** (int) - Optional - Page number for pagination. - **perPage** (int) - Optional - Number of items per page. ``` -------------------------------- ### GET /links/{id} Source: https://context7.com/xplicit-dev/mamopay/llms.txt Fetch detailed information about a specific payment link. ```APIDOC ## GET /links/{id} ### Description Retrieves details for a specific payment link by its ID. ### Method GET ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payment link. ### Response #### Success Response (200) - **title** (string) - The title of the link. - **amount** (float) - The amount of the link. - **payment_url** (string) - The URL for the payment. ``` -------------------------------- ### Make Custom API Requests Source: https://context7.com/xplicit-dev/mamopay/llms.txt Execute direct API calls to endpoints not covered by the SDK. Supports custom POST and GET requests with parameters and filters. Available HTTP methods include GET, POST, PUT, DELETE, and PATCH. ```php 'card_abc123', 'amount' => 100.00, 'currency' => 'AED' ]; $response = $client->httpClient->sendRequest('/custom_endpoint', $params, HttpClient::METHOD_POST); // Custom GET request with filters $filters = ['page' => 1, 'per_page' => 50]; $response = $client->httpClient->sendRequest('/custom_endpoint', [], HttpClient::METHOD_GET, $filters); // Available HTTP methods HttpClient::METHOD_GET; HttpClient::METHOD_POST; HttpClient::METHOD_PUT; HttpClient::METHOD_DELETE; HttpClient::METHOD_PATCH; ``` -------------------------------- ### Fetch All Disbursements Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Retrieves a list of all disbursements associated with the account. No specific setup is required beyond client initialization. ```php $client->payout()->all(); ``` -------------------------------- ### GET /links Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Methods for managing payment links, including creation, retrieval, updates, and deletion. ```APIDOC ## GET /links ### Description Retrieve all payment links associated with the account. ### Method GET ### Endpoint $client->links()->all() ### Response Returns a collection of payment link objects. ``` -------------------------------- ### Get Transaction Details in PHP Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieves detailed information for a specific charge ID. ```php transaction()->get($chargeId); echo "Transaction ID: " . $transaction->id . "\n"; echo "Amount: " . $transaction->amount . "\n"; echo "Currency: " . $transaction->currency . "\n"; echo "Status: " . $transaction->status . "\n"; ``` -------------------------------- ### Manage Subscriptions Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Provides methods to fetch all subscribers, get subscription payment details, unsubscribe a subscriber, or cancel a recurring payment. ```php $client->subscription()->all($subscriptionId); ``` ```php $client->subscription()->get($subscriptionId); ``` ```php $client->subscription()->unSubscribe($subscriptionId,$subscriberId); ``` ```php $client->subscription()->cancelRecurring($subscriptionId); ``` -------------------------------- ### Get Disbursement Details Source: https://context7.com/xplicit-dev/mamopay/llms.txt Fetch detailed information about a specific disbursement using its ID. Requires an initialized MamoClient. ```php payout()->get($disbursementId); echo "Disbursement ID: " . $disbursement->id . "\n"; echo "Amount: " . $disbursement->amount . "\n"; echo "Status: " . $disbursement->status . "\n"; ``` -------------------------------- ### Get Transaction Info Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Retrieve details for a specific transaction using its charge ID. ```php $client->transaction()->get($chargeID); ``` -------------------------------- ### Get Transaction Details Source: https://context7.com/xplicit-dev/mamopay/llms.txt Fetch detailed information about a specific transaction by its charge ID. ```APIDOC ## Get Transaction Details ### Description Fetch detailed information about a specific transaction by its charge ID. ### Method GET ### Endpoint /transactions/{chargeId} ### Parameters #### Path Parameters - **chargeId** (string) - Required - The unique identifier of the transaction. ### Response #### Success Response (200) - **id** (string) - The transaction ID. - **amount** (number) - The transaction amount. - **currency** (string) - The currency of the transaction. - **status** (string) - The current status of the transaction. ### Response Example ```json { "id": "charge_abc123", "amount": 100.00, "currency": "USD", "status": "completed" } ``` ``` -------------------------------- ### Get Payment Link Details Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve specific details for a payment link using its unique ID. ```php links()->get($linkId); echo "Title: " . $paymentLink->title . "\n"; echo "Amount: " . $paymentLink->amount . "\n"; echo "Payment URL: " . $paymentLink->payment_url . "\n"; ``` -------------------------------- ### Get Payment Link Details Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Extract the ID and payment URL from the PaymentLink object returned after creating a link. ```php $id = $response->id; $payment_url = $response->payment_url; ``` -------------------------------- ### Get Recipient Details Source: https://context7.com/xplicit-dev/mamopay/llms.txt Fetch detailed information about a specific recipient by their identifier. Accesses nested bank details. ```php recipient()->get($recipientId); echo "Name: " . $recipient->first_name . " " . $recipient->last_name . "\n"; echo "Email: " . $recipient->email . "\n"; echo "Bank IBAN: " . $recipient->bank->iban . "\n"; ``` -------------------------------- ### Get Recipient Details API Source: https://context7.com/xplicit-dev/mamopay/llms.txt Fetch detailed information about a specific recipient by their identifier. ```APIDOC ## Get Recipient Details ### Description Fetch detailed information about a specific recipient by their identifier. ### Method GET ### Endpoint /recipients/{recipientId} ### Parameters #### Path Parameters - **recipientId** (string) - Required - The unique identifier of the recipient. ### Response #### Success Response (200) - **identifier** (string) - Unique identifier for the recipient. - **first_name** (string) - First name of the recipient. - **last_name** (string) - Last name of the recipient. - **email** (string) - Email address of the recipient. - **bank** (object) - Recipient's bank details. - **iban** (string) - International Bank Account Number. #### Response Example ```json { "identifier": "recipient_abc123", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "bank": { "iban": "AE080200000123223333121" } } ``` ``` -------------------------------- ### Instantiate MamoPay Client Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Initialize the MamoClient with your API key. For sandbox testing, pass 'true' as the second parameter. ```php use MamoPay\Api\MamoClient; $client = (new MamoClient('API_KEY')); ``` ```php $client = (new MamoClient('API_KEY',true)); ``` -------------------------------- ### POST /links Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Create a new vanilla or subscription payment link. ```APIDOC ## POST /links ### Description Generates a new payment link for the merchant. ### Method POST ### Endpoint $client->links()->create($title, $amount, $returnUrl, $params) ### Parameters - **title** (string) - Required - Title of the payment link - **amount** (float) - Required - Amount for the payment - **returnUrl** (string) - Required - URL to redirect after payment - **params** (array) - Optional - Additional configuration (e.g., is_widget, save_card) ### Response Returns a \MamoPay\Api\Objects\PaymentLink object. ``` -------------------------------- ### Fetch All Webhooks Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all registered webhooks for the business account. Requires an initialized MamoClient. ```php webhook()->all(); foreach ($webhooks as $webhook) { echo "Webhook ID: " . $webhook->id . "\n"; echo "URL: " . $webhook->url . "\n"; echo "Events: " . implode(', ', $webhook->enabled_events) . "\n"; echo "---\n"; } ``` -------------------------------- ### Create Vanilla Payment Link Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Generate a payment link with optional parameters like 'is_widget' and 'save_card'. Returns a PaymentLink object. ```php $params = ['is_widget' => true , 'save_card'=>true]; $response = $client->links()->create($title,$amount,$returnUrl,$params); ``` -------------------------------- ### Create Webhook Source: https://context7.com/xplicit-dev/mamopay/llms.txt Register a webhook endpoint to receive real-time notifications for payment and subscription events. Can register for all events or specific ones. Requires an initialized MamoClient. ```php webhook()->create( $webhookUrl, WebhookEvent::ALL_EVENT_TYPES, $authHeader ); echo "Webhook ID: " . $webhook->id . "\n"; echo "URL: " . $webhook->url . "\n"; // Or register for specific events only $specificWebhook = $client->webhook()->create( 'https://example.com/webhooks/payments', [ WebhookEvent::CHARGE_SUCCEEDED, WebhookEvent::CHARGE_FAILED, WebhookEvent::CHARGE_REFUNDED ] ); ``` -------------------------------- ### Create Webhook with Specific Events Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Demonstrates creating a webhook subscription for specific events or all event types. The response object contains the webhook ID. ```php use MamoPay\Api\Events\WebhookEvent; $response = $client->webhook()->create("http://example.com",WebhookEvent::ALL_EVENT_TYPES,'authentication header'); $response = $client->webhook()->create("http://example.com",[WebhookEvent::CHARGE_CARD_VERIFIED, WebhookEvent::CHARGE_SUCCEEDED]); $webhookId = $response->id; ``` -------------------------------- ### POST /card/create Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Creates a new Virtual Corporate Card for business expenses. ```APIDOC ## POST /card/create ### Description Creates a Virtual Corporate Card (VCC) for business expenses like travel and accommodations. ### Method POST ### Parameters #### Request Body - **amount** (float) - Required - The amount on the VCC card. The value can not exceed the card balance. - **email** (string) - Required - Cardholder’s email address. Card holder must be completed KYC. - **booking_id** (string) - Optional - Booking reference in case the card will be used for a 1 time booking. - **verification_email** (string) - Optional - The email address that will be used for verification purposes. ### Request Example ```php $client->card()->create(100.00, "user@example.com", "BK-12345", "verify@example.com"); ``` ``` -------------------------------- ### Fetch All Disbursements Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all disbursements/payouts made by the business. Requires an initialized MamoClient. ```php payout()->all(); foreach ($disbursements as $disbursement) { echo "Disbursement ID: " . $disbursement->id . "\n"; echo "Amount: " . $disbursement->amount . "\n"; echo "Recipient: " . $disbursement->recipient_name . "\n"; echo "Status: " . $disbursement->status . "\n"; echo "---\n"; } ``` -------------------------------- ### POST /transactions Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Initiate Merchant Initiated Transactions (MIT) using stored card details. ```APIDOC ## POST /transactions ### Description Charges a customer using previously stored card details. ### Method POST ### Endpoint $client->transaction()->create($card_id, $amount) ### Parameters - **card_id** (string) - Required - The ID of the stored card - **amount** (float) - Required - The amount to charge ### Response Returns a \MamoPay\Api\Objects\TransactionInfo object. ``` -------------------------------- ### Create a Webhook Registration Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Registers a webhook for receiving updates on payment statuses. Requires a URI, a list of events, and an authentication header. ```php $client->webhook()->create($uri,$events,'authentication header'); ``` -------------------------------- ### Create Payment Link Source: https://context7.com/xplicit-dev/mamopay/llms.txt Generate a payment link with optional parameters like widget mode or card saving. ```php true, 'save_card' => true, 'description' => 'Payment for services rendered' ]; $paymentLink = $client->links()->create($title, $amount, $returnUrl, $params); // Access the generated payment link details echo "Payment Link ID: " . $paymentLink->id . "\n"; echo "Payment URL: " . $paymentLink->payment_url . "\n"; ``` -------------------------------- ### Create Virtual Corporate Card in PHP Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Use this method to generate a new virtual card. Ensure the cardholder has completed KYC before providing their email address. ```php $client->card()->create(float $amount, string $email, string $booking_id='', string $verification_email = '', array $params = []); ``` -------------------------------- ### Fetch All Registered Webhooks Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Retrieves a list of all webhooks currently registered for the business. No parameters are required. ```php $client->webhook()->all(); ``` -------------------------------- ### Fetch All Transactions Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve a paginated list of transactions. ```php transaction()->all($page, $perPage); foreach ($transactions as $transaction) { echo "Transaction ID: " . $transaction->id . "\n"; echo "Amount: " . $transaction->amount . "\n"; echo "Status: " . $transaction->status . "\n"; echo "---\n"; } ``` -------------------------------- ### Fetch All Payment Links Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve a list of all payment links associated with the business account. ```php links()->all(); foreach ($links as $link) { echo "Link ID: " . $link->id . "\n"; echo "Title: " . $link->title . "\n"; echo "Amount: " . $link->amount . "\n"; echo "Status: " . $link->status . "\n"; echo "---\n"; } ``` -------------------------------- ### Fetch Subscription Payments in PHP Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieves all payment history for a recurring payment item. ```php subscription()->get($subscriptionId); foreach ($payments as $payment) { echo "Payment ID: " . $payment->id . "\n"; echo "Amount: " . $payment->amount . "\n"; echo "Date: " . $payment->created_at . "\n"; echo "---\n"; } ``` -------------------------------- ### Fetch Subscription Subscribers in PHP Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieves a list of all subscribers for a specific recurring payment. ```php subscription()->all($subscriptionId); foreach ($subscribers as $subscriber) { echo "Subscriber ID: " . $subscriber->id . "\n"; echo "Email: " . $subscriber->email . "\n"; echo "Status: " . $subscriber->status . "\n"; echo "---\n"; } ``` -------------------------------- ### Configure HTTP Client Source: https://context7.com/xplicit-dev/mamopay/llms.txt Customize the HTTP client's behavior for debugging, SSL verification, timeouts, retries, and custom API hosts or user agents. Note that disabling SSL verification is not recommended for production environments. ```php httpClient->enableDebugmode(); // Disable SSL verification for testing (not recommended for production) $client->httpClient->disableSslVerification(); // Set custom timeout (in seconds) $client->httpClient->setTimeoutInSeconds(120); // Enable automatic retry on rate limit hit $client->httpClient->enableRetryOnRateLimitHit(); // Set custom API host (for self-hosted or proxy scenarios) $client->httpClient->setApihost('custom.api.host.com'); // Set protocol (http/https) $client->httpClient->setProtocol('https'); // Set custom user agent $client->httpClient->setUseragent('My Custom App/1.0'); ``` -------------------------------- ### Create Merchant Initiated Transaction Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Initiate a transaction using stored card details. Requires card ID and amount. Returns a TransactionInfo object. ```php $charge = $client->transaction()->create($card_id,$amount); ``` -------------------------------- ### POST /transaction Source: https://context7.com/xplicit-dev/mamopay/llms.txt Charge a stored card using Merchant Initiated Transaction (MIT). ```APIDOC ## POST /transaction ### Description Charges a previously saved card. ### Method POST ### Request Body - **cardId** (string) - Required - The ID of the saved card. - **amount** (float) - Required - The amount to charge. - **currency** (string) - Required - The currency code (e.g., AED). ``` -------------------------------- ### Fetch All Transactions Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Retrieve a list of all transactions made by the merchant. ```php $client->transaction()->all(); ``` -------------------------------- ### Manage Payment Links Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Provides methods to fetch all payment links, update an existing link, delete a link, or retrieve specific link information. ```php $client->links()->all(); ``` ```php $client->links()->update($linkID,$params); ``` ```php $client->links()->delete($linkID); ``` ```php $client->links()->get($linkID); ``` -------------------------------- ### Create Merchant Initiated Transaction Source: https://context7.com/xplicit-dev/mamopay/llms.txt Charge a previously saved card using its card ID. ```php transaction()->create($cardId, $amount, $currency); echo "Charge ID: " . $charge->id . "\n"; echo "Status: " . $charge->status . "\n"; echo "Amount: " . $charge->amount . "\n"; ``` -------------------------------- ### Fetch Subscription Payments Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all payments made against a recurring payment item. ```APIDOC ## Fetch Subscription Payments ### Description Retrieve all payments made against a recurring payment item. ### Method GET ### Endpoint /subscriptions/{subscriptionId}/payments ### Parameters #### Path Parameters - **subscriptionId** (string) - Required - The unique identifier of the subscription. ### Response #### Success Response (200) - **id** (string) - The payment ID. - **amount** (number) - The payment amount. - **created_at** (string) - The date and time the payment was created. ### Response Example ```json [ { "id": "pay_12345", "amount": 50.00, "created_at": "2023-10-27T10:00:00Z" } ] ``` ``` -------------------------------- ### Fetch Subscription Subscribers Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all subscribers for a specific subscription/recurring payment. ```APIDOC ## Fetch Subscription Subscribers ### Description Retrieve all subscribers for a specific subscription/recurring payment. ### Method GET ### Endpoint /subscriptions/{subscriptionId}/subscribers ### Parameters #### Path Parameters - **subscriptionId** (string) - Required - The unique identifier of the subscription. ### Response #### Success Response (200) - **id** (string) - The subscriber ID. - **email** (string) - The email address of the subscriber. - **status** (string) - The status of the subscriber. ### Response Example ```json [ { "id": "subscriber_xyz789", "email": "test@example.com", "status": "active" } ] ``` ``` -------------------------------- ### Create a Recipient Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Allows a user to create a new recipient. This involves setting recipient details, including type, name, email, relationship, reason, address, and bank information. ```php $recipient = (new RecipientInfo())->set([ 'recipient_type' => RecipientInfo::RECIPIENT_TYPE_INDIVIDUAL, 'first_name' => 'John', 'last_name' => 'Doe', 'email' => 'john.doe@example.com', 'relationship' => RecipientInfo::RELATIONSHIP_CUSTOMER, 'reason' => 'Payment for services', 'eid_number' => '784-XXXX-XXXXXXX-0', 'address' => (new Address())->set([ 'address_line1' => '123 Main Street', 'address_line2' => 'Apt 4B', 'city' => 'Dubai', 'state' => 'AE', 'country' => 'AE' ]), 'bank' => (new Bank())->set([ 'iban' => 'AE080200000123223333121', 'account_number' => '123223333121', 'name' => 'ABC Bank', 'bic_code' => 'ABCDUAE123', 'address' => 'XYZ Bank Tower, Dubai', 'country' => 'AE' ]) ]); $client->recipient()->create($recipient) this will return a \MamoPay\Api\Objects\RecipientInfo object ``` -------------------------------- ### Refund Payment Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Initiate a refund for a transaction. Requires the charge ID and the amount to be refunded. ```php $client->transaction()->refund($chargeId,$amount); ``` -------------------------------- ### Create Virtual Corporate Card Source: https://context7.com/xplicit-dev/mamopay/llms.txt Generate a Virtual Corporate Card (VCC) for specific business expenses like travel. The cardholder must have completed KYC, and an optional booking reference and verification email can be provided. ```php card()->create($amount, $email, $bookingId, $verificationEmail); echo "Virtual Card URL: " . $card->url . "\n"; ``` -------------------------------- ### Send Custom API Request Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Use httpClient->sendRequest to interact with unlisted API endpoints. Requires card ID, amount, and currency for card-related operations. ```php 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); ``` -------------------------------- ### Issue Bulk Disbursements Source: https://context7.com/xplicit-dev/mamopay/llms.txt Process multiple payouts in a single API call for efficient batch transfers. Requires an initialized MamoClient and an array of Disbursement objects. ```php set([ 'account' => 'AE080200000123223333121', 'amount' => 100.00, 'first_name_or_business_name' => 'John', 'last_name' => 'Doe', 'reason' => 'Salary payment' ]); $disbursements[1] = (new Disbursement())->set([ 'account' => 'AE080200000456789012345', 'amount' => 250.50, 'first_name_or_business_name' => 'Jane', 'last_name' => 'Smith', 'reason' => 'Commission payment' ]); $disbursements[2] = (new Disbursement())->set([ 'account' => 'AE080200000987654321000', 'amount' => 75.00, 'first_name_or_business_name' => 'ABC Company', 'reason' => 'Vendor payment', 'transfer_method' => 'BANK_ACCOUNT' ]); $results = $client->payout()->issueMultiple($disbursements); foreach ($results as $result) { echo "Disbursement ID: " . $result->id . "\n"; echo "Status: " . $result->status . "\n"; echo "---\n"; } ``` -------------------------------- ### Fetch All Recipients Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Retrieves a list of all recipients associated with the account. No parameters are needed. ```php $client->recipient()->all(); ``` -------------------------------- ### Create Recipient Source: https://context7.com/xplicit-dev/mamopay/llms.txt Add a new payout recipient with their personal and bank details. Requires a populated RecipientInfo object. ```php set([ 'recipient_type' => RecipientInfo::RECIPIENT_TYPE_INDIVIDUAL, 'first_name' => 'John', 'last_name' => 'Doe', 'email' => 'john.doe@example.com', 'relationship' => RecipientInfo::RELATIONSHIP_CUSTOMER, 'reason' => 'Payment for services', 'eid_number' => '784-XXXX-XXXXXXX-0', 'address' => (new Address())->set([ 'address_line1' => '123 Main Street', 'address_line2' => 'Apt 4B', 'city' => 'Dubai', 'state' => 'Dubai', 'country' => 'AE' ]), 'bank' => (new Bank())->set([ 'iban' => 'AE080200000123223333121', 'account_number' => '123223333121', 'name' => 'Emirates NBD', 'bic_code' => 'EABORUMAXXX', 'address' => 'Downtown Dubai', 'country' => 'AE' ]) ]); $createdRecipient = $client->recipient()->create($recipient); echo "Recipient ID: " . $createdRecipient->identifier . "\n"; echo "Name: " . $createdRecipient->first_name . " " . $createdRecipient->last_name . "\n"; ``` -------------------------------- ### Issue Multiple Disbursements in Bulk Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Enables the issuance of multiple disbursements in a single request. Each disbursement must be an instance of the Disbursement class, with required fields like account, amount, and first name. ```php 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', ]); $disbursements = $client->payout()->issueMultiple($disbursement); ``` -------------------------------- ### Create Recipient API Source: https://context7.com/xplicit-dev/mamopay/llms.txt Add a new payout recipient with their personal and bank details. ```APIDOC ## Create Recipient ### Description Add a new payout recipient with their personal and bank details. ### Method POST ### Endpoint /recipients ### Parameters #### Request Body - **recipient_type** (string) - Required - Type of recipient (e.g., `individual`, `business`). - **first_name** (string) - Required if `recipient_type` is `individual` - First name of the recipient. - **last_name** (string) - Required if `recipient_type` is `individual` - Last name of the recipient. - **email** (string) - Required - Email address of the recipient. - **relationship** (string) - Required - Relationship to the business (e.g., `customer`, `employee`). - **reason** (string) - Required - Reason for the recipient. - **eid_number** (string) - Optional - Employee ID number. - **address** (object) - Required - Recipient's address details. - **address_line1** (string) - Required - First line of the address. - **address_line2** (string) - Optional - Second line of the address. - **city** (string) - Required - City. - **state** (string) - Required - State or province. - **country** (string) - Required - Country code (ISO 3166-1 alpha-2). - **bank** (object) - Required - Recipient's bank details. - **iban** (string) - Required - International Bank Account Number. - **account_number** (string) - Required - Bank account number. - **name** (string) - Required - Name of the bank. - **bic_code** (string) - Required - Bank Identifier Code. - **address** (string) - Optional - Bank address. - **country** (string) - Required - Bank country code. ### Request Example ```json { "recipient_type": "individual", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com", "relationship": "customer", "reason": "Payment for services", "eid_number": "784-XXXX-XXXXXXX-0", "address": { "address_line1": "123 Main Street", "address_line2": "Apt 4B", "city": "Dubai", "state": "Dubai", "country": "AE" }, "bank": { "iban": "AE080200000123223333121", "account_number": "123223333121", "name": "Emirates NBD", "bic_code": "EABORUMAXXX", "address": "Downtown Dubai", "country": "AE" } } ``` ### Response #### Success Response (200) - **identifier** (string) - Unique identifier for the created recipient. - **first_name** (string) - First name of the recipient. - **last_name** (string) - Last name of the recipient. #### Response Example ```json { "identifier": "recipient_xyz789", "first_name": "John", "last_name": "Doe" } ``` ``` -------------------------------- ### PUT /links/{id} Source: https://context7.com/xplicit-dev/mamopay/llms.txt Update an existing payment link's properties. ```APIDOC ## PUT /links/{id} ### Description Modifies properties of an existing payment link. ### Method PUT ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payment link. ### Request Body - **params** (array) - Required - Fields to update (e.g., title, amount, active). ``` -------------------------------- ### Webhook API Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Endpoints for registering and managing webhooks to receive payment status updates. ```APIDOC ## POST /webhook/create ### Description Webhook registration for updates on one-off payment statuses and subscription payment statuses. ### Parameters #### Request Body - **uri** (string) - Required - **events** (array) - Required - **authentication_header** (string) - Required ## GET /webhook/all ### Description Fetches all registered webhooks for a given business. ## PUT /webhook/update ### Description Update webhook details. ### Parameters #### Path Parameters - **webhookId** (string) - Required ## DELETE /webhook/delete ### Description Delete a registered webhook. ### Parameters #### Path Parameters - **webhookId** (string) - Required ## DELETE /webhook/deleteAll ### Description Delete all registered webhooks. ``` -------------------------------- ### Webhook Event Types Source: https://context7.com/xplicit-dev/mamopay/llms.txt Available webhook event constants for subscribing to specific payment notifications. These constants can be used when creating webhooks to filter events. ```php transaction()->capture($chargeId, $captureAmount); echo "Capture Status: " . $transaction->status . "\n"; echo "Captured Amount: " . $transaction->amount . "\n"; ``` -------------------------------- ### Update Webhook Details Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Updates the details of an existing webhook, including its URI, events, and authentication header. Requires the webhook ID. ```php $client->webhook()->update($webhookId,"http://example.com",WebhookEvent::ALL_EVENT_TYPES,'authentication header'); ``` -------------------------------- ### Fetch All Recipients API Source: https://context7.com/xplicit-dev/mamopay/llms.txt Retrieve all recipients registered with your business account. ```APIDOC ## Fetch All Recipients ### Description Retrieve all recipients registered with your business account. ### Method GET ### Endpoint /recipients ### Response #### Success Response (200) - **recipients** (array of objects) - A list of recipient objects. - **identifier** (string) - Unique identifier for the recipient. - **first_name** (string) - First name of the recipient. - **last_name** (string) - Last name of the recipient. - **email** (string) - Email address of the recipient. #### Response Example ```json [ { "identifier": "recipient_abc123", "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" }, { "identifier": "recipient_def456", "first_name": "Jane", "last_name": "Smith", "email": "jane.smith@example.com" } ] ``` ``` -------------------------------- ### Reverse On-Hold Transaction in PHP Source: https://context7.com/xplicit-dev/mamopay/llms.txt Releases held funds by reversing an authorized transaction. ```php transaction()->reverse($chargeId); echo "Transaction Reversed. Status: " . $transaction->status . "\n"; ``` -------------------------------- ### POST /transactions/refund Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Refund a previously processed transaction. ```APIDOC ## POST /transactions/refund ### Description Processes a refund for a specific transaction. ### Method POST ### Endpoint $client->transaction()->refund($chargeId, $amount) ### Parameters - **chargeId** (string) - Required - The ID of the transaction to refund - **amount** (float) - Required - The amount to refund ``` -------------------------------- ### Delete All Registered Webhooks Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Removes all registered webhooks for the business. This action is irreversible. ```php $client->webhook()->deleteAll(); ``` -------------------------------- ### DELETE /links/{id} Source: https://context7.com/xplicit-dev/mamopay/llms.txt Permanently remove a payment link. ```APIDOC ## DELETE /links/{id} ### Description Deletes a payment link from the account. ### Method DELETE ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payment link. ``` -------------------------------- ### DELETE /subscription/cancel Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Cancel an existing recurring payment subscription. ```APIDOC ## DELETE /subscription/cancel ### Description Cancels a recurring payment subscription created by the business. ### Method DELETE ### Endpoint $client->subscription()->cancelRecurring($subscriptionId) ### Parameters - **subscriptionId** (string) - Required - The ID of the subscription to cancel ``` -------------------------------- ### Issue a Single Disbursement Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Allows the issuance of a single disbursement to a specified account. Optional parameters include last name, reason, and transfer method. ```php $client->payout()->issue($account_no, $amount, $first_name, $last_name = '', $reason = '', $transfer_method = 'BANK_ACCOUNT'); ``` -------------------------------- ### Issue Single Disbursement in PHP Source: https://context7.com/xplicit-dev/mamopay/llms.txt Sends a payout to a recipient via bank transfer. ```php payout()->issue( $accountNo, $amount, $firstName, $lastName, $reason, $transferMethod ); echo "Disbursement ID: " . $disbursement->id . "\n"; echo "Status: " . $disbursement->status . "\n"; ``` -------------------------------- ### Recipient Type and Relationship Constants Source: https://context7.com/xplicit-dev/mamopay/llms.txt Available constants for specifying recipient types and business relationships within the MamoPay API. ```php 'Updated Invoice #12345', 'amount' => 150.00, 'active' => true ]; $updatedLink = $client->links()->update($linkId, $params); echo "Updated Title: " . $updatedLink->title . "\n"; ``` -------------------------------- ### Refund Transaction Source: https://context7.com/xplicit-dev/mamopay/llms.txt Process a full or partial refund for a completed transaction. ```APIDOC ## Refund Transaction ### Description Process a full or partial refund for a completed transaction. ### Method POST ### Endpoint /transactions/{chargeId}/refund ### Parameters #### Path Parameters - **chargeId** (string) - Required - The unique identifier of the transaction to refund. #### Request Body - **amount** (number) - Optional - The amount to refund. If not provided, the full transaction amount will be refunded. ### Request Example ```json { "amount": 25.00 } ``` ### Response #### Success Response (200) - **refund_status** (string) - The status of the refund. - **refund_amount** (number) - The amount that was refunded. ### Response Example ```json { "refund_status": "succeeded", "refund_amount": 25.00 } ``` ``` -------------------------------- ### Fetch a Specific Recipient Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Allows a user to fetch the details of a specific recipient using their unique identifier. Requires the recipient ID. ```php $client->recipient()->get($recipientID) ``` -------------------------------- ### Refund Transaction in PHP Source: https://context7.com/xplicit-dev/mamopay/llms.txt Processes a full or partial refund for a completed transaction. ```php transaction()->refund($chargeId, $refundAmount); echo "Refund Status: " . $refund->refund_status . "\n"; echo "Refund Amount: " . $refund->refund_amount . "\n"; ``` -------------------------------- ### Recipient API Source: https://github.com/xplicit-dev/mamopay/blob/master/README.md Endpoints for managing recipient profiles and bank details. ```APIDOC ## GET /recipient/all ### Description Fetches all recipients. ## POST /recipient/create ### Description Allows a user to create a recipient. ## GET /recipient/get ### Description Allows a user to fetch recipient details. ### Parameters #### Path Parameters - **recipientID** (string) - Required ## PUT /recipient/update ### Description Allows a user to update recipient details. ### Parameters #### Path Parameters - **recipientID** (string) - Required ## DELETE /recipient/delete ### Description Allows a user to delete a recipient. ### Parameters #### Path Parameters - **recipientID** (string) - Required ```