### Example Response: Merchant Status API (JSON) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/enterprise-partner/merchant-status.md Provides a sample JSON object illustrating the data structure returned by the GET merchant registration status API. It includes merchant details, registration status, login token, user profiles, active package subscription, and portal information. ```json { "id": "mr_3qjZwq", "name": "Mohd Ali Bin Seman", "email": "namasyarikat@gmail.com", "referral_id": null, "registration_status": "Incomplete", "login_token": "$778374mifnminvrunvrvmrmri997uIO", "user_profiles": { "organisation_name": "Nama Syarikat Sdn. Bhd.", "organisation_registration_number": "123456789-H", "contact_first_name": null, "contact_last_name": null, "contact_mobile_number": "60169165576", "contact_email": "namasyarikat@gmail.com", "organisation_bank_id": 1, "organisation_bank_name": "Affin Bank Berhad", "organisation_bank_account_number": "221233898832", "organisation_bank_account_holder": "Nama Syarikat Sdn. Bhd." }, "active_package_subscription": { "reference_number": "112234434TE", "package": { "name": "DuitNow T+ Package", "code": "T+" }, "start_date": "2024-11-13", "expiry_date": "2025-11-13", "minimum_balance": "RM50.00", "payouts_schedule": "Payout next working day T+1 starting 01.00 AM" }, "portal": { "name": "Default", "api_key": "3888499948593892894", "merchant_transaction_notification_email": "financesyarikat@gmail.com", "url": "https://bcl.my", "payment_gateways": [ { "name": "FPX", "code": "FPX" } ] } } ``` -------------------------------- ### Sending GET Request to Bank List API with cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/bank-list/fpx.md Provides an example of how to make a GET request to the BayarCash bank list API endpoint using the cURL command-line tool. It demonstrates specifying the HTTP method, the endpoint URL, and including required headers for Content-Type and Authorization with a Bearer token. ```curl curl -X GET https://api.console.bayar.cash/v3/banks \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Example Bayar Cash Transaction Response - JSON Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/transaction/all-transactions.md Provides a sample JSON object showing the structure and typical data returned by the Bayar Cash API's `/v3/transactions` endpoint upon a successful GET request. It includes transaction details, pagination links, and metadata. ```json { "data": [ "id": "trx_q6LJdl", "updated_at": "2023-05-26 13:35:01", "datetime": "2023-05-26 13:29:06", "order_number": "24354620275", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60111157245", "currency": "MYR", "amount": 50, "exchange_reference_number": "1-685-0718-946-53336", "exchange_transaction_id": "23052613290110936", "payer_bank_name": "Bank Islam", "status": 3, "status_description": "Approved", "return_url": "https://website.net/api/return_url", "metadata": null, "payout": { "reference_number": "P1685011113148329" }, "payment_gateway": { "name": "FPX", "code": "FPX" }, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } ], "links": { "first": "https://api.console.bayar.cash/v3/transactions?page=1", "last": "https://api.console.bayar.cash/v3/transactions?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "https://api.console.bayar.cash/v3/transactions?page=1", "label": "1", "active": true }, { "url": null, "label": "Next »", "active": false } ], "path": "https://api.console.bayar.cash/v3/transactions", "per_page": 15, "to": 6, "total": 6 } } ``` -------------------------------- ### Example Update e-Mandate JSON Request Body Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/e-mandate-maintenance.md An example JSON payload demonstrating the required structure and fields for updating an existing e-mandate via the PUT API endpoint. Includes payer details, order information, amount, frequency, effective/expiry dates, and a payment intent URL. ```json { "payer_name": "Mohd Ali", "payer_id_type": 1, "payer_id": "910109021234", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60198109001", "order_number": "DD001", "amount": 30, "application_type": "Maintenance", "application_reason": "Maintenance of DD001", "frequency_mode": "YR", "effective_date": "2024-06-15", "expiry_date": "2024-08-15", "url": "https://console.bayar.cash/payment-intent/pi_pGwZaY" } ``` -------------------------------- ### Example Bayarcash Payment Intent Response JSON Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/payment/payment-intent.md This snippet provides an example of the JSON response received after successfully creating a payment intent via the Bayarcash API. It includes key fields such as the payment intent type and ID (for v3), payer details, order information, amount, and the URL to direct the user for payment. ```json { "type": "payment_intent", // only available on v3 "id": "pi_MGWpzp", // only available on v3 "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60193000123", "order_number": "1351", "amount": "21.10", "url": "https://console.bayar.cash/payment-intent/pi_MGWpzp" } ``` -------------------------------- ### Example Response for e-Mandate Enrollment Initialization (JSON) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/e-mandate-enrollment.md Provides a sample JSON structure returned by the Bayarcash API upon successful initialization of an e-mandate enrollment request. It illustrates the format and types of data included in the response, such as payer details, order information, dates, and the payment intent URL. ```json { "payer_name": "Mohd Ali", "payer_id_type": 1, "payer_id": "910109021234", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60196019001", "order_number": "DD001", "amount": 30, "application_type": "Enrollment", "application_reason": "Enrollment of DD001", "frequency_mode": "MT", "effective_date": "2024-06-15", "expiry_date": "2024-08-15", "url": "https://console.bayar.cash/payment-intent/pi_pGwZaY" } ``` -------------------------------- ### Example JSON Response for Payout ID Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/enterprise-partner/merchant-payout-id.md This snippet shows the structure and example data of the JSON object returned when successfully retrieving details for a specific merchant payout ID. It includes fields such as the payout ID, creation timestamp, merchant details, status, reference numbers, and amount. ```JSON { "id": "pay_qK7gOq", "created_at": "2025-01-14 10:57:33", "merchant": { "id": "usr_Zz29gG", "name": "ABC Sdn. Bhd.", "email": "admin@abc.com" }, "status": "Processing", "reference_number": "P1736823453599915", "split_payout": "-", "bank_transaction_reference_number": null, "amount": "1.50" } ``` -------------------------------- ### Successful Merchant Registration JSON Response Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/enterprise-partner/merchant-registration.md Provides an example of the JSON structure returned by the Bayarcash API upon a successful merchant registration. It includes details about the new merchant, user profiles, package subscriptions, and portal information. ```json { "success": true, "message": "Merchant registration success.", "data": { "id": "mr_3qjZwq", "name": "Mohd Ali Bin Seman", "email": "namasyarikat@gmail.com", "referral_id": null, "registration_status": "Incomplete", "login_token": "$778374mifnminvrunvrvmrmri997uIO", "user_profiles": { "organisation_name": "Nama Syarikat Sdn. Bhd.", "organisation_registration_number": "123456789-H", "contact_first_name": null, "contact_last_name": null, "contact_mobile_number": "60169165576", "contact_email": "namasyarikat@gmail.com", "organisation_bank_id": 1, "organisation_bank_name": "Affin Bank Berhad", "organisation_bank_account_number": "221233898832", "organisation_bank_account_holder": "Nama Syarikat Sdn. Bhd." }, "active_package_subscription": { "reference_number": "112234434TE", "package": { "name": "DuitNow T+ Package", "code": "T+" }, "start_date": "2024-11-13", "expiry_date": "2025-11-13", "minimum_balance": "RM50.00", "payouts_schedule": "Payout next working day T+1 starting 01.00 AM" }, "portal": { "name": "Default", "api_key": "3888499948593892894", "merchant_transaction_notification_email": "financesyarikat@gmail.com", "url": "https://bcl.my", "payment_gateways": [ { "name": "FPX", "code": "FPX" } ] } } } ``` -------------------------------- ### Example JSON Response: Bayarcash Mandate Details JSON Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/mandate-id.md This JSON object provides an example structure of the response payload returned by the Bayarcash API when retrieving mandate details using the GET /mandates/{mandate_id} endpoint. It includes key fields like mandate ID, reference number, status, amount, payer information, and merchant details. ```json { "id": "md_MGWpzp", "updated_at": "2024-07-21T15:07:09.000000Z", "mandate_reference_number": "E-20230408F00230289", "order_number": "1-680-631-498-908819", "application_reason": "Enrollment for 1-680-631-498-908819", "frequency_mode": "MT", "frequency_mode_label": "Monthly", "effective_date": "2023-04-05", "expiry_date": null, "currency": "MYR", "amount": 10, "payer_name": "Mohd Ali", "payer_id": "910810065921", "payer_id_type": "1", "payer_bank_account_number": "1602219363111", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60199971822", "status": 3, "status_description": "Active", "return_url": "http://website.net/transaction/mandates/callback", "metadata": null, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } } ``` -------------------------------- ### Example JSON Response for FPX Bank List API Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/bank-list/fpx.md Illustrates the structure and data format of a successful response returned by the BayarCash bank list API. It shows an array of bank objects, each containing details like the bank's display name, full name, code, hashed code, and current availability status. ```json [ { "bank_display_name": "Affin Bank", "bank_name": "Affin Bank Berhad", "bank_code": "ABB0233", "bank_code_hashed": "472e729c398dbc372d96f5d852393b76", "bank_availability": true }, { "bank_display_name": "AGRONet", "bank_name": "Bank Pertanian Malaysia Berhad (AgroBank)", "bank_code": "AGRO01", "bank_code_hashed": "6f692c003561e3c52f0d993805b6be01", "bank_availability": true } ] ``` -------------------------------- ### Example JSON Payload for Mandate Termination Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/e-mandate-termination.md This JSON snippet provides an example structure that may be used as a request body or response payload when interacting with the e-Mandate termination API. It includes details such as payer information, amount, order number, and the specific application type set to 'Termination' along with a reason. ```json { "payer_name": "Mohd Ali", "payer_id_type": 1, "payer_id": "910109021234", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60198109001", "order_number": "DD001", "amount": 30, "application_type": "Termination", "application_reason": "Termination of DD001", "frequency_mode": "YR", "effective_date": "2024-06-15", "expiry_date": "2024-08-15", "url": "https://console.bayar.cash/payment-intent/pi_pGwZaY" } ``` -------------------------------- ### Retrieving Portal List using cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/portal/list.md This snippet demonstrates how to make a GET request to the Bayarcash API v3 /portals endpoint using cURL. It shows how to include the necessary 'Content-Type' and 'Authorization' headers with a bearer token. ```curl curl -X GET https://api.console.bayar.cash/v3/portals \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Example API Response for Mandate Transaction Details Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/mandate-transaction-id.md This JSON snippet provides a detailed example of the data structure returned by the API when querying a specific mandate transaction using its ID. It includes comprehensive transaction details, payer information, amounts, status, associated mandate details, merchant information, and gateway specifics. ```json { "id": "trx_GPk868", "updated_at": "2024-06-27 17:57:01", "datetime": "2024-06-27 17:56:42", "order_number": "DDD-24060323", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60197019001", "currency": "MYR", "amount": 10, "exchange_reference_number": "1-719-482-202-565809", "exchange_transaction_id": "2406271756420574", "payer_bank_name": "SBI Bank A", "status": 3, "status_description": "Approved", "return_url": "https://website.net/transactions/mandates/callback", "metadata": null, "payout": { "ref_no": null }, "payment_gateway": { "name": "Direct Debit", "code": "FpxDirectDebit" }, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" }, "mandate": { "id": "md_nq5oAG", "updated_at": "2024-06-27T09:57:27.000000Z", "mandate_reference_number": "E-20241719482236", "order_number": "DDD-24060323", "application_reason": "Enrollment of DDD-24060323", "frequency_mode": "MT", "frequency_mode_label": "Monthly", "effective_date": "2024-06-30", "expiry_date": "2025-06-30", "currency": "MYR", "amount": 200, "payer_name": "Mohd Ali", "payer_id": "910909122211", "payer_id_type": "1", "payer_bank_account_number": "033112228108", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60197019001", "status": 4, "status_description": "Terminated", "return_url": "https://website.net/transactions/mandates/callback", "metadata": null, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } } } ``` -------------------------------- ### Example API Response: Merchant Settlement Summary JSON Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/enterprise-partner/all-merchant-payouts.md This JSON object illustrates the structure of the response body returned by the /v3/payouts (and similar v2) API endpoint. It contains a 'data' array with payout details like ID, creation date, status, amount, and pagination information in the 'links' and 'meta' objects. ```json { "data": [ { "id": "pay_YZ6jNY", "created_at": "2024-11-01 14:20:06", "status": "Processing", "package_subscription_id": 399, "payment_channel": "FPX", "reference_number": "P11229399384849", "split_payout": "Parent", "bank_transaction": null, "amount": "97.00" } ], "links": { "first": "https://api.console.bayar.cash/v3/payouts?page=1", "last": "https://api.console.bayar.cash/v3/payouts?page=2", "prev": null, "next": "https://api.console.bayar.cash/v3/payouts?page=2" }, "meta": { "current_page": 1, "from": 1, "last_page": 2, "links": [ { "url": null, "label": "\u0026laquo; Previous", "active": false }, { "url": "https://api.console.bayar.cash/v3/payouts?page=1", "label": "1", "active": true }, { "url": "https://api.console.bayar.cash/v3/payouts?page=2", "label": "2", "active": false }, { "url": "https://api.console.bayar.cash/v3/payouts?page=2", "label": "Next \u0026raquo;", "active": false } ], "path": "https://api.console.bayar.cash/v3/payouts", "per_page": 15, "to": 15, "total": 27 } } ``` -------------------------------- ### Example JSON Response for Transaction Query Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/transaction/transaction-id.md Provides a sample JSON structure returned by the BayarCash API when querying a transaction's status. Shows key fields like ID, status, amount, and related information about the payer, payment gateway, and merchant. ```json { "id": "trx_q6LJdl", "updated_at": "2023-05-26 13:35:01", "datetime": "2023-05-26 13:29:06", "order_number": "24354620275", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60111157245", "currency": "MYR", "amount": 50, "exchange_reference_number": "1-685-0718-946-53336", "exchange_transaction_id": "23052613290110936", "payer_bank_name": "Bank Islam", "status": 3, "status_description": "Approved", "return_url": "https://website.net/api/return_url", "metadata": null, "payout": { "reference_number": "P1685011113148329" }, "payment_gateway": { "name": "FPX", "code": "FPX" }, "portal": "Portal ABC", "merchant": { "name": "Web Impian Sdn. Bhd.", "email": "webimpian.merchant@gmail.com" } } ``` -------------------------------- ### Querying Bayar Cash Transactions - cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/transaction/all-transactions.md Demonstrates how to use cURL to send a GET request to the `/v3/transactions` endpoint to retrieve transaction details. It includes required headers for content type and authorization using a bearer token, showing how to query by `order_number`. Requires a valid personal access token. ```curl curl -X GET https://api.console.bayar.cash/v3/transactions?order_number=24354620275 \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### BayarCash DuitNow DOBW Banks API Response (JSON) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/bank-list/duitnow-online-banking-wallets.md This snippet shows an example of the JSON array structure returned by the BayarCash API endpoint for listing available DuitNow DOBW banks. Each object in the array represents a bank and contains the 'bank_name' (string), 'bank_code' (string), and 'bank_availability' (boolean) fields. ```json [ { "bank_name": "Affin Bank", "bank_code": "PHBMMYKL", "bank_availability": true }, { "bank_name": "Agro Bank", "bank_code": "AGRO01", "bank_availability": true } ] ``` -------------------------------- ### Calling BayarCash DuitNow DOBW Banks API (cURL) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/bank-list/duitnow-online-banking-wallets.md This snippet demonstrates how to make a GET request to the BayarCash API endpoint to retrieve the list of banks available for DuitNow DOBW using cURL. It requires including the 'Content-Type: application/json' and 'Authorization: Bearer ' headers. The expected output is a JSON array of bank objects. ```markup curl -X GET https://api.console.bayar.cash/v3/duitnow/dobw/banks \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Querying Transaction Status with cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/transaction/transaction-id.md Demonstrates how to retrieve the status of a specific BayarCash transaction using a cURL GET request. Includes necessary headers for content type and authorization with a Bearer token. Requires a valid API token and transaction ID. ```curl curl -X GET https://api.console.bayar.cash/v3/transactions/trx_z88ymJ \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Example JSON Response for Payment Intent Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/payment/payment-intent-id.md This JSON snippet illustrates the data structure returned by the Bayarcash API when successfully retrieving a payment intent. It includes details like the payment intent ID, status, timestamps, amount, currency, payer information, and a list of payment attempts with their statuses. ```json { "type": "payment_intent", "id": "pi_PGPP2G", "status": "paid", "last_attempt": "2024-12-30 12:07:57", "paid_at": "2024-12-30 12:07:57", "order_number": "ORD001", "amount": "10.50", "currency": "MYR", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "attempts": [ { "transaction_id": "trx_YdoXvn", "created_at": "2024-12-30 12:07:57", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "order_number": "ORD001", "currency": "MYR", "amount": "10.50", "exchange_reference_number": "1-735-272-902-315691", "exchange_transaction_id": "2412271215020084", "payer_bank_name": "SBI Bank A", "status": 3, "status_description": "Approved", "payment_gateway": { "id": 1, "name": "FPX", "code": "FPX" } }, { "transaction_id": "trx_GWlpvW", "created_at": "2024-12-27 12:15:02", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "+60169166656", "order_number": "ORD001", "currency": "MYR", "amount": "10.50", "exchange_reference_number": "1-735-272-902-315691", "exchange_transaction_id": "2412271215020084", "payer_bank_name": "SBI Bank A", "status": 2, "status_description": "Unsuccessful", "payment_gateway": { "id": 1, "name": "FPX", "code": "FPX" } } ] } ``` -------------------------------- ### Fetching Payment Intent Status with cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/payment/payment-intent-id.md This snippet shows how to use the cURL command-line tool to send a GET request to the Bayarcash API endpoint for a specific payment intent ID. It includes necessary headers for content type and authorization using a Bearer token. ```markup curl -X GET https://api.console.bayar.cash/v3/payment-intents/trx_z88ymJ \\n --header 'Content-Type: application/json' \\n --header 'Authorization: Bearer ' ``` -------------------------------- ### Validating v3 Return Checksum using PHP Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/checksum/transaction-callback.md This snippet provides an example for validating checksum data received from the Bayarcash v3 endpoint (`api.console.bayar.cash/v3`), specifically demonstrating the process for data from the `return_url`. It follows the same validation logic as v2 but includes a slightly different set of fields when constructing the payload array for checksum calculation. ```php $callbackData['transaction_id'], 'exchange_reference_number' => $callbackData['exchange_reference_number'], 'exchange_transaction_id' => $callbackData['exchange_transaction_id'], 'order_number' => $callbackData['order_number'], 'currency' => $callbackData['currency'], 'amount' => $callbackData['amount'], 'payer_bank_name' => $callbackData['payer_bank_name'], 'status' => $callbackData['status'], 'status_description' => $callbackData['status_description'], ]; ksort($payloadData); // Sort the payload data by key $payloadString = implode('|', $payloadData); // Concatenate values with '|' $validResponse = hash_hmac('sha256', $payloadString, $secretKey) === $callbackChecksum; // Validate checksum ``` -------------------------------- ### Initializing e-Mandate Enrollment API using cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/e-mandate-enrollment.md Demonstrates how to send a POST request to the Bayarcash API v3 endpoint to initiate an e-mandate enrollment. It includes required headers for content type and authorization, and provides a sample request body containing necessary enrollment parameters. ```curl curl -X POST https://api.console.bayar.cash/v3/mandates \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{ "portal_key": string, "order_number": DD001, "amount": 100, "payer_id_type": 1, "payer_id": "123456121234", "payer_name": "Mohd Ali", "payer_email": "mohd.ali@gmail.com", "payer_telephone_number": "60191122000", "frequency_mode": "MT", "application_reason": "Enrollment for DD001", "effective_date": "2024-08-01", "expiry_date": "2025-07-01", "metadata": string, "return_url": "https://website.net/callback", "success_url": "https://website.net/success", "failed_url": "https://website.net/failed", "checksum": string }' ``` -------------------------------- ### Sample JSON Response for Portal List Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/portal/list.md This snippet shows the expected structure of the JSON response when successfully retrieving the list of portals. It includes the 'data' array containing portal details (id, name, key, etc.), pagination 'links', and 'meta' data about the response. ```json { "data": [ { "id": 931, "created_at": "2024-10-19 12:47:07", "portal_key": "8baf5e234dd88c2d1375d5f386d78d8f", "portal_name": "Payment Link", "url": "https://bcl.my/", "transaction_notification_email": "hai@bayarcash.com", "custom_payment_button_text": null, "payment_channels": [ { "id": 1, "code": "FPX", "name": "FPX" }, { "id": 3, "code": "FpxDirectDebit", "name": "Direct Debit" }, { "id": 4, "code": "FpxLineOfCredit", "name": "FPX Line of Credit" } ] } ], "links": { "first": "https://api.console.bayar.cash/v3/portals?page=1", "last": "https://api.console.bayar.cash/v3/portals?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "links": [ { "url": null, "label": "pagination.previous", "active": false }, { "url": "https://api.console.bayar.cash/v3/portals?page=1", "label": "1", "active": true }, { "url": null, "label": "pagination.next", "active": false } ], "path": "https://api.console.bayar.cash/v3/portals", "per_page": 15, "to": 2, "total": 2, "merchant": { "name": "Bayarcash Sdn. Bhd.", "email": "hai@bayarcash.com", "created_at": "2024-10-19 12:45:42" } } } ``` -------------------------------- ### Sending Merchant Registration POST Request with cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/enterprise-partner/merchant-registration.md Demonstrates how to make a POST request to the Bayarcash merchant registration endpoint using the cURL command-line tool. It includes necessary headers for authentication and content type, along with a sample JSON payload structure. ```markup curl -X POST https://api.console.bayar.cash/v3/merchant-registrations \ --header 'Content-Type: application/json' \ --header 'X-API-Key: ' \ --header 'Authorization: Bearer ' \ --data-raw '{ "organisation_name": string, "organisation_registration_number": string, "organisation_bank_id": integer, // Please refer Payout Bank List "organisation_bank_account_holder": string, "organisation_bank_account_number": string, "login_name": string, "login_email": string, "login_mobile_number": integer, "password": string, "password_confirmation": string }' ``` -------------------------------- ### Initializing Payment Intent with cURL Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/payment/payment-intent.md This snippet shows how to send a POST request using cURL to the Bayarcash v3 payment intent API. It requires a valid personal access token in the Authorization header and sends payment details in a JSON body, including required parameters like payment channel, portal key, order number, amount, payer name, and email. ```markup curl -X POST https://api.console.bayar.cash/v3/payment-intents \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data-raw '{ "payment_channel": 5, "portal_key": string, "order_number": string, "amount": 100, "payer_name": string, "payer_email": string, "payer_telephone_number": integer, "payer_bank_code": string, "payer_bank_name": string, "metadata": string, "return_url": string, "platform_id": string, "checksum": string }' ``` -------------------------------- ### Authorization Callback JSON Structure (Bayarcash API) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/callback.md Defines the JSON payload structure for authorization-related callbacks received from the Bayarcash API. This structure is used for events like enrollment, maintenance, and termination, providing details such as transaction and mandate IDs, amount, currency, payer information, status, and a checksum for verification. ```json { "record_type": "authorization", "transaction_id": string, "mandate_id": string, "exchange_reference_number": string, "exchange_transaction_id": string, "order_number": 100, "currency": string, "amount": string, "payer_name": string, "payer_email": string, "payer_bank_name": string, "status": string, "status_description": string, "datetime": string, "checksum": string } ``` -------------------------------- ### Bank Approval Callback JSON Structure (Bayarcash API) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/callback.md Specifies the JSON payload structure for bank approval callbacks from the Bayarcash API. This structure is applicable to enrollment, maintenance, and termination processes, containing information about the approval date and status, mandate details, hashed and actual payer bank codes, account numbers, application type, and a checksum. ```json { "record_type": "bank_approval", "approval_date": string, "approval_status": string, "mandate_id": string, "mandate_reference_number": string, "order_number": string, "payer_bank_code_hashed": string, "payer_bank_code": string, "payer_bank_account_no": string, "application_type": 01, "checksum": string } ``` -------------------------------- ### JSON Transaction Receipt Callback Structure Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/transaction/callback.md Provides the structure of the JSON payload received from Bayarcash for a transaction receipt callback. It includes transaction identifiers, order details, currency, amount, payer bank, status, status description, and a checksum. This is a simpler structure compared to the full transaction callback. ```json { "transaction_id": string, "exchange_reference_number": string, "exchange_transaction_id": string, "order_number": string, "currency": string, "amount": string, "payer_bank_name": string, "status": string, "status_description": string, "checksum": string } ``` -------------------------------- ### Transaction Callback JSON Structure (Bayarcash API) Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/direct-debit/callback.md Outlines the JSON payload structure for transaction-related callbacks received from the Bayarcash API. This structure is exclusively used for enrollment transactions, providing details such as batch number, mandate and transaction IDs, datetime, reference number, amount, transaction status, cycle count, and a checksum. ```json { "record_type": "transaction", "batch_number": string, "mandate_id": string, "mandate_reference_number": string, "transaction_id": string, "datetime": string, "reference_number": string, "amount": 100, "status": string, "status_description": string, "cycle": 1, "checksum": string } ``` -------------------------------- ### JSON Transaction Callback Structure Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/transaction/callback.md Provides the structure of the JSON payload received from Bayarcash for a transaction callback. It includes transaction identifiers, order details, currency, amount, payer information, status, datetime, and a checksum for validation. This structure is sent to the configured callback URL. ```json { "record_type": "transaction", "transaction_id": string, "exchange_reference_number": string, "exchange_transaction_id": string, "order_number": string, "currency": string, "amount": string, "payer_name": string, "payer_email": string, "payer_bank_name": string, "status": integer, "status_description": string, "datetime": string, "checksum": string } ``` -------------------------------- ### Validating v2 Callback Checksum using PHP Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/checksum/transaction-callback.md This snippet demonstrates how to validate the checksum for transaction callback data received from the Bayarcash v2 endpoint (`console.bayar.cash/api/v2`) via the `return_url`. It extracts the received checksum, builds a payload array using specific keys, sorts the array, concatenates the values, calculates the HMAC-SHA256 hash using the secret key, and compares it with the received checksum. ```php $callbackData['record_type'], "transaction_id" => $callbackData['transaction_id'], "exchange_reference_number" => $callbackData['exchange_reference_number'], "exchange_transaction_id" => $callbackData['exchange_transaction_id'], "order_number" => $callbackData['order_number'], "currency" => $callbackData['currency'], "amount" => $callbackData['amount'], "payer_name" => $callbackData['payer_name'], "payer_email" => $callbackData['payer_email'], "payer_bank_name" => $callbackData['payer_bank_name'], "status" => $callbackData['status'], "status_description" => $callbackData['status_description'], "datetime" => $callbackData['datetime'], ]; ksort($payloadData); // Sort the payload data by key $payloadString = implode('|', $payloadData); // Concatenate values with '|' $validResponse = hash_hmac('sha256', $payloadString, $secretKey) === $callbackChecksum; // Validate checksum ``` -------------------------------- ### Generating Payment Intent Checksum - PHP Source: https://github.com/webimpian/bayarcash-api-documentation/blob/main/checksum/payment-intent.md This PHP snippet demonstrates how to generate an HMAC SHA256 checksum for payment intent payload data. It requires sorting the payload keys, concatenating the values with a pipe character ('|'), and then hashing the resulting string using your API secret key. The generated checksum is used for data integrity verification. ```php 1, "order_number" => "ORD-0060", "amount" => "60.00", "payer_name" => "Mohd Ali", "payer_email" => "mohd.ali@gmail.com" ]; ksort($payloadData); // Sort the payload data by key $payloadString = implode('|', $payloadData); // Concatenate values with '|' $checksum = hash_hmac('sha256', $stringPayload, $secretKey); // Generate HMAC SHA256 checksum ?> ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.