PAK-DOCS ## Sections • [Getting Started - Pakistan](https://developers.paymob.com/pak/getting-started-pakistan.md): Sign up for registering a new account A guide to registering a new accept account. Why do I have to? In order to deal with any of Accept's services, you have to register an account, this tutorial will be your guide to create one. To create your account, follow these steps Navigate to Accept's home page 2. After that, you will enter your mobile number on which you will be receiving OTP for first-time verification. 3. As soon as you enter the OTP that you have received on your mobile number, you will get the below screen where you will be adding your name, and email details including your desired Password which you will be using for further logging. 4. Please note that after this screen you will get a login screen where you will be entering your registered mobile number without country code and your password which you have set in the previous screen. 5. As soon as you will log in, you will get the below screen to enter your business details. After filling in this information, you will get a " Registration successful " message on the screen and you will be routed to your Paymob Dashboard as below : Great-Now you have successfully made your Merchant portal dashboard Now you can go to the Sign-In page and start accepting online payments from your customers, Go check our use case guide and choose your perfect payment scenario! 👍 Note! The status of the created account will be marked as a "Test" account, this will allow you to test all of Accept's services. When you finish your testing phase, Please contact your Account Manager or Contact Support team through email support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard to change its status to be "Live" . • [Accept Dashboard](https://developers.paymob.com/pak/accept-dashboard.md): A detailed guide to your Accept dashboard In order to deal with any of Accept's services, you have to create an Accept account . In your Accept portal, you can find: Profile. Transactions. Orders. Payment Integrations. • [Profile](https://developers.paymob.com/pak/accept-dashboard/profile.md): A guide to the plug-in tab in your Accept dashboard. Please scroll down to "Settings" to update your profile settings on the Dashboard. Summary From your profile tab, you can: Get your HMAC secret. Get your API Key. Change your account password. Add extra emails to your account. Enable notifications for your account. Request going live. Business Branding You can add your logo by clicking on "Update" and adjusting business settings from this tab. Account Info You can get your account status, HMAC, and API secret key from this tab. HMAC Secret Please skip this part if you are integrating with Accept through one of the standalone checkout tools. It is the hash secret with which all the requests between your server and Accept's server are authenticated, it is used for calculating the hmac authentication query param that comes with the transaction callbacks. Please don't share the HMAC secret with anyone outside of your trusted development team resources. API Key Please skip this part if you are integrating with Accept through one of the standalone checkout tools. Accept authenticates your API requests using your account’s API keys, so use this API key to obtain your authentication token, check the Auth API to learn more about the API key usage. To obtain your API key, click on the eye sign under the API key tab, you can change your API key whenever you need by clicking on the refresh button. Change your account password Click on the Password button. 2. Enter your old password, then enter your new password, then select Submit . Email Notification Accept notifies you whenever there's a transaction performed on one of your orders. You receive this notification on the primary email, which you've registered your account with. You can enable the payment notification from the notification button in your profile tab. From there you can enable it or disable it, then click submit. 5. You can add extra emails to get a payment notification from the Update button. 6. Then add the desired email. • [Payment Integrations](https://developers.paymob.com/pak/accept-dashboard/payment-integrations.md): A guide for your Integration IDs. By reading this guide you will understand the functionalities of the payment integrations tab found in your dashboard and you will be able to create/control your own payment integration IDs Summary A payment integration ID is a unique identifier per merchant for his payment methods since Accept offers a wide variety of payment methods, "Cards, Easypaisa, Jazzcash, Mobile Wallets, etc..." each of which has a unique reference ID that is mapped to your Accept account. It has two statuses, Test and Live. When you create a new payment integration ID, by default, its status is set to "Test," which means it can only be used for processing test transactions with the test credentials for the sandbox and testing environments. A newly created Accept account by default has a new test card integration ID assigned to it; you can add more integration IDs to your account according to your integration needs. You can control payment integrations from your portal - Payment Integrations tab. Payment Integrations Tab Log in to your Accept [ portal ]. " Sign up for a new account if you don't already have one" "Learn how to create a new Accept account" In your dashboard, click on the “Payment Integrations” tab in your navigation board, as viewed in the image below. 3. Now you should find all the existing payment method integration IDs related to your Accept account listed as viewed below. Column Name Description ID An integer number referencing this integration, each payment method you're integrating with has a unique integer identifier. Type The type of this integration ID is "Card, Easypaisa, Jazzcash, Wallets, Cash, etc...". Currency The currency of this integration ID is "PKR, USD, etc...". Status The status of this integration ID Test or Live. Shopify Defines whether this integration ID could be used for the Shopify E-Commerce platform or not. Created At The date and time of creating this integration ID. Adding New Integration ID In your Payment Integrations tab, click on Add in the Paymob's Dashboard - Payment Integrations tab. upper right corner as viewed in the image below. 2. A pop-up screen as the image below should appear to you. 3. Click on the type field and choose " Card Online ". 4. Set the currency to the willing one you need. If you're using one of Accept's standalone checkout tools leave the callback URLs as it is, click on the submit button and that's it you're ready to use your integration ID. If you're integrating with Accept directly through your APIs, please check the transaction callbacks guide . Now your integration ID is ready to be used as a test ID. Note that any integration ID you create from your dashboard its a status set to be Test; if you want to turn it to be LIVE, Please contact your Account Manager or Contact Support team through email support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard. Modification of Integration Name, Processed Callback Url, and Response Callback Url: If you would like to edit the integration name, transaction processed callback, or response callback, please click the "Edit" button. Integration Name: The integration name can be customized to suit your preferences, serving as a unique identifier for your records. This name can also be included in the payment_methods parameter within the integration method, serving as the integration ID Please note that if the name is used in place of the integration ID in the payment_methods, it must exactly match the name specified in the Integration Name. Transaction Processed Callback: Configure this with the URL where you wish to receive server-to-server notifications regarding the transaction status. This callback is triggered after any payment process is completed by the customer. It sends a notification to a specified endpoint in your web application, providing detailed information about the transaction. Transaction Response Callback: Configure this with the URL where you would like to redirect the customer after they complete the payment. This callback provides immediate feedback on the transaction request, indicating whether the transaction was successful or not. • [Orders](https://developers.paymob.com/pak/accept-dashboard/orders.md): A guide to the Orders tab in the Accept dashboard. Summary An Order instance is a reference to some product/service you want to sell through one of the available Accept payment channels. One Order could have many transactions since one order could be paid through more than one payment channel, though you might find more than one transaction related to the same order instance. The Orders tab in your dashboard is where you can find all your orders you've created including the ones you've created with the standalone checkout tools. You can filter, and monitor your orders, check the following guide to learn more about your Orders tab. Learn how to register a new Accept account. Orders Tab In your dashboard, click on the Orders tab found in your navigation board as shown in the image below. 2. You should have a view similar to the one shown in the image below. If you click on any of your orders in the order summary section, you should have a view similar to the one in the image below. The Order detail tab will give you extra details about your order, and the link of your order if it was created through one of Accept's standalone checkout tools. Also, you can delete this order if you want from the delete button found in the right upper corner of the order detail. Order Detail Deep Filter You can filter the viewed order by using the filter button found in the right upper corner of the order summary. The following table will describe each of the filter parameters Field Name Description Merchant Order ID Search for an order by the Merchant Order ID. Currency Filter by the currency your order was created with. Status Filter by the order status, pain/unpaid. Date Range Filter the orders by a specific date range they were created at. Amount From/To Filter the orders with a price starting from some integer value you set in this field up to another value you set in the Amount To field. Order URL This field is for the invoices/products created through the standalone checkout tools, you can filter the orders by the Invoice/Product link. Paid Amount From/To Filter the orders with a paid price starting from some integer value you set in this field up to another value you set in the Paid Amount To field. Is Live Filter the orders if it was created with live credentials. Delivery Needed Filter the orders if they need to be delivered or not. • [Transactions](https://developers.paymob.com/pak/accept-dashboard/transactions.md): An instruction manual on how to use the Transactions tab within your Accept dashboard. 📘 Summary The Transaction instance is simply a reference to any payment operation that is performed to any of your orders. Each transaction in your transactions tab is a reference to only one order; the transactions are unique per order. On the other hand, one order can have many transactions but not vice versa. The Transactions tab is where you can find all the payment transactions performed for your orders from all the available payment channels. You can export, filter, and monitor your transactions. Check the following guide to learn more about your Transactions tab. The transaction tab is where you can find all the payment transactions performed for your orders from all the available payment channels. You can export, filter, and monitor your transactions. Learn how to register a new Accept account. Transactions Tab In your dashboard, click on the Transactions tab found in your navigation board as shown in the image below. 2. You should have a view similar to the one shown in the image below. Let's explain the usage and references of each section of this tab. Live Processed This section gives you a quick review of the numbers of your live processed transactions. Accept Dashboard - Transactions Tab. By default, it shows the total number of your performed transactions and the precise amount passed through each payment channel depending on the selected currency or a specific date range. Note! This section only shows the transactions performed with live integration ID credentials. Transactions Summary This section will allow you to view your transactions in more detail. The Transaction Summary table gives you the following details: Column Name Description Transaction ID The reference ID of your transaction is in our database. Date Created The date and time at which this transaction was created. Amount The amount paid for this transaction. Type The type of gateway that the transaction was performed through. Source The root source of the transaction, for example, the last four numbers of the credit card performed this transaction. Origin Invoice/Products/iFrame/MobileSDk, etc... Status The status of this transaction ("Pending", "Successful", or "Declined") Order ID The reference ID of your order is in our database. If you click on any of your transactions in the transaction summary section, you should have a view similar to the one in the image below. The Transaction detail tab will provide you with extra details about your transactions, related orders, the related payment channel, the billing data related to the customer Also, you can delete this order if you want from the delete button found in the right upper corner of the order detail. Transaction Detail Deep Filter You can filter the viewed transactions by using the filter button found in the right upper corner of the order summary. The following table will describe each of the filter parameters Field Name Description Transaction ID Searches for a transaction by its ID. Order ID Searches for the transactions related to a specific order by the order's ID. Merchant Order ID Searches for transactions related to some merchant order ID. Currency Filters the transactions by currency. Integration ID Filters the transactions by the integration ID used to perform it. Status Filters the transactions by their status ("Success, Declined, Pending"). Date Range Filters the transactions by the date range of their creation. Amount From/To Filters the transactions with a price starting from some integer value you set in this field up to another value you set in the Amount To field. Type Filters the transactions by the type of payment channel through which the transactions were performed. Transaction Type Filters the transactions by their type ("Void, Refund, 3D-Secure, Standalone, etc...") Origin Filters the transactions by their performing origin ("iFrame, SDK, Product, Invoice, etc...") Terminal ID Searches for the transactions by the ID of the POS through which the transaction was performed. Is Live Filters the transactions by their integration status (Test, Live). • [API Reference Guide](https://developers.paymob.com/pak/api-reference-guide.md): Paymob's APIs are built on the REST architecture, providing a structured approach for developers to interact with their services. Let's delve into the basics of REST APIs, HTTP methods, parameters, and HTTPS status codes within the Paymob ecosystem: • [Basics of API](https://developers.paymob.com/pak/api-reference-guide/basics-of-api.md): Introduction to RESTful APIs and HTTP Methods in Paymob Paymob's APIs are built on the REST architecture, providing a structured approach for developers to interact with their services. Let's delve into the basics of REST APIs, HTTP methods, parameters, and HTTPS status codes within the Paymob ecosystem: RESTful Functionality: A RESTful web application exposes its resources along with information about them. It empowers clients to perform actions on these resources, such as creating new ones (e.g., a user profile) or modifying existing ones (e.g., updating a transaction). For instance, developers can utilize the Paymob Payments API to retrieve specific payment details. Upon making a request, the API responds with essential payment information like amount, currency, and payment method, typically formatted in JSON. HTTP Methods: HTTP methods, or verbs, denote actions performed on resources. Paymob's APIs support various HTTP methods: GET: Retrieve a representation of a specific resource. Example: Fetching all received payments. POST: Submit data to create a new resource or trigger a state change. Example: Generating a payment link. PUT: Replace all representations of a target resource with the provided payload. Example: Modifying customer details. DELETE: Remove a specified resource. Example: Deleting an invoice. PATCH: Apply partial modifications to a resource. Example: Updating an order with specific changes. Parameters: Parameters allow customization of API requests and responses. Paymob's APIs support four types of parameters: Path Parameters: Integral parts of the endpoint URL, identifying specific resources. Query Parameters: Appended to the endpoint URL to filter or paginate results. Request Parameters : Included in the request body, transmitting data to the API server. Response Parameters: Represent data returned by the server in response to a request. HTTPS Status Codes: HTTP status codes communicate the outcome of client requests. Paymob employs HTTPS status codes categorized into three classes: Success (200): Successful response Client Error (400): Error on the transactions. Server Error (500): Internal server error. • [API Setup - Getting Started](https://developers.paymob.com/pak/api-reference-guide/api-setup-getting-started.md): By comprehending these components, developers can effectively integrate Paymob's APIs into their applications, facilitating seamless payment processing experiences for users while ensuring security and reliability. This documentation will guide you through the process of integrating with Paymob's powerful APIs and testing them using Postman. Whether you're looking to facilitate online payments, manage transactions, or streamline your e-commerce platform, Paymob APIs offer robust solutions to meet your needs. Step 1: Sign Up for Paymob Before diving into the APIs, you'll need to sign up for a Paymob account if you haven't already. Visit this link to create your account. Once registered, you can access your dashboard to manage your integration settings. Step 2: Generating API Key, Secret key, and Public key. To authenticate and secure your interactions with Paymob's APIs, you'll need to generate an API key, secret key, and public key. Follow the steps below to generate these keys securely: Generating Test Mode API Key, Secret key, and Public key Log in to your Paymob account dashboard. Navigate to the setting section, then into account info. Click on "View API Key, Secretkey, or public key." However, you need to set your account to 'Test' mode as you'll find this option on the top of your portal page, to update your keys to Test keys. Your test API key, Secret key, or public key will be displayed. Copy it securely for later use. Test keys format: are_pk_test_XXXXXXXXXXXXXX Generating Live Mode API Key, Secret key, and Public key Log in to your Paymob account dashboard. Navigate to the Setting Section, then into account info. Click on "View API Key Secret key or public key."However, you need to set your account to 'Live' mode as you'll find this option on the top of your portal page, to update your keys to live keys Your live API key, Secret key, or public key will be displayed. Ensure you store it securely. Live keys format: are_pk_live_XXXXXXXXXXXXXXXXXT Step 3: Testing APIs on Postman Postman provides a user-friendly interface for testing APIs. Follow these steps to test Paymob's APIs using Postman: Download and install Postman . Launch Postman and create a new request. Enter the API endpoint URL you wish to test. Set the appropriate HTTP method (GET, POST, PUT, DELETE). Add any required headers, such as authentication headers with your API key. Input any necessary request parameters or payloads. Click "Send" to execute the request and view the response. Create Intention/ Payment API You can create your payment requests via following simple one-step intension API. Once you are done with the Intention you need to call this URL. It will open in the browser's window. https://pakistan.paymob.com/unifiedcheckout/?publicKey = <add your public key here>&clientSecret=<add your client secret key here> You will get your Public key from your Dashboard as mentioned in the Generating Public key section and you will get your client secret key in the response of Intention API as you see in the below screenshot. After following this link and opening the consolidating link, you will route to the checkout page as shown below through which you can process your payment. • [Checkout-API](https://developers.paymob.com/pak/checkout-api.md): Unified Checkout It is a user-friendly hosted checkout where customers can select any payment method defined by the merchant. This page represents the list of payment methods owned by the Merchant. Customers can choose any payment method they want to complete the purchase. For Instance, If the customer selects the CARD Payment Method and Clicks on proceed to the payment he will be redirected to the below page. The above fields can also be used as separate elements to achieve customization where the Merchant can place them as individual fields according to his preference instead of redirecting the customer to a separate link. • [Integration Guide & API Reference](https://developers.paymob.com/pak/checkout-api/integration-guide-and-api-reference.md): Follow the below instructions to accomplish an intention Note Download the Postman collection from this link • [Create Intention/Payment API](https://developers.paymob.com/pak/checkout-api/integration-guide-and-api-reference/create-intention-payment-api.md): You can create your payment requests via following simple one-step intension API. Once you are done with the Intention you need to call this URL. It will open in the browser's window. https://pakistan.paymob.com/unifiedcheckout/?publicKey = <add your public key here>&clientSecret=<add your client secret key here> You will get your Public key from your Dashboard and you will get your client secret key in the response of Intention API. Please be aware that you can customize the intention API setup by including the necessary URLs to override the callback of the notification and redirection URL in your request. This allows you to distinguish between the URLs used for both actions and their callbacks. Use the provided parameters, "notification_url" and "redirection_url," as outlined in the screenshot sample. "notification_url":" [ Parameter in Intention Request ] refers to Transaction processed callback ", Please be aware that setting the notification url will only send callback information for the transaction. However, if the user clicks the “save card” button, the card_token detail will not be sent to the notification url (that has been sent in the intention Api ) but rather to the updated processed callback that is configured under dashboard integration IDs by referring to Transaction Processed Callback URL set on the integration ID. "redirection_url":" [ Parameter in Intention Request ] refers to Transaction response callback ", It's important to maintain separate integration IDs for each environment, whether testing or live. This is because the implemented keys (secret/public keys) differ between environments. • [Test Card Credentials](https://developers.paymob.com/pak/checkout-api/test-card-credentials.md): Here are the test credentials for the online card payment method: Title Description Card Mastercard Card number 5123456789012346 Cardholder Name Test Account Expiry Month 12 Expiry Year 25 CVV 123 • [Payment Link (API)](https://developers.paymob.com/pak/payment-links/payment-link-api.md): Please get the Payment Link API Postman collection link here . Make sure to create a token by setting up your username and password. To register, follow the steps on this link . After importing the collection in Postman, start by going to 'Login' • [Login](https://developers.paymob.com/pak/payment-links/payment-link-api/login.md): 1.1- Please enter your registered username and password, and set an expiry date (this is just an example). URL: https://pakistan.paymob.com/api/auth/tokens 1.2-After that, you'll be able to generate a token in the response. • [Create Payment Link](https://developers.paymob.com/pak/payment-links/payment-link-api/create-payment-link.md): 1.3- Please use the generated token on login and set it on the Authorization. URL: https://pakistan.paymob.com/api/ecommerce/payment-links 1.4- Go to 'Body' and update the required details to get the payment link. For the payment method, use your configured integration ID. In the second API body data, fill in the necessary fields (Payment methods: your integration ID, amount in cents, Name, email, and Phone number) and send the request. 1.5- After sending the request, you'll receive the Payment Link in the response, which will take you to the Checkout Page • [Payment Actions](https://developers.paymob.com/pak/payment-actions.md): You can download a Postman collection from the below-mentioned tab. • [Refund Transaction](https://developers.paymob.com/pak/payment-actions/refund-transaction.md): A refund transaction is a re-transaction, which means that it is a normal transaction but in the opposite direction, regularly the transactions are a "Customer ==> Merchant" transaction, and then the Refund transaction is a "Merchant ==> Customer" transaction. A refund transaction could happen any time after the original transaction's time, with any amount varying from 1 OMR up to the original transaction amount. Transaction fees will be applied to the refund transaction. You can perform a refund transaction to the original transaction from your dashboard or by using the API mentioned in this guide. Make sure that you have enough balance before performing any reverse transaction "Void/Refund". Note! You will receive callbacks for the parent transaction of this transaction with the flag "is_refunded": true. You can find the id of the parent transaction in the "parent_transaction" key in the callbacks of the refund transaction. Download Postman collection • [Void Transaction](https://developers.paymob.com/pak/payment-actions/void-transaction.md): A void transaction is a reverse transaction, which could be performed to cancel a transaction that occurred within the same business day without any transaction fees. You can void any of your transactions from your Accept dashboard from the void button found in the transaction details. In this guide, we're exposing the void API, which you can use it to cancel a transaction that occurred on the same business day. For example, transactions performed on the 5th of March can be voided with this API or through the dashboard on the same day which is the 5th of March. Note! You will receive callbacks for the parent transaction of this transaction with flag "is_voided": true. You can find the id of the parent transaction in the "parent_transaction" key in the callbacks of the void transaction. • [Auth-Capture Payments](https://developers.paymob.com/pak/payment-actions/auth-capture-payments.md): An Auth/Capture transaction consists of two transactions: 1- An auth transaction allows you to hold "Authorize" a certain amount from your customer's card. 2- A capture transaction that allows you to capture the held amount or less than it. If your business model requires a similar payment scenario, please ask your technical contact for an "auth" integration ID, and follow this guide. 1. The authorization transaction Perform the essential steps mentioned in the payment API flow guide, with the provided "Auth" integration ID. This transaction will be marked as an "is_auth" transaction. 2. The capture transaction By using the following API request you can perform a capture transaction: • [Pay With Saved Token /Moto](https://developers.paymob.com/pak/payment-actions/pay-with-saved-token-moto.md): Please find below the guidelines to perform payments through saved card tokens. • [Pay with Saved Token (Step 1)](https://developers.paymob.com/pak/payment-actions/pay-with-saved-token-moto/pay-with-saved-token-step-1.md): To perform Moto Transactions (Merchant initiated / Subscription ), Follow the below Guidelines: First, you need a Customer's card token which you will be able to get after a successful 3DS transaction through a simple Intention API explained Integration Guide and API Reference. Step 1: To Pass a transaction with the token you will be using simple Intention Pay API explained in Integration Guide and API Reference while passing a Moto Integration ID in "Payment Methods" in request Parameters and you will receive a Payment " Key " in the response under " Payment_Keys ", which you will be utilizing to pass in the next API "Pay with Saved Card Token" Note! You can get the secret_key and public_key from the Merchant Dashboard. secret Key Plain text sk_test_626ba4a60a6f9cf4b0bc066ad3de884e93693afd5218ef832e99cbdf76a0fb37 public_key Plain text pk_test_yl9JpHlmLY17jAL16yWU4y2zlpke14pO Payment Key —> “key” Plain text You will get this in response of the above mentioned API and you will pass this Key in the next API to perform the Pay with Saved card token API. • [Pay With Saved Token (Step 2)](https://developers.paymob.com/pak/payment-actions/pay-with-saved-token-moto/pay-with-saved-token-step-2.md): Now you've received your customer's card token as well as the payment "Key", to perform recurring payments with this token, use below "Pay with saved Token" API Prerequisites : Please ask your technical contact for a recurring payment setup, you should receive an extra Moto integration ID in your dashboard. Step 2 : Kindly pass the Customer's card token in " identifier " and the Payment Key that you have received in Step 1 in "payment_token" as in the below request body. • [Retrieve A Transaction/Inquiry with Order id](https://developers.paymob.com/pak/payment-actions/retrieve-a-transaction-inquiry-with-order-id.md): You can inquire about your transaction either by the id of the transaction itself or by order_id/merchant_order_id related to this transaction. You will get the Auth token through the below Authorization request: URL: https://pakistan.paymob.com/api/auth/tokens Method: POST Source: Merchant's server Recipient: Accept's server Request: { " api_key ": "ZXlKaGJHY2lPaUpJVXpVe... } you will get this API key in your dashboard settings tab, to authenticate your requests"} Response : { " token ": "ZXlKaGJHY2lPaUpJVXpVeE1pSXNJ..} You will get an Authentication token in response of the Authentication request and you will need to use this token as an Authentication token ."} Inquire about the related order details URL: https://pakistan.paymob.com/api/ecommerce/orders/transaction_inquiry • [Inquiry with the transaction "ID"](https://developers.paymob.com/pak/payment-actions/retrieve-a-transaction-inquiry-with-order-id/inquiry-with-the-transaction-id.md): You can send the transaction ID in the mentioned URL to get the details of the subject transaction. A sample response is mentioned. Method: GET Recipient : https://pakistan.paymob.com/api/acceptance/transactions/{transaction_id} Content-type: JSON Authorization-header: Bearer auth_token_from_step1 To get the Bearer Auth token, you would need to run below mentioned Authentication request : URL: https://pakistan.paymob.com/api/auth/tokens Method: POST Source: Merchant's server Recipient: Accept's server Request: { " api_key ": "ZXlKaGJHY2lPaUpJVXpVe... } you will get this API key in your dashboard settings tab, to authenticate your requests"} Response : { " token ": "ZXlKaGJHY2lPaUpJVXpVeE1pSXNJ..} You will get an Authentication token in response of the Authentication request and you will need to use this token as an Authentication token . • [Card (Debit / Credit)](https://developers.paymob.com/pak/payment-methods/card-debit-credit.md): Paymob offers Card (Debit / Credit) as your payment method to process the transactions at Checkout. You can follow the simple Payment API flow as mentioned in Create Intention/Payment API and will pass the card integration id in payment methods to have “Cards” as your payment option at your Checkout Page. • [EasyPaisa](https://developers.paymob.com/pak/payment-methods/easypaisa.md): Paymob offers “EasyPaisa” as your payment method to process transactions at Checkout. You can follow the simple Payment API flow as mentioned in Create Intention/Payment API and will pass the EasyPaisa integration id in payment methods to have “EasyPaisa” as your payment option at your Checkout Page. Please contact your Account Manager or Contact Support team through email support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard. • [Jazzcash](https://developers.paymob.com/pak/payment-methods/jazzcash.md): Paymob offers “JazzCash” as your payment method to process transactions at Checkout. You can follow the simple Payment API flow as mentioned in Create Intention/Payment API and will pass the Jazzcash integration id in payment methods to have “JazzCash” as your payment option at your Checkout Page. Please contact your Account Manager or Contact Support team through email support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard. • [Transaction Callbacks](https://developers.paymob.com/pak/manage-callback/transaction-callbacks.md): What is the transaction callback? When your customer performs a transaction or any action related to some transaction "Void, Refund, Pay, etc..." regardless of the type of the transaction, a webhook request is initiated from our end to defined endpoints in your web app to inform you with the state of the transaction. There are two types of transaction callbacks, transaction processed callback and transaction response callback. To learn how to add your callback endpoints, please check the payment integration guide. You can consider these callbacks as a receipt for your transactions. Transaction Processed Callback It's an URL for an endpoint in your web app, on which you'd receive callbacks as a notification after performing any payment process from your customer side, you would receive a JSON object in POST request which contains a value by which you can know about your payments such as the status of the transaction (success/declined), the order ID related to this transition, the transaction ID and much other information related to your transaction, here's a sample request similar to the one you should receive on your transaction processed callback endpoint. This is a sample transaction processed callback for a successful transaction, you don't have to use all these keys, let's describe some of the important keys in this object, check the following table : Key Description id The ID of this transaction, you can check it from your Accept portal, transaction tab. pending A boolean-valued key indicating the state of this transaction, it would be true in one of these cases: Card Payments: The customer has been redirected to the issuing bank page to enter his OTP. Cash Payments: Your cash payment is ready to be collected and the courier is on his way to collect it from your customer. success A boolean-valued key indicating the status of the transaction whether it was successful or not, it would be true if your customer has successfully performed his payment. is_auth A boolean-valued key indicating if this was an authorized transaction, learn more about auth/cap transactions. is_capture A boolean-valued key indicating if this was a capture transaction, learn more about auth/cap transactions. amount_cents An integer field indicating the amount that was paid to this transaction, it might be different than the original order price, and it is in cents. is_voided A boolean-valued key indicating if this transaction was voided or not, learn more about void and refund transactions. is_refunded A boolean-valued key indicating if this transaction was refunded or not, learn more about void and refund transactions. is_3d_secure A boolean-valued key indicating if this transaction was 3D secured or not, learn more about the 3D and Moto transactions. integration_id An integer field referring to the integration ID that this transaction was performed through, learn more about your payment integrations . order This is a JSON sub-object that contains the order data related to this transaction. order[id] A boolean-valued key of the order sub-object indicating the ID of this order at Accept's database, you can find it in your Accept portal, order tab. order[created_at] A string-valued key of the order sub-object indicating the date and time that this order was created at. order[delivery_needed] A boolean-valued key of the order sub-object indicating if this order needed to be delivered through Accept's Order Delivery Services. Learn more about Accept's Order Delivery Services. order[amount_cents] An integer-valued key of the order sub-object indicates the original price of this order, and it is in cents. order[shipping_data} This is a sub-object from the order sub-object filled with the shipping data that this order might be delivered to if this order needed to be delivered. This data was originally prefilled in your order registration request. order[merchant_order_id] A string-valued key of the order sub-object indicating a reference to this order in your database, the value of this key was provided in your order registration request. order[paid_amount_cents] An integer-valued key of the order sub-object indicates the amount paid to this order and it should be the same as the transaction's amount_cents key's value. currency A string-valued key referencing to the currency of the payment integration that this transaction was performed through. Transaction Response Callback After performing any payment you should redirect your customer again to your platform with a proper message clarifying the state of the payment he just performed. The transaction response callback is a set of query parameters that we append to your endpoint and then redirect your customer to it after performing his payment then you can parse it and upon its values, you'd show your customer a proper message. These query parameters are the same keys found in the transaction processed callback JSON object. Useful Testing Tools In order to receive your transaction callbacks, your app should be deployed on a publicly accessed endpoint, so if you were developing your app on your local machine and you want to test receiving the callbacks you might need to set a secure introspectable tunnel to your localhost webhook development, one of the recommended tools is ngrok , generate URL and add it to be your callback URL. If you didn't receive the callbacks and you want to debug the error, you can use one of these HTTP requests inspection tools " webhook ", " requestbin ", " requestwatch ". These tools will generate endpoint URLs that you can add to your transaction processed/response callbacks to be able if you receiving your callbacks or not after performing any payment. Transaction Processed Callbacks vs Transaction Response Callbacks Transaction Processed Callbacks Transaction Response Callbacks Request Type POST GET Request Content JSON Query Param Direction Server Side Client Side Caution! In order to verify that these requests are received from Accept's endpoint, you have to implement HMAC authentication to validate the source of the callbacks. The following point will learn you more about HMAC authentication. HMAC Authentication Accept callbacks rely on HMAC authentication to verify Accept's identity and the integrity of its data. Every and each callback invoked from Accept's server side has its own HMAC validation, and they are all calculated with the same methodology, once you implemented one of them you can implement the others. Main Method Whenever you receive a callback from Accept's end, You will receive a value of the HMAC related to the data received in the request in a query param called hmac, you should calculate an HMAC value equal to the HMAC sent with the received callback, in order to calculate an HMAC similar to the one you received, prepare your endpoint to perform the following: Sort the data received by key Lexicographical order. Depending on the type of the received callback, concatenate the values of the keys/params in one string, for any transaction callback, the data fields that should be taken in the concentrations are: HMAC String Keys Plain text amount_cents created_at currency error_occured has_parent_transaction id integration_id is_3d_secure is_auth is_capture is_refunded is_standalone_payment is_voided order.id owner pending source_data.pan source_data.sub_type source_data.type success The keys/params should be in the same order shown in the above text. Calculate the hash of the concatenated string using SHA512 and your HMAC secret, found in the profile tab in your dashboard. Convert the resultant HMAC is Hex (base 16) lowercase. Now compare both HMAC values, the one you received with the sent request and the one you calculated out of this request if both are equal, you can safely save this data and use it in your system. Transaction Processed/Response Callback: For the processed callbacks, you should concatenate a string from the mentioned fields in the same order. So, if we considered the up-mentioned sample transaction processed callback sample, the resultant string should be like this: HMAC Concatenated String Plain text 1002020-03-25T18:39:44.719228OMRfalsefalse25567066741truefalsefalsefalsetruefalse47782394705false2346MasterCardcardtrue And if you considered the up-mentioned transaction processed callback sample, the HMAC related to it should be: HMAC Calculated Sample Plain text 6965eb228a2ee5003f9dc01528d68271fdbeae7af0e5bbb1d4915cecff675c2fcb3f08aec78e5859e198ca2b1e53c622a7b5ab7dcb9d15b6ab051a25d1ea1a74 • [Saved Card Token Object](https://developers.paymob.com/pak/manage-callback/transaction-callbacks/saved-card-token-object.md): If your users intended to save their cards you should receive an object like this with the transaction processed callback in which you can find the token related to the user card. Sample Token Object: Try to implement a logic that calculates the HMAC out of the up-mentioned sample callback, and if you got the same results, add this logic to your Transaction processed/response callback endpoints. • [HMAC Calculation](https://developers.paymob.com/pak/manage-callback/hmac-calculation.md): A guide to calculating your HMAC secret HMAC Authentication Accept callbacks rely on HMAC authentication to verify Accept's identity and the integrity of its data. Every and each callback invoked from Accept's server side has its own HMAC validation, and they are all calculated with the same methodology, once you implemented one of them you can implement the others. Main Method Whenever you receive a callback from Accept's end, You will receive a value of the HMAC related to the data received in the request in a query param called hmac , you should calculate an HMAC value equal to the HMAC sent with the received callback, in order to calculate an HMAC similar to the one you received, prepare your endpoint to perform the following: Sort the data received by key Lexicographical order. Depending on the type of the received callback, concatenate the values of the keys/params in one string, for any transaction callback, the data fields that should be taken in the concentrations are: HMAC String Keys Plain text amount_cents created_at currency error_occured has_parent_transaction obj.id integration_id is_3d_secure is_auth is_capture is_refunded is_standalone_payment is_voided order.id owner pending source_data.pan source_data.sub_type source_data.type success The keys/params should be in the same order shown in the above text. Calculate the hash of the concatenated string using SHA512 and your HMAC secret, found in the profile tab in your dashboard. Now compare both HMAC values, the one you received with the sent request and the one you calculated out of this request if both are equal, you can safely save this data and use it in your system. Transaction Processed/Response Callback: For the processed callbacks, you should concatenate a string from the mentioned fields in the same order. So, if we considered the up-mentioned sample transaction processed callback sample, the resultant string should be like this: HMAC Concatenated String Plain text 1002020-03-25T18:39:44.719228OMRfalsefalse25567066741truefalsefalsefalsetruefalse47782394705false2346MasterCardcardtrue And if you considered the up-mentioned transaction processed callback sample, the HMAC related to it should be: HMAC Calculated Sample Plain text 6965eb228a2ee5003f9dc01528d68271fdbeae7af0e5bbb1d4915cecff675c2fcb3f08aec78e5859e198ca2b1e53c622a7b5ab7dcb9d15b6ab051a25d1ea1a74 So the total results should be like as mentioned in the “Transaction Processed Callback Sample” Token Object HMAC Calculation: If you are saving cards and using them as tokens, you should receive token objects which will contain the card details and their respective tokens and will receive the token object HMAC as a query parameter. To calculate it, you should use the following order to create the HMAC string and then follow the same steps above to reach the final HMAC result and match it to the one received. The order will be as follows: Plain text card_subtype created_at email id masked_pan merchant_id order_id token Note: Try to implement a logic that calculates the HMAC out of the up-mentioned sample callback, and if you got the same results, add this logic to your Transaction processed/response callback endpoints. • [HMAC Callback Calculation Intention](https://developers.paymob.com/pak/manage-callback/hmac-callback-calculation-intention.md): HMAC Authentication Accept callbacks rely on HMAC authentication to verify Accept's identity and the integrity of its data. Each callback invoked from Accept's server-side has its own HMAC validation, and they are all calculated with the same methodology, once you have implemented one of them you can implement the others. Main Method Whenever you receive a callback from Accept's end, You will receive a value of the HMAC related to the data received in the request in a query param called hmac, you should calculate an HMAC value equal to the HMAC sent with the received callback, to calculate an HMAC similar to the one you received, prepare your endpoint to perform the following: Sort the data received by key Lexicographical order. Depending on the type of the received callback, concatenate the values of the keys/params in one string, for any transaction callback, the data fields that should be taken in the concentrations are: HMAC String Keys: Plain text amount_cents Intention.ID The keys/params should be in the same order shown in the above text. Calculate the hash of the concatenated string using SHA512 and your HMAC secret, found in the profile tab in your dashboard. Convert the resultant HMAC to Hex (base 16) lowercase. Now compare both HMAC values, the one you received with the sent request and the one you calculated out of this request if both are equal, you can safely save this data and use it in your system. HMAC String Keys for Processed: Transaction Processed Callback: For the processed callbacks, you should concatenate a string from the mentioned fields in the same order. So, if we consider the above-mentioned sample transaction processed callback sample, the resultant string should be like this: HMAC Concatenated String (Amount in cents / 100) formatted to 2 decimal places + Intention ID) Plain text 500.00pi_test_588afc62007446b4b207e7c2a7e57c84 And if you consider the above-mentioned transaction processed callback sample, the HMAC related to it should be: HMAC Calculated Sample Plain text 4f0306b262885c17c83a9914644b729db4147ffe869571a39d318321a9a4fd22c55192b6dd87606680692d50d2bef0c60b8f8ce8d7493f1e3a835a84f8108d5e • [Error Codes](https://developers.paymob.com/pak/error-codes.md): You can find the Risk error codes and other Acquirer response code descriptions in this section to know more about your declines, and detailed reasons. • [Risk Declines](https://developers.paymob.com/pak/error-codes/risk-declines.md): Paymob has its own Fraud management system to protect its Merchants from Fraudulent Transactions. CODE RESPONSE CODE RESPONSE CODE DESCRIPTION 111 ip country not in whitelist You will receive 111 Risk decline if you are performing a transaction from Country IP which is not in whitelist. Kindly coordinate with Paymob support team for any further clarity. 112 ip country in black list You will receive 112 Risk decline if you are performing a transaction from Country IP which is in Blacklist. Kindly coordinate with Paymob support team for any further clarity. 113 ip not in whitelist You will receive 113 Risk decline if you are performing a transaction from "IP" which is not in Whitelist. Kindly coordinate with Paymob support team for any further clarity. 114 ip in blacklist you will receive 113 Risk decline if you are performing a transaction from "IP" which is in Blacklist. Kindly coordinate with Paymob support team for any further clarity. 121 bin country not in whitelist This means that you are performing a transaction from the bank card number , which bin country is not in White list in our FMS (Fraud Management System) 122 bin country in whitelist This means that you are performing a transaction from the bank card number , which bin country is in black list in our FMS (Fraud Management System) 123 bin not in whitelist This means that you are performing a transaction from the bank card number , which bin country is in black list in our FMS (Fraud Management System) 124 bin in blacklist This transacton is getting declined due to Bin is not in whitelist. 131 amount_cents exceeds allowed This transaction is getting declined due to amount limit exceed. 141 amount_cents exceeds moto limit This transaction is getting declined due to amount limit exceed. 153 email dns check failed This means that the email server could not find the DNS record for the entered email address in the invoice. This can happen for a number of reasons, such as: The recipient's email address is incorrect or contains a typo. 154 email is disposable This is due to disposable email addresses often being associated with fraudulent activity. For example, scammers may use disposable email addresses to create fake accounts or to sign up for services without paying. We may reject payments from disposable email addresses because they are difficult to verify. When making an online payment, we typically needs to verify your identity and your email address. This is to help prevent fraud and to the user financial information. 201 IP is in Global Blacklist IP address is in a global blacklist, it means that that the IP address has been flagged as a potential source of malicious activity. This can happen for a number of reasons, such as: IP address has been used to send spam or phishing emails. IP address has been used to launch DDoS attacks. IP address has been infected with malware. IP address has been used to commit other types of cybercrime. 202 Email in Global Blacklist This is due having the email addresses linked to the attempted transactions identified as being associated with spam, phishing, Fraudulent attempts or other malicious activities. You will need to reach out to Pyamob support team directly for further support and help. 301 Fraud Engine This means that this transaction has been declined due to Risk Checks and our FMS System has rejected this transaction due to any Fraud management reasons like you are not passing the genuine or unique data i.e Email, phone or Name. To avoid this error please always try to pass genuine customer data in the request parameters. 200 if merchant is live and using test credentials This error code means that you are trying to pass test credentials upon live integration ids. As for any further inquiries related to the previously mentioned error codes or any codes raised from your side while performing any transaction, please contact your Account Manager or Contact Support team through email support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard. • [Error Messages](https://developers.paymob.com/pak/error-codes/error-messages.md): Error Messages If an error occurs during performing a transaction, you can identify the specific error message and code associated with it. These error messages and codes are designed to help you understand what went wrong and how to fix it. By referencing the error message and code, you can gain a clear understanding of the issue and take appropriate action to resolve it. It's important to review the error message and code carefully to ensure that you address the root cause of the error. By doing so, you can improve the reliability and accuracy of your transactions. CODE RESPONSE DESCRIPTION 0 Transaction approved The transaction has been processed successfully 1 Refer to issuer The Cardholder issuer has indicated there is a problem with the credentials/card number used in the transaction. The Cardholder should use an alternate Card/payment method, or contact their bank to resolve this issue. 2 Refer to issuer, special The Cardholders issuer has indicated there is a problem with the card number. The Cardholder should use an alternate payment method, or contact their bank. 3 Invalid merchant or service provider This error indicates that either the Merchant facility is non-functional or the details entered into the Gateway are invalid.Reasons for an Invalid Merchant ID Error Code. The disconnection between your merchant account and payment gateway may be caused by a bad gateway configuration, bank error, improper card configuration, or terminated merchant account. Please reach out to our Customer support for any further support in this regard. 4 Pick up card The issuing bank of the customer has declined the transaction as the card may have been reported as stolen or lost. Please advise cardholder to contact their issuing bank for the resolution of this error. 5 Do not honour Do not error comes when the customer's issuing bank is not authorising this transaction due to any valid reason. The payment has been declined by your bank. Please try a different card or contact your bank for further support. This error can be triggered due to following reason. a) The bank's fraud rules (which consider various factors that are not made public) have been triggered. b) The bank may have placed a temporary hold on the customer's card. c) The purchase session may have been locked due to multiple declined payments. d) The seller is located in a country different from that of the card issuing bank. This can be resolved by following below steps: Ask the customer to contact their bank, explaining that they are trying to process a payment. The customer can ask the bank to allow the payment. 2)Ask the customer to try again at a later time. The issuing bank may have only placed a temporary hold on the card. Ask the customer to use an alternative credit card. 6 Error The Cardholders issuer has declined the transaction as there is a problem with the card number. The Cardholder should contact their card issuer and/or use an alternate payment method. 7 Pickup card, special condition (other than lost/stolen card) The Cardholders card issuer has declined the transaction and requested that the card be retained as the card may have been reported as lost or stolen. 8 Honour with identification Transaction processed successfully - identification NOT required. This code is returned by some banks in place of 00 response. This means your transaction has been approved. 9 Request in progress The Cardholders issuer has indicated there is a problem with the card number. The Cardholder should contact their bank and/or use an alternate payment method. 10 Approved for partial amount The transaction was successful for a partial amount. 12 Invalid transaction The bank has declined the transaction because of an invalid format or field. This indicates the card details were incorrect. Check card data entered and try again. This code is often returned from the issuer when they do not accept the transaction. This can possibly be when a transaction for the same amount and merchant is attempted multiple times quickly for the same card. The cardholder should contact their issuing bank. 13 Invalid amount The Cardholders issuer has declined the transaction because of an invalid format or field; or amount exceeds maximum for card program.This usually is the result of a typo (negative amount or ineligible symbol). Double-check what you entered and make sure it wasn't negative or included incorrect symbols. 14 Invalid card number The Cardholders issuing bank has declined the transaction as the payment card number is incorrectly entered, or does not exist.This indicates a problem with the information entered for the card. Double-check the card number, expiration date, and CVV. If you haven't already, also ensure that the card has been activated 15 No issuer The Cardholders issuer does not exist. Check the card information and try processing the transaction again.Wrong card number (Codes 14 & 15): There are two wrong ways to enter the card number improperly. If the very first digit is incorrect, you'll see error code 15 for “no such issuers” since the first digit pinpoints the card's issuing bank. If we say more specifically ,The card number entered is wrong since it doesn’t start with a 3 (AMEX), 4 (Visa), 5 (MasterCard), or 6 (Discover). 16 Approved, update track 3 An unspecified bank error has occurred. The Cardholder should attempt to process the transaction again. 17 Customer cancellation This indicates that the transaction was authorised and subsequently voided. Voided transactions do not appear on the customer's statement or form part of your settlement total. 18 Customer dispute The Cardholders card issuer has prevented this transaction from taking place due to an ongoing or previous dispute. 19 Re-enter last transaction The transaction has not been processed and the Cardholder should attempt to process the transaction again. No further information is provided from the bank as to the reason why this was not processed. 20 Invalid response/acquirer error The bank has declined the transaction because of an invalid format or field. This indicates the card details were incorrect. Check card data entered and try again. 21 No action taken The Cardholders issuer has indicated there is a problem with the payment card number. The Cardholder should use an alternate payment method, or contact their bank. 22 Suspected malfunction The Cardholders issuer could not be contacted during the transaction. The Cardholder should check the card information and try processing the transaction again. 23 Unacceptable transaction An unspecified bank error has occurred. The Cardholder should attempt to process the transaction again. 24 File update impossible An unspecified bank error has occurred. The Cardholder should attempt to process the transaction again. 25 Unable to locate record on file The Cardholders card issuer does not recognise the credit card details. The Cardholder should check the card information and try processing the transaction again. 26 Duplicate reference number The Cardholders card issuer does not recognise the credit card details. The Cardholder should check the card information and try processing the transaction again. 27 Error in reference number The Cardholders card issuer does not recognise the credit card details. The Cardholder should check the card information and try processing the transaction again. 28 File is temporarily unavailable for update An unspecified bank error has occurred. The Cardholder should attempt to process the transaction again.A code 28 error happens during this initial authorization process. It simply means there was an issue immediately retrieving the information from the card-issuing bank. Therefore, because of its temporary status, the transaction should be put through again. 29 File action failed/contact acquirer An unspecified bank error has occurred. The Cardholder should attempt to process the transaction again. 30 Format error The Cardholders issuer does not recognise the transaction details being entered. This is due to a format error. The Cardholder should check the transaction information and try processing the transaction again. We can further explain this as "An "Invalid format" error when updating your credit card means that the credit card number was entered with spaces, dashes, or some other character that is not allowed." As for any further inquiries related to the previously mentioned error codes or any codes raised from your side while performing any transaction, please contact your Account Manager or Contact Support team through email support@paymob.com or you can also raise a ticket through a support widget in your Merchant portal Dashboard. • [Shopify](https://developers.paymob.com/pak/e-commerce-plugins/shopify.md): A handy way to successfully integrate our gateway within your Shopify store, please follow along with the below steps to accomplish your integration Steps for Shopify Integration: 1- Log in to your Shopify Dashboard. 2- Select Settings from the left bottom of your Dashboard page. 3- After clicking Settings, select “Payments”. 4- At the payment page, please make sure that the Payment Capture option should be Automatic. 5- In “Payments”. Click on the Add Payment Methods button. 6- After choosing “Add Payment Method” click on Search by the provider, write Paymob in the search field, and click on the Paymob icon. 7. Further, click on the Connect Button. 8. Choose your Shopify store country. 9. After choosing your country, you will see below page to install your app. 10. Then it will ask for your Paymob dashboard credentials. Enter your username and password. 11. Click on Activate Paymob and make sure to select the "Enable Test mode" if you want to perform the test transactions. You will choose the payment methods according to the availability in your country as well as your requirements. Now Paymob Services are activated on your Shopify. You can perform your test transactions by using the below Test credentials. Once you have successfully performed your test transactions. You can contact your sales agent or the Paymob support team for your live account. • [WooCommerce](https://developers.paymob.com/pak/e-commerce-plugins/woocommerce.md): Paymob for WooCommerce plugin WordPress Directory You can find the Paymob official WooCommerce Plugin in the WordPress Directory page . Installation Steps: · Login into admin panel of your WordPress store. From the side bar menu → Select Plugins → Add New. · In the search field, type the word "Paymob ", and the Paymob for WooCommerce plugin will be listed in the search result. · Click on the Install Now button. Then, click on the Activate button. · In Plugin list you will find Paymob for WooCommerce plugin. . Click on Paymob settings. OR, from WooCommerce = → Settings in the left menu, under the Payment tab, find Paymob Payment and click on Manage. Merchant configuration · Log into Paymob account = → Setting in the left menu and then go to account information. Then get the Secret, public ,and API keys. · · Paste each key in its place in the Paymob WooCommerce setting page. · Then, click on Validate PayMob API key button to ensure the data prvided keys are valid and returns the needed information. (Important) · The HMAC key will be shown in its field and the existing Paymob integration IDs as well. In case any of the provided data is not correct, the validation will fail. · Please ensure to select theintegration IDs that you need end-user pay with/sees in Paymob payment page. (Important) · Copy integration callback URL that exists in Paymob WooCommerce setting page. Then, paste it into each payment integration in Paymob account · In the setting page, you can also the paymob payment method logo, title, and description that end-user will see in WooCommerce checkout page. · Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [OpenCart](https://developers.paymob.com/pak/e-commerce-plugins/opencart.md): Guide for installing Accept's OpenCart plugin supporting our payment methods ( Credit Card, Omannet). OpenCart 4.x.x plugin Installation Steps: Download the plugin file and follow the instructions on how to set it up. Log in to the Opencart admin panel and click Extension =Installer. Then, at the top-left side of the page click on the Upload icon and locate the Upload Plugin file. In the Installed Extensions, locate Paymob Payment. Then, click on Install It. From the left menu in OpenCart admin=> Extensions = Extensions =>Payments, find Paymob Payment. Then, click on the install icon. Merchant configuration Log into Paymob account => Setting in the left menu. Then get the Secret, public, and API keys. Paste each key in its place in the Paymob OpenCart setting page. Then, click on the Validate PayMob API key button to ensure the data provided keys are valid and returns the needed information. (Important) The HMAC key will be shown in its field and the existing Paymob integration IDs as well. In case any of the provided data is not correct, the validation will fail. Please ensure to select the integration IDs that you need the end-user pay with/sees in Paymob payment page. (Important) Copy the integration callback URL that exists in Paymob OpenCart setting page. Then, paste it into each payment integration in Paymob account . Then, click on Save Changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. OpenCart 3.x - 2.3 plugin Installation Steps: Download the plugin file and follow the instructions on how to setup it up. • Log in to the Opencart admin panel and click Extension =>Installer=> Upload your extensions. • From the left menu in OpenCart admin=> Extensions = Extensions =>Payments, find Paymob Payment. • Then, click on the install icon. Merchant configuration • Log into Paymob account => Setting in the left menu. Then get the Secret, public, and API keys. • Paste each key in its place in the Paymob OpenCart setting page. • Then, click on the Validate PayMob API key button to ensure the data provided keys are valid and returns the needed information. (Important) • The HMAC key will be shown in its field and the existing Paymob integration IDs as well. In case any of the provided data is not correct, the validation will fail. • Please ensure to select the integration IDs that you need end-user pay with/sees in Paymob payment page. (Important) • Copy the integration callback URL that exists in Paymob OpenCart setting page. Then, paste it into each payment integration in Paymob account • Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [Magento](https://developers.paymob.com/pak/e-commerce-plugins/magento.md): Magento Marketplace You can check the Paymob Magento 2 module from the Magento Adobe marketplace page . Installation Steps In the server cmd terminal Run the below command to install the Paymob Payment via composer Shell PowerShell composer require paymob/magento-payment Run the below Magento commands to enable Paymob Module Shell PowerShell php -f bin/magento module:enable --clear-static-content Paymob_Payment php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento setup:static-content:deploy -f php bin/magento cache:clean php bin/magento cache:flush Merchant Configuration PayMob Account Log into Paymob account => Setting in the left menu. Get the Secret, public, API keys, HMAC and integration IDs. Magento admin configuration In Magento Admin Panel Menu Stores → Configuration Expand Sales Menu → select Payment Methods → Accept Paymob payment paste each key in its place in the setting page. Please ensure adding the integration IDs separated by comma ,. These IDs will be shown in the Paymob payment page. Copy the integration callback URL that exists in Paymob Magento setting page. Then, paste it into each payment integration/method in Paymob account 5. Then, click on save changes. 6. Ensure there's no error while saving due to incorrect information provided. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [WHMCS](https://developers.paymob.com/pak/e-commerce-plugins/whmcs.md): WHMCS Marketplace You can check the Paymob WHMCS module from the WHMCS marketplace page . Installation Steps Download the Paymob WHMCS plugin from here . Extract the downloaded WHMCS module .zip file into your server in the path of WHMCS project. Login in to the WHMCS admin panel, navigate to Setup → Apps & integrations → Browse → Payments. Search for Paymob Payment, then click on Manage button. Admin configuration Log into Paymob account → Setting in the left menu. Then get the Secret, public, API keys, HMAC and P integration IDs. In WHMCS admin, Navigate to Addons→ Apps & integrations → Payments Apps. Configure the new module in the Manage Existing Gateways tab. Add Paymob configuration as mentioned in the first point. Copy integration callback URL that exists in Paymob WHMCS setting page. Then, paste it into each payment integration/method in Paymob account. Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [Cs-Cart](https://developers.paymob.com/pak/e-commerce-plugins/cs-cart.md): Cs-Cart Marketplace You can check the Paymob Cs-Cart Addon from the marketplace page. Installation Steps Download the Paymob Cs- Cart Addon from the marketplace Login into Cs-Cart admin panel, from the upper menu, click on Add-ons → Manage add-ons. Click on the tools/setting icon in the upper right corner. Choose Manual installation → Local and Select the Paymob downloaded .zip file. 5. Then, click on the Upload & Install button. 6. The Paymob addon will appear on the Add-ons list. Admin configuration From the Cs-Cart admin panel, in the upper menu click on "Administration" →"Payment Methods". Click on the Add button on the top right to add the payment method. You can name your payment method according to the one you need to add and then choose Paymob in the "Processor" dropdown list. Click on "Configure". Add all the configurations needed. Log in to Paymob account → Setting in the left menu. Then get the Secret, public, and API keys. 7. Paste each key in its place in the Paymob Cs-Cart setting page. 8. Then, click on Validate PayMob API key button to ensure the data provided keys are valid and returns the needed information. (Important) 9. The HMAC key will be shown in its field and the existing Paymob integration IDs as well. In case any of the provided data is not correct, the validation will fail. 10. Copy integration callback URL that exists in Paymob Cs-Cart setting page. Then, paste it into each payment integration in Paymob account. 11. Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [PrestaShop](https://developers.paymob.com/pak/e-commerce-plugins/prestashop.md): Installation Steps Paymob PrestaShop unified checkout module is compatible with PrestaShop versions 1.6, 1.7 and 8. Download the Paymob PrestaShop module from here Login into Prestashop admin panel → Modules → Module Manager → Upload a module. Select the Paymob downloaded .zip file. 5. You will see that the module is now uploaded and installed. 6. The Paymob module will appear on the module list. Admin configuration From the Prestashop admin panel, in the left menu Payments → payment methods. Click on the configure button beside Paymob payment method to start the configuration. You can name your payment method according to the one you need to display in the checkout page. Log in to Paymob account → Setting in the left menu. Then get the Secret, public, and API , HMAC keys and Payment met. 5. Paste each key in its place in the Paymob PrestaShop setting page. 6. Copy integration callback URL that exists in Paymob PrestaShop setting page. Then, paste it into each payment integration in Paymob account. 7. Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [Joomla](https://developers.paymob.com/pak/e-commerce-plugins/joomla.md): Paymob VirtueMart Plugin for Joomla Installation Steps: • Download the Paymob Joomla VirtueMart module from here . • Login into admin panel of your Joomla store. Browse to your admin panel → Extensions → Manage → Install. • Click on "Browse for file" below, then choose our plugin ZIP file.In Plugin list • Click on VirtueMart → Payment Methods. • Click on the "New" button. You will be redirected to the payment method information page. • You will then fill in the payment method information based on which one you will integrate. You will then click "Save" and then click on "Configuration" tab. Merchant configuration • Log into Paymob account = → Setting in the left menu. Then get the Secret, public ,and API keys. • Paste each key in its place in the Paymob Virtuemart Configuration page. • Then, click on Validate API key button to ensure the data prvided keys are valid and returns the needed information. (Important) • The HMAC key will be shown in its field and the existing Paymob integration IDs as well. In case any of the provided data is not correct, the validation will fail. • Please ensure to select the integration IDs that you need end-user pay with/sees in Paymob payment page. (Important) • Copy integration callback URL that exists in Paymob Virtuemart Configuration page. Then, paste it into each payment integration in Paymob account • Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [New Shopify App (Embedded Checkout)](https://developers.paymob.com/pak/e-commerce-plugins/new-shopify-app-embedded-checkout.md): Steps for Shopify Integration: Download the plugin from this link . 2. Choose your Shopify store country. 3. Click on Install App. 4. Then it will ask for your Paymob dashboard credentials. Enter your username and password. 5. Uncheck Meeza and make sure to select the "Enable Test mode" and then Click on the Activate Paymob. 6. On the payment page, kindly make sure that the Payment Capture option should be Automatic. Now Paymob Services are activated on your Shopify. You can perform your test transactions by using the below Test credentials. Once you have successfully performed your test transactions. You can contact your sales agent or the Paymob support team for your live account. When Confirmed from sales side that your account is live now then you may remove the 'Enable Test Mode' check to receive live payments. • [ZenCart](https://developers.paymob.com/pak/e-commerce-plugins/zencart.md): Paymob for ZenCart plugin Installation Steps: Download the Paymob ZenCart module from here Extract the downloaded ZenCart module .zip file into your server in the path of ZenCart project. Login in to the ZenCart admin panel, navigate to Modules → Payment. Search for Paymob Payment, then click on it and install the module. Admin configuration: Log into Paymob account → Setting in the left menu. Then get the Secret, public keys, HMAC and Payment integration IDs. Paste each key in its place in the Paymob ZenCart configuration page. Copy integration callback URL that exists in Paymob ZenCart Configuration page. Then, paste it into each payment integration in Paymob account Then, click on save changes. Checkout page: Paymob payment method will be shown for the end-user to start his payment process. • [OsCommerce](https://developers.paymob.com/pak/e-commerce-plugins/oscommerce.md): Paymob for Oscommerce plugin Installation Steps: Download the Paymob Oscommerce module from here Extract the downloaded Oscommerce module .zip file into your server in the path of Oscommerce project. Login in to the Oscommerce admin panel, navigate to Modules → Payment → Online. Click on Show not installed checkbox then Search for Paymob Payment, then click on it and install the module. Admin configuration: Log into Paymob account → Setting in the left menu. Then get the Secret, public keys, HMAC and Payment integration IDs. Paste each key in its place in the Paymob Oscommerce Settings page. Copy integration callback URL that exists in Paymob Oscommerce Settings page. Then, paste it into each payment integration in Paymob account. Then, click on save changes. Checkout page: Paymob payment method will be shown for the end-user to start his payment process. • [Laravel- Bagisto](https://developers.paymob.com/pak/e-commerce-plugins/laravel-bagisto.md): Paymob for Laravel Bagisto E-Commerce Installation Steps Bagisto 1.x Install the Paymob Payment package for Laravel Bagisto 1.x e-commerce via paymob/laravel-bagisto1.x composer. In the server cmd terminal, Run the below command to install the Paymob Payment Package PowerShell composer require paymob/laravel-bagisto1.x 2. Then, run the below commands PowerShell php artisan migratephp artisan optimize 3. Goto app/Http/Middleware/VerifyCsrfToken.php file. Then, add **paymob/callback** in the protected array $except as below PowerShell protected $except = ['paymob/callback',]; 4. After that, run the following command PowerShell php artisan config:cache Bagisto 2.x Install the Paymob Payment module for Laravel Bagisto 2.x e-commerce via paymob/laravel-bagisto2.x composer. In the server cmd terminal, Run the below command to install the Paymob Payment Package PowerShell composer require paymob/laravel-bagisto2.x 2. Then, run the below commands PowerShell php artisan vendor:publish --force --tag=paymob php artisan migrate php artisan optimize 3. Goto app/Http/Middleware/VerifyCsrfToken.php file. Then, add **paymob/callback** in the protected array $except as below PowerShell protected $except = ['paymob/callback',]; 4. After that, run the following command PowerShell php artisan config:cache Merchant Configuration PayMob Account Log into Paymob account → Setting in the left menu. Get the Secret, public, API keys, HMAC and integration IDs . Bagisto admin configuration In Bagisto Admin Panel Menu configuration→ sales→ paymentmethods. Search for Paymob payment, paste each key in its place in the setting page. Please ensure adding the integration IDs separated by comma , . These IDs will be shown in the Paymob payment page. 4. Copy integration callback URL that exists in Paymob Bagisto setting page. Then, paste it into each payment integration/method in Paymob account. 5. Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [Drupal](https://developers.paymob.com/pak/e-commerce-plugins/drupal.md): Paymob for Drupal Commerce Drupal Marketplace You can check the Paymob Drupal Commerce module from the Drupal marketplace . Installation Steps In the server cmd terminal, Install the Paymob Payment module for Drupal Commerce e-commerce via Composer using below command PowerShell composer require paymob_drupal/commerce_paymob 2. In the admin panel, Extend tab, search for the Paymob module, select it, and click the install button to install it. PayMob Account Log into Paymob account => Setting in the left menu. Get the Secret, public, API keys, HMAC and integration IDs . Drupal commerce admin configuration In Drupal commerce Admin Panel Menu Commerce → Configuration → Payments → Payment Gateways section. Select Paymob payment, paste each key in its place in the setting page. Ensure adding the integration IDs separated by comma , . These IDs will be shown in the Paymob payment page. 4. Copy integration callback URL that exists in Paymob Drupal commerce setting page. Then, paste it into each payment integration/method in Paymob account 5. Then, click on save changes. Checkout page Paymob payment method will be shown for the end-user to start his payment process. • [IOS SDK](https://developers.paymob.com/pak/mobile-sdks/mobile-sdks-v1/ios-sdk.md): Installation: AcceptCardSDK is available through CocoaPods. To install it, simply add the following line to your Podfile: Plain text pod 'AcceptCardSDK' And in the general settings of your project, under libraries and frameworkschange the library from "Do not embed" to "Embed and Sign" Usage: import the framework Plain text import AcceptSDK Swift import AcceptSDK add the delegate to the class, and add the protocol stubs Plain text class ViewController: UIViewController, AcceptSDKDelegate { //..... } then create a constant Plain text let accept = AcceptSDK() then pass self to delegate Plain text accept.delegate = self then create the variables Plain text // place your payment key here let KEY: String = "" 🚧 Payment Key A valid payment key is required to start the payment. Valid means Fresh(newly created), doesn't have pending transactions, the best to do is to create a new order for every payment key. To generate a payment key, follow the three step Api (old) flow. now call the function Plain text do { try accept.presentPayVC(vC: self, paymentKey: KEY, saveCardDefault: true, showSaveCard: true, showAlerts: true) } catch AcceptSDKError.MissingArgumentError(let errorMessage) { print(errorMessage) } catch let error { print(error.localizedDescription) } and if you already have a saved token Plain text do { try accept.presentPayVC(vC: self, paymentKey: KEY, saveCardDefault: false, showSaveCard: false, showAlerts: true, token: "", maskedPanNumber: "xxxx-xxxx-xxxx-1234") } catch AcceptSDKError.MissingArgumentError(let errorMessage) { print(errorMessage) } catch let error { print(error.localizedDescription) } what the parameters do Plain text //Show the user whether or not he wants to save the card showSaveCard: true //Initially, the save card option is on or off saveCardDefault: true //either show the user some alerts on success / failure or not showAlerts: true you can use extra parameters such as Plain text //for the color of the buttons buttonsColor: UIColor.blue //for english langauge isEnglish: false //for arabic language isEnglish: false //for the color od the Background backgroundColor: UIColor.white //for the color of the Navigation Bar navBarColor: UIColor.white /for the folor of the text in the Navigation Bar navBarTextColor: UIColor.black //for the color of the background of the TextFields textFieldBackgroundColor: UIColor.gray //for the color of the texts inside the textfields textFieldTextColor: UIColor.black //for the color main title of the page ("Card Information") titleLabelTextColor: UIColor.darkGray //for the color of the labels inputLabelTextColor: UIColor.darkGray //to change the pay button text buttonText: "" //to change the card Name text cardNameLabelText: "" //to change the card number text cardNumberLabelText: "" //to change the expiration text expirationLabelText: "" //to change the cvv text cvvLabelText: "" //used like this do { try accept.presentPayVC(vC: self, paymentKey: KEY, saveCardDefault: true, showSaveCard: true, showAlerts: true, buttonsColor: UIColor.black, isEnglish: true, backgroundColor: UIColor.white, navBarColor: UIColor.white, navBarTextColor: UIColor.black, textFieldBackgroundColor: UIColor.white, textFieldTextColor: UIColor.black, titleLabelTextColor: UIColor.black, inputLabelTextColor: UIColor.black, buttonText: "", cardNameLabelText: "", cardNumberLabelText: "", expirationLabelText: "", cvvLabelText: "") } catch AcceptSDKError.MissingArgumentError(let errorMessage) { print(errorMessage) } catch let error { print(error.localizedDescription) } You can find the GitLab reference from the link here • [Android SDK](https://developers.paymob.com/pak/mobile-sdks/mobile-sdks-v1/android-sdk.md): SDK for Android mobile apps integration. 📘 We'll cover Downloading the SDK Installation➢ 2.1. Adding the arr file in the libs folder➢ 2.2. Adding a dependencies Usage➢ 3.1. import the following classes➢ 3.2. insert your payment key➢ 3.3. if you don't have a card token➢ 3.4. if you have a card token Results Screenshot from PaymentActivity Try our Sample app 1. Download the SDK from: here 2. Installation ➢ 2.1. Adding the arr file in the libs folder ➢ 2.2. Adding a dependencies Plain text You need to add the dependency below. Plain text dependencies { implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'morxander.editcard:EditCard:1.0.1' implementation 'com.android.volley:volley:1.2.0' } 3. Usage 📘 The SDK has two functions to initiate the payment, one for purchase (user enters Card details) and another one for recurring payments (using a saved card token). To start the SDK, an intent is sent with the below Extras to our PayActivity. 🚧 PAYMENT KEY A valid payment key is required to start the payment. it's also sent with the intent Extras, which will be mentioned below. Valid means Fresh(newly created), doesn't have pending transactions, the best to do is to create a new order for every payment key. To generate a payment key, follow the three step Api (old) flow. ➢ 3.1. import the following classes Plain text // import the following import com.paymob.acceptsdk.PayActivity; import com.paymob.acceptsdk.PayActivityIntentKeys; import com.paymob.acceptsdk.PayResponseKeys; import com.paymob.acceptsdk.SaveCardResponseKeys; import com.paymob.acceptsdk.ToastMaker; ➢ 3.2. insert your payment key Plain text // insert your payment key in a paymentKey field final String paymentKey = ""; ➢ 3.3. if you don't have a card token 📘 If you don't have a card token then you will need to send the following info⫸ Payment Key⫸ 3D secure⫸ The default to whether to save a card or not⫸ Whether or not to show the save card option (if you choose to hide it, then saving the card or not will be the default you set in the line above)⫸ The theme color(so that you can set it the same as your app) Title Description Parameter Description PAYMENT_KEY This is the payment key you entered in 3.2 THREE_D_SECURE_ACTIVITY_TITLE SAVE_CARD_DEFAULT The default for whether to save a card or not SHOW_SAVE_CARD Whether or not to show the save card option (if you choose to hide it, then saving the card or not will be the default you set in the line above in (SAVE_CARD_DEFAULT) THEME_COLOR The theme color(so that you can set it the same as your app) ACCEPT_PAYMENT_REQUEST Arbitrary number and used only in this activity. Change it as you wish. 📘 Below is the first function that starts the PayActivity with no Card token. Also, it takes a boolean value to whether to display the Save Card checkbox or not. Plain text Intent pay_intent = new Intent(this, PayActivity.class); putNormalExtras(pay_intent); // this key is used to save the card by deafult. pay_intent.putExtra(PayActivityIntentKeys.SAVE_CARD_DEFAULT, false); // this key is used to display the savecard checkbox. pay_intent.putExtra(PayActivityIntentKeys.SHOW_SAVE_CARD, showSaveCard); //this key is used to set the theme color(Actionbar, statusBar, button). pay_intent.putExtra(PayActivityIntentKeys.THEME_COLOR,getResources().getColor(R.color.ThemeColor)); // this key is to wether display the Actionbar or not. pay_intent.putExtra("ActionBar",true); // this key is used to define the language. takes for ex ("ar", "en") as inputs. pay_intent.putExtra("language","ar"); startActivityForResult(pay_intent, ACCEPT_PAYMENT_REQUEST); Intent secure_intent = new Intent(this, ThreeDSecureWebViewActivty.class); secure_intent.putExtra("ActionBar",true); ➢ 3.4. if you have a card token 📘 this step depends if you have a card token or notIf you have a card token you will need to send the following information● Payment key● 3D Secure● Card Token● Masked pan number● The default for whether to save a card or not● Whether or not to show the save card option (if you choose to hide it, then saving thecard or not will be the default you set in the line above) Title Description Parameter Description PAYMENT_KEY This is the payment key you entered in 3.2 THREE_D_SECURE_ACTIVITY_TITLE TOKEN You should use your actual card token MASKED_PAN_NUMBER Card masked Pan in case of the saved card. SAVE_CARD_DEFAULT The default for whether to save a card or not SHOW_SAVE_CARD Whether or not to show the save card option (if you choose to hide it, then saving the card or not will be the default you set in the line above in SAVE_CARD_DEFAULT) THEME_COLOR This key is used to set the theme color(Actionbar, statusBar, button). 4. Results 📘 Below is the function that starts the PayActivity with Card token. you will need to have the Customer's Card token ready. Plain text Intent pay_intent = new Intent(this, PayActivity.class); putNormalExtras(pay_intent); // replace this with your actual card token // this key is used to define the language. takes for ex ("ar", "en") as inputs. pay_intent.putExtra("language","ar"); // replace this with your actual card token pay_intent.putExtra(PayActivityIntentKeys.TOKEN, "6088c38c19705a495f1727561d4f4814b2ed7e45e9cd80c72f233253"); // card masked Pan in case of saved card. pay_intent.putExtra(PayActivityIntentKeys.MASKED_PAN_NUMBER, "xxxx-xxxx-xxxx-1234"); // this key is used to save the card by deafult. pay_intent.putExtra(PayActivityIntentKeys.SAVE_CARD_DEFAULT, false); // this key is used to display the savecard checkbox. pay_intent.putExtra(PayActivityIntentKeys.SHOW_SAVE_CARD, false); pay_intent.putExtra("ActionBar",true); //this key is used to set the theme color(Actionbar, statusBar, button). pay_intent.putExtra(PayActivityIntentKeys.THEME_COLOR,getResources().getColor(R.color.ThemeColor)); // this is the customer billing data, it should be passed, when paying with a saved Card. pay_intent.putExtra( PayActivityIntentKeys.FIRST_NAME, "Cliffo"); pay_intent.putExtra(PayActivityIntentKeys.LAST_NAME, "Nicol"); pay_intent.putExtra(PayActivityIntentKeys.BUILDING,"8028"); pay_intent.putExtra(PayActivityIntentKeys.FLOOR, "42"); pay_intent.putExtra(PayActivityIntentKeys.APARTMENT, "803"); pay_intent.putExtra(PayActivityIntentKeys.CITY, "Jask"); pay_intent.putExtra(PayActivityIntentKeys.STATE, "Uta"); pay_intent.putExtra(PayActivityIntentKeys.COUNTRY,"CR" ); pay_intent.putExtra(PayActivityIntentKeys.EMAIL, "claudette09@exa.com"); pay_intent.putExtra(PayActivityIntentKeys.PHONE_NUMBER, "+86(8)9135210487"); pay_intent.putExtra(PayActivityIntentKeys.POSTAL_CODE, "01898"); startActivityForResult(pay_intent, ACCEPT_PAYMENT_REQUEST); } 📘 The payment key is passed to the intent separately in both functions body or by using the below implementation Plain text private void putNormalExtras(Intent intent) { intent.putExtra(PayActivityIntentKeys.PAYMENT_KEY, paymentKey); intent.putExtra(PayActivityIntentKeys.THREE_D_SECURE_ACTIVITY_TITLE, "Verification"); } 📘 As a result of the above Activity Calls, you should be expecting the below values to be returned to the caller Activity. use these values to update your backend. Plain text @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); Bundle extras = data.getExtras(); if (requestCode == ACCEPT_PAYMENT_REQUEST) { if (resultCode == IntentConstants.USER_CANCELED) { // User canceled and did no payment request was fired ToastMaker.displayShortToast(this, "User canceled!!"); } else if (resultCode == IntentConstants.MISSING_ARGUMENT) { // You forgot to pass an important key-value pair in the intent's extras ToastMaker.displayShortToast(this, "Missing Argument == " + extras.getString(IntentConstants.MISSING_ARGUMENT_VALUE)); } else if (resultCode == IntentConstants.TRANSACTION_ERROR) { // An error occurred while handling an API's response ToastMaker.displayShortToast(this, "Reason == " + extras.getString(IntentConstants.TRANSACTION_ERROR_REASON)); } else if (resultCode == IntentConstants.TRANSACTION_REJECTED) { // User attempted to pay but their transaction was rejected // Use the static keys declared in PayResponseKeys to extract the fields you want ToastMaker.displayShortToast(this, extras.getString(PayResponseKeys.DATA_MESSAGE)); } else if (resultCode == IntentConstants.TRANSACTION_REJECTED_PARSING_ISSUE) { // User attempted to pay but their transaction was rejected. An error occured while reading the returned JSON ToastMaker.displayShortToast(this, extras.getString(IntentConstants.RAW_PAY_RESPONSE)); } else if (resultCode == IntentConstants.TRANSACTION_SUCCESSFUL) { // User finished their payment successfully // Use the static keys declared in PayResponseKeys to extract the fields you want ToastMaker.displayShortToast(this, extras.getString(PayResponseKeys.DATA_MESSAGE)); } else if (resultCode == IntentConstants.TRANSACTION_SUCCESSFUL_PARSING_ISSUE) { // User finished their payment successfully. An error occured while reading the returned JSON. ToastMaker.displayShortToast(this, "TRANSACTION_SUCCESSFUL - Parsing Issue"); // ToastMaker.displayShortToast(this, extras.getString(IntentConstants.RAW_PAY_RESPONSE)); } else if (resultCode == IntentConstants.TRANSACTION_SUCCESSFUL_CARD_SAVED) { // User finished their payment successfully and card was saved. // Use the static keys declared in PayResponseKeys to extract the fields you want // Use the static keys declared in SaveCardResponseKeys to extract the fields you want ToastMaker.displayShortToast(this, "Token == " + extras.getString(SaveCardResponseKeys.TOKEN)); } else if (resultCode == IntentConstants.USER_CANCELED_3D_SECURE_VERIFICATION) { ToastMaker.displayShortToast(this, "User canceled 3-d scure verification!!"); // Note that a payment process was attempted. You can extract the original returned values // Use the static keys declared in PayResponseKeys to extract the fields you want ToastMaker.displayShortToast(this, extras.getString(PayResponseKeys.PENDING)); } else if (resultCode == IntentConstants.USER_CANCELED_3D_SECURE_VERIFICATION_PARSING_ISSUE) { ToastMaker.displayShortToast(this, "User canceled 3-d scure verification - Parsing Issue!!"); // Note that a payment process was attempted. // User finished their payment successfully. An error occured while reading the returned JSON. ToastMaker.displayShortToast(this, extras.getString(IntentConstants.RAW_PAY_RESPONSE)); } } } Parameter Description USER_CANCELED User canceled and did no payment request was fired MISSING_ARGUMENT You forgot to pass an important key-value pair in the intent's extras TRANSACTION_ERROR An error occurred while handling an API's response TRANSACTION_REJECTED The user attempted to pay but their transaction was rejected TRANSACTION_REJECTED_PARSING_ISSUE The user attempted to pay but their transaction was rejected. An error occurred while reading the returned JSON TRANSACTION_SUCCESSFUL User finished their payment successfully TRANSACTION_SUCCESSFUL_PARSING_ISSUE The user finished their payment successfully. An error occurred while reading the returned JSON TRANSACTION_SUCCESSFUL_CARD_SAVED User finished their payment successfully and the card was saved USER_CANCELED_3D_SECURE_VERIFICATION The User canceled 3-d secure verification USER_CANCELED_3D_SECURE_VERIFICATION_PARSING_ISSUE The user finished their payment successfully. An error occurred while reading the returned JSON. 5. Screenshot from PaymentActivity 6. Try our Sample app from here • [Subscriptions](https://developers.paymob.com/pak/subscriptions.md): Paymob provides a subscription module for merchants to manage their subscriptions weekly, monthly, or yearly according to their needs. You can contact your Account manager or you can raise the ticket through the portal to make your customized Subscription by giving information regarding the amount, time span, Retries, reminders, and all other related information regarding your subscription plan or simply you can create your Subscription Plan by following the mentioned APIs as in below sections. You will need to have two integration IDs, one “Online 3DS” and, a second “Moto” Integration id. You will be utilizing your Moto Integration id while creating the “Subscription Plan” itself and you will be using the “Online 3DS” Integration ID to create the subscriptions. Download the Subscription Module APIs . • [Authentication Request](https://developers.paymob.com/pak/subscriptions/authentication-request.md): To start using any feature/API for the subscription module, you would need to get the Authentication token through the below Auth request. • [Create Subscription plan](https://developers.paymob.com/pak/subscriptions/create-subscription-plan.md): You can create your own desired Subscription plan by using the below-mentioned APIs. First, you will run an Authentication request to get the Auth Bearer Token for Authorization as explained in the previous section. URL : https://pakistan.paymob.com/api/acceptance/subscription-plans Method : POST Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} • [Pause Subscription Plan](https://developers.paymob.com/pak/subscriptions/pause-subscription-plan.md): This API enables you to suspend/pause a specific subscription plan identified by {{SUBSCRIPTION_PLAN_ID}}. To utilize this functionality, send a POST request to the provided URL with the relevant Bearer Token in the request header. Suspending a Subscription Plan will temporarily inactivate the plan. First, you will run an Authentication request to get the Auth Bearer Token for Authorization URL : https://pakistan.paymob.com/api/acceptance/subscription-plans/{subscription-plan id}/suspend Method : POST Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} “You will just pass the subscription plan id in the mentioned URL to pause your subscription plan.” You will get the parameter “is_active” as “false” which confirms that your subscription plan has been paused. • [Resume Subscription plan](https://developers.paymob.com/pak/subscriptions/resume-subscription-plan.md): You can resume your subscription plan whenever you need, by using the below API. First, you will run an Authentication request to get the Auth Bearer Token for Authorization Method : POST Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} URL : https://pakistan.paymob.com/api/acceptance/subscription-plans/{subscription-plan id}/resume You will just pass the subscription plan id in the mentioned URL to resume your subscription plan. You will get the parameter “is_active” as “true” which confirms that your subscription plan has been resumed. • [Create Subscriptions](https://developers.paymob.com/pak/subscriptions/create-subscriptions.md): You can create your subscriptions by adding a simple one parameter in the normal payment intention API as explained in the Create Intention/Payment API section . Once you perform the payment using below intention API while adding " subscription_plan_id ":10, in the request parameter, your subscription will be created successfully for the specific cardholder who has just performed the payment. Note! Once you are done with the Intention you need to call this URL. It will open in browser's window. https://pakistan.paymob.com/unifiedcheckout/?publicKey = <add your public key here>&clientSecret=<add your client secret key here> You will get your Public key from your Dashboard and you will get your client secret key in the response of Intention API. • [Pause Subscriptions](https://developers.paymob.com/pak/subscriptions/pause-subscriptions.md): This API enables you to suspend a specific subscription identified by {{SUBSCRIPTION_ID}}. To utilize this functionality, send a POST request to the provided URL with the relevant Bearer Token in the request header. Suspending a subscription temporarily stops its active billing. This API allows you to manage subscription states as needed. URL : https://pakistan.paymob.com/api/acceptance/subscriptions/{{SUBSCRIPTION_ID}}/suspend Method : POST Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} In response to the Suspend API request ,you will receive a state of the subscription in the response parameters as mentioned above in response body i.e. "state": "suspended". You can also find the "resumed at" and "suspended at" parameters in the response body. • [Resume Subscriptions](https://developers.paymob.com/pak/subscriptions/resume-subscriptions.md): This API allows you to resume a specific subscription identified by {{SUBSCRIPTION_ID}}. To use this functionality, send a POST request to the provided URL with the appropriate Bearer Token in the request header. Resuming a subscription reactivates its billing after it has been previously suspended. This API is useful for managing subscription states and ensuring continuity of payments. URL : https://pakistan.paymob.com/api/acceptance/subscriptions/{{SUBSCRIPTION_ID}}/resume Method : POST Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} In response to Resume API request ,you will receive a state of the subscription in the response parameters as mentioned above in response body i.e. " state ": " active ".. You can also find the "resumed at" and "suspended at" parameters in the response body. • [Cancel Subscription](https://developers.paymob.com/pak/subscriptions/cancel-subscription.md): This API allows you to cancel a specific subscription identified by {{SUBSCRIPTION_ID}}. To use this functionality, send a POST request to the provided URL with the appropriate Bearer Token in the request header. URL : https://pakistan.paymob.com/api/acceptance/subscriptions/{{SUBSCRIPTION_ID}}/cancel Method : POST Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} Please note only the suspended subscription can be resumed, canceling the subscription will permanently close the subscription. In response to the Cancel Subscription API request ,you will receive a state of the subscription in the response parameters as mentioned above in response body i.e. "state": "canceled". You can also find the "resumed at" and "suspended at" parameters in the response body. • [List Subscription details](https://developers.paymob.com/pak/subscriptions/list-subscription-details.md): This API will help you to list down all subscription details against one specific subscription ID. URL : https://pakistan.paymob.com/api/acceptance/subscriptions/{{subscription_id}} Method : GET Source : Merchant's server Recipient : Accept's server Authentication : Bearer Token {auth token} https://pakistan.paymob.com/api/acceptance/subscriptions ?transaction=23415 ?transaction=transaction_id: Can be used to retrieve subscriptions related to a transaction Please note that if you will not add any subscription id at the end of URL, you will get all subscriptions associated with the specific merchant. In response to List API, you will be able to get below information in response : ID (id): Each subscription has a unique identifier. This can be useful for tracking and managing subscriptions. Client Information (client_info): Provides details about the client who subscribed, including full name, email, and phone number. Merchants can use this information for customer management and communication. Subscription Details: Frequency (frequency): Indicates how often the subscription renews Created and Updated Dates (created_at, updated_at) : Timestamps that help merchants keep track of when the subscription was created and last updated. Name (name): Name associated with the subscription. It could be the product or service name or any custom name assigned by the client. Reminder and Retrial Days (reminder_days, retrial_days): Specifies the number of days before the next billing for sending reminders and retrial attempts. Merchants can automate communication and payment recovery processes based on these values. Billing and Payment Information: Plan ID (plan_id): Identifies the specific plan or tier of the subscription. Useful for categorizing and managing different subscription levels. State (state): Indicates the current state of the subscription, e.g., active, suspended, etc. Helps merchants understand the status of each subscription. Amount (amount_cents): Specifies the subscription amount in cents. Merchants can use this information for financial reporting and analysis. Starts, Next Billing, Reminder, and Ends Dates (starts_at, next_billing, reminder_date, ends_at): Important dates related to the subscription lifecycle. Helps merchants in planning and managing subscription events.