Procesamiento
3 min
Desde el Servidor
Procesamiento de la Operación
Permite procesar la operación con toda la información recolectada.
POST
https://api.sugaway.com/p/operations/{{intent_token}}
Body Parameters
- sourcestringrequiredDescription
- installmentstringDescription
- walletstringDescription
- numberOfInstallmentsNumberDescription
- customerObjectDescription
- namestringDescription
- identificationstringDescription
- emailstringDescription
- phonestringDescription
- authCodestringDescription
- sourcesArray
- sourceReferencestring
curl
curl --location -g --request POST 'https://api.sugaway.com/p/operations/{{intent_token}}' \
--header 'Accept: application/json' \
--data-raw '{"source":"string","installment":"string","wallet":"string","installmentCount":"string","customer":"Object","authCode":"string"}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.sugaway.com/p/operations/{{intent_token}}',
'headers': {
'Accept': 'application/json'
},
body: '{"source":"string","installment":"string","wallet":"string","installmentCount":"string","customer":"Object","authCode":"string"}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
var raw = "{\"source\":\"string\",\"installment\":\"string\",\"wallet\":\"string\",\"installmentCount\":\"string\",\"customer\":\"Object\",\"authCode\":\"string\"}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.sugaway.com/p/operations/{{intent_token}}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
url = "https://api.sugaway.com/p/operations/{{intent_token}}"
payload = "{\"source\":\"string\",\"installment\":\"string\",\"wallet\":\"string\",\"installmentCount\":\"string\",\"customer\":\"Object\",\"authCode\":\"string\"}"
headers = {
'Accept': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "net/http"
url = URI("https://api.sugaway.com/p/operations/{{intent_token}}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request.body = "{\"source\":\"string\",\"installment\":\"string\",\"wallet\":\"string\",\"installmentCount\":\"string\",\"customer\":\"Object\",\"authCode\":\"string\"}"
response = https.request(request)
puts response.read_body
200
{
"id": "kS6D18unD",
"status": {
"code": "200",
"text": "Aprobado",
"message": "Transacción Aprobada"
}
}Ejemplo
{
"installment": "1",
"source": "T:3QHGWZUL5WCZHA9D4SDW0O"
}Procesamiento Simplificado
Bajo este esquema se permite el procesamiento sin necesidad de crear el Token del Medio de pago de manera anticipada al procesamiento. En este modo sólo se soporta el procesamiento con un medio de pago.
En este tipo de procesamiento se recomienda enviar la información del customer al crear el Intent Token
Procesamiento de la Operación
Permite procesar la operación con toda la información recolectada.
POST
https://api.sugaway.com/p/operations/{{intent_token}}
Body Parameters
- sourceObjectrequiredDescription
- installmentCountNumberDescription
- customerObjectDescription
- namestringDescription
- identificationstringDescription
- emailstringDescription
- phonestringDescription
- authCodestringDescription
curl
curl --location -g --request POST 'https://api.sugaway.com/p/operations/{{intent_token}}' \
--header 'Accept: application/json' \
--data-raw '{"source":"string","installment":"string","wallet":"string","installmentCount":"string","customer":"Object","authCode":"string"}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.sugaway.com/p/operations/{{intent_token}}',
'headers': {
'Accept': 'application/json'
},
body: '{"source":"string","installment":"string","wallet":"string","installmentCount":"string","customer":"Object","authCode":"string"}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
var raw = "{\"source\":\"string\",\"installment\":\"string\",\"wallet\":\"string\",\"installmentCount\":\"string\",\"customer\":\"Object\",\"authCode\":\"string\"}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.sugaway.com/p/operations/{{intent_token}}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
url = "https://api.sugaway.com/p/operations/{{intent_token}}"
payload = "{\"source\":\"string\",\"installment\":\"string\",\"wallet\":\"string\",\"installmentCount\":\"string\",\"customer\":\"Object\",\"authCode\":\"string\"}"
headers = {
'Accept': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "net/http"
url = URI("https://api.sugaway.com/p/operations/{{intent_token}}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request.body = "{\"source\":\"string\",\"installment\":\"string\",\"wallet\":\"string\",\"installmentCount\":\"string\",\"customer\":\"Object\",\"authCode\":\"string\"}"
response = https.request(request)
puts response.read_body
200
{
"id": "kS6D18unD",
"status": {
"code": "200",
"text": "Aprobado",
"message": "Transacción Aprobada"
}
}En la propiedad source debe enviarse la información del medio de pago como se explica aqui.
{
"installmentCount": 1,
"source": {
"card": {
"number": "4507990000000010",
"month": 10,
"year": 25,
"identification": "12123123",
"name": "Demo Mobbex"
}
}
}