Developer Documents
Overview
In the Payly Developers section, dear developers, an opportunity has been provided for you to use the software facilities in your website and internet systems, in the future, we will be with you by teaching you how to use Payly plugins and APIs for development.
Plugins
Download
Download Wordpress(Woocommerce) or Shopify plugin , Select and download the plugin of your desired platform using the buttons below
Wordpress Shopify
Installation
  • Step 1 : Go to the Payly api section and create a new api.
  • Step 2 : Get your Api Key and Token.
  • Step 3 : Install Plugin in your platform.
  • Step 4 : Enter Api Key and Token in your plugin settings.
Api Documents
Create api credentials
  • First go to Payly api section
  • Click on add button
  • Enter Api title
  • Enter your domain
  • Enter your server Ip address
  • Click on Add Api Button
Api payment gateway call data
Api base url :
http://app.payly.fr/DeveloperApi/<controller>/<action>

Common Request header (you must send this headers to call any api) :
'Token' : '<Your-Token>'
'ApiKey' : '<Your-Api-Key>'

Authenticate Token and ApiKey
Api url:
/PaymentGateway/Authenticate

Request header :
'Token' : '<Your-Token>'
'ApiKey' : '<Your-Api-Key>'

Request body :
Nothing

Response body :
{
    'isSuccess' : true ,// Boolean : Operation Status
    'statusCode' : 1 ,// int : Operation Status Code
    'statusMessage' : "Successful Operation" ,// String : Operation Status Message
    'resultObject' ://Object : Operation Result
    {   
        "status": true // Boolean : Determines if apikey and token are valid
    } 
}
Create session
This api will create a pay session and returns Session Id and Url
It requires some info in the body which will be shown below:
Api url:
/PaymentGateway/StartPaySession

Request header :
'Token' : '<Your-Token>'
'ApiKey' : '<Your-Api-Key>'

Request body :
'Amount' : '<The-Amount-Of-Money-Needed-To-Be-Paid>'
'AmountType' : '<Type-Of-Currency>'
'SuccessUrl' : '<Url-That-Will-Be-Redirected-To-If-Payment-Was-Successful>'
'FailedUrl' : '<Url-That-Will-Be-Redirected-To-If-Payment-Was-Not-Successful>'
Attention: Your Success and Fail Url should start with https:// and should contain a {session_id} Example : https://example.com?sessionid={session_id}



Currency Name Code
Uero 75
Dollar 76

Response body :
{
    'isSuccess' : true ,//Boolean : Operation Status
    'statusCode' : 1 ,//int : Operation Status Code
    'statusMessage' : "Successful Operation" ,//String : Operation Status Message
    'resultObject' : //Object : Operation Result
     {   
        "url": "http://app.payly.fr/PaymentGateway?token={Session-Id-Will-Be-Here}" , // String : Url of payment session
        "sessionId": "{Session-Id}" // String :Session Id
     } 
}

After payment is done or canceled , the success or fail url will be redirected with query string of sessionid
Example:
https://<Your-Success-Or-Failed-Url>?sessionid=<sessionid>


Check session status
After creating session , you can check session status to see if user completed the payment or not
Api url:
/PaymentGateway/CheckPayStatus

Request header :
'Token' : '<Your-Token>'
'ApiKey' : '<Your-Api-Key>'

Request body :
'SessionId' : '<The-SessionId-That-You-Have>'

Response body :
{
    'isSuccess' : true , // Boolean : Operation Status
    'statusCode' : 1 , // int : Operation Status Code
    'statusMessage' : "Successful Operation" , // String : Operation Status Message
    'resultObject' : // Object : Operation Result
    {
        "Status": "{Status-of-payment}" , // int : Status of payment
    }
}


Status Code Message
78 User did not complete payment yet
79 User successfuly completed payment
80 Payment failed or user canceled the payment