Code Monkey home page Code Monkey logo

payfort-api's Introduction

Custom merchant page integration

When you use our custom merchant page integration route you build your own payment form that captures payment data and that directly submits that data to Amazon Payment Services for payment authorization.

Custom merchant page integration is a good choice if you want the highest level of on-page customization, or if your ecommerce use case has unique technical requirements.

1- Create signature

Signature Pattern :
  1. Sort all Amazon Payment Services request parameters (both mandatory and optional) in an ascending alphabetical order based on the parameters names.
  2. Concatenate the parameter name with the value separated by ’=’ (param_name=param_value).
  3. Concatenate all the parameters directly without any separator. (param_name1=param_value1param_name2=param_value2).
  4. Add the Merchant’s Passphrase at the beginning and end of the parameters string. (REQUESTPHRASEparam_name1=param_value1param_name2=param_value2RE QUESTPHRASE).
  5. Use the SHA or HMAC SHA function to generate the SHA or HMAC SHA value of the resulted string depending on the type of SHA or HMAC SHA selected by the Merchant.

2- Create Tokenization Request

Include the following parameters in the Request you will send to Amazon Payment Services:
ATTRIBUTES TYPE REQUIRED LENGTH DESCRIPTION
service_command Alpha Mandatory 20 Expected values: TOKENIZATION
access_code Alphanumeric Mandatory 20 Example: zx0IPmPy5jp1vAz
merchant_identifier Alphanumeric Mandatory 20 The ID of the Merchant.
merchant_reference Alphanumeric Mandatory 20 The Merchant’s unique order number.
language Alpha Mandatory 2 - Expected values: en - ar
expiry_date Numeric Mandatory 4 The card’s expiry date
card_number Numeric Mandatory 19 - The clear credit card’s number.
- Example: 4005550000000001
card_security_code Numeric Mandatory 4 - A security code for the card.
- Example: 123
signature Alphanumeric Mandatory 200 - A string hashed using the Secure Hash Algorithm.
token_name Alphanumeric Optional 100 - Example: Op9Vmp
card_holder_name Alpha Optional 50 - The card holder name.
- Example: John Smith
remember_me Alpha Optional 3 - Expected values: YES - NO
return_url Alphanumeric Optional 400 - Page to be displayed to the customer.
- Example: https://www.merchant.com
The following parameters will be returned in Amazon Payment Services response:
ATTRIBUTES TYPE LENGTH DESCRIPTION
response_message Alphanumeric 150 - Message description of the response code.
- It returns according to the request language.
- Expected values: (Please refer to section messages)
response_code Numeric 5 - Response Code carries the value of our system’s response.
- The code consists of five digits,
- The first 2 digits represent the response status.
- Example: 20064
status Numeric 2 - A two-digit numeric value that indicates the status of the transaction.
- Expected values: (Please refer to section statuses)
card_bin Numeric 8 - The first 6 digits of the card number.
- Example: 478773
token_name Alphanumeric 100 - Example: Op9Vmp

3- Create FortPurchase Request

Include the following parameters in the request you will send to Amazon Payment Services:
ATTRIBUTES TYPE REQUIRED LENGTH DESCRIPTION
command Alpha Mandatory 20 Expected values: AUTHORIZATION - PURCHASE
access_code Alphanumeric Mandatory 20 Example: zx0IPmPy5jp1vAz
merchant_identifier Alphanumeric Mandatory 20 The ID of the Merchant.
merchant_reference Alphanumeric Mandatory 20 The Merchant’s unique order number.
amount Alpha Mandatory 10 - Each currency has predefined allowed decimal points.
- Example: 10000
currency Alpha Mandatory 3 - The currency of the transaction’s amount in ISO code 3.
- Example: AED
language Alpha Mandatory 2 The checkout page and messages language.
customer_email Alphanumeric Mandatory 254 - The customer’s email.
- Example: [email protected]
customer_ip Alphanumeric Mandatory 45 - It holds the customer’s IP address.
- It’s Mandatory, if the fraud service is active.
- Example:
- IPv4 → 192.178.1.10
- IPv6 → 2001:0db8:3042:0002:5a55:caff:fef6:bdbf
signature Alphanumeric Mandatory 200 - A string hashed using the Secure Hash Algorithm.
- Example: 123
token_name Alphanumeric Mandatory 100 - The Token received from the Tokenization process.
- Example: Op9Vmp
payment_option Alpha Mandatory 10 - Expected values :
- MASTERCARD
- VISA
- AMEX
- MADA
- MEEZA
eci Alpha Optional 16 - Ecommerce indicator.
- Expected values :
- ECOMMERCE
- MOTO
- RECCURING
order_description Alphanumeric Optional 150 - It holds the description of the order.
- Example: iPhone 6-S
order_description Alphanumeric Optional 150 - It holds the description of the order.
- Example: iPhone 6-S
card_security_code Numeric Optional 4 - A security code for the card.
- Only AMEX accepts card security code of 4 digits.
- Example: 123
customer_name Alpha Optional 40 - The customer’s name.
- Example: John Smith
remember_me Alpha Optional 3 - Expected values: YES - NO
phone_number Alphanumeric Optional 19 - The customer’s phone number.
- Example: 00962797219966
settlement_reference Alphanumeric Optional 34 - The Merchant submits unique value to Amazon Payment Services.
- Example: XYZ9239-yu898
billing_stateProvince Alphanumeric Optional 20 - The state or province of the address.
- Example: AMMAN - TALFILAH
billing_provinceCode Alphanumeric Optional 3 - Example: AM - AT
billing_street Alphanumeric Optional 100 - The first line of the address.
billing_postcode Alphanumeric Optional 10 - The post code or zip code of the address.
billing_country Alphanumeric Optional 3 - The 3 letter ISO standard Alphanumeric country code of the address.
billing_company Alphanumeric Optional 100 - The name of the company associated with this address.
return_url Alphanumeric Optional 400 - The URL of the Merchant’s page to be displayed to the customer.
- Example: https://www.merchant.com
The following parameters will be returned in Amazon Payment Services’ response:
ATTRIBUTES TYPE LENGTH DESCRIPTION
response_message Alphanumeric 150 - Message description of the response code.
- It returns according to the request language.
- Expected values: (Please refer to section messages)
response_code Numeric 5 - Response Code carries the value of our system’s response.
- The code consists of five digits,
- The first 2 digits represent the response status.
- Example: 20064
status Numeric 2 - A two-digit numeric value that indicates the status of the transaction.
- Expected values: (Please refer to section statuses)
fort_id Numeric 8 - The order’s unique reference returned by our system.
- Example: 149295435400084008

payfort-api's People

Contributors

omar-gamel avatar omargamel055 avatar

Stargazers

 avatar Omar Kamel avatar Serhii Liamin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.