Gateway
A seller on SocialPay has the option of using a supported gateway to handle payment.
The only currently supported payment gateway is MangoPay.
GET a list of gateways
Query a list of gateways. Parameters for pagination, query condition and sort order can be used for this method, see pagination and query pages for details.
Get a list of gateways example
curl /v2/gateways?page=1&per_page=20&filter=&sort= -H "X-Api-Key:.." -H "Authorization:JWT .."
Successful return object:
{
"page": 1,
"per_page": 20,
"data": []
}
GET a single gateway by ID
Query a gateway object by ID.
Get a single gateway example
curl /v2/gateways/1 -H "X-Api-Key:.." -H "Authorization:JWT .."
Successful return object:
{
"id": 1,
"app_id": 20,
"gateway": "mangopay",
"merchant": "",
"username": "..",
"passcode": "A",
"live": false
}
POST a gateway
Create a gateway entity.
| Field | Type | Description |
|---|---|---|
| app_id | int | App.ID |
| gateway | string | Gateway name |
| version | string | Gateway version |
| merchant | string | Merchant name |
| username | string | Client username |
| passcode | string | Client password |
| apikey | string | API key |
| hash | string | Hash phrase |
| live | boolean | live or sandbox mode |
| forms | string | HTML form fields |
- Merchant, username, passcode, apikey, hash are not required by all gateways, only some of them are necessary for a specific gateway.
POST to create a gateway:
curl -X POST -d '{"app_ip":100,"gateway":"stripe"}' /v2/gateways -H "X-Api-Key:.." -H "Authorization:JWT .."
Successful return:
{
"status": "OK",
"id": 123
}
PUT a gateway
Update a gateway entity.
Update a gateway example
curl -X PUT -d '{"merchant":"MakeitSocial"}' /v2/gateways/1 -H "X-Api-Key:.." -H "Authorization:JWT .."
Successful return:
{
"status": "OK"
}
DELETE a gateway
Delete a gateway entity. Only system admin role can make this request.
Delete a gateway example
curl -X DELETE /v2/gateways/1 -H "X-Api-Key:.." -H "Authorization:JWT .."
Successful return:
{
"status": "OK"
}