- De monto fijo o de monto abierto.
- Con o sin fecha de vencimiento.
- De pago único o recurrente.
- Que los anteriores atributos se pueden combinar.
curl --location --request POST 'https://sb-api-pais-emisor.paycashglobal.com/v1/reference' \ #Es necesario reemplazar 'pais' por tu país en la URL
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"Amount":"",
"ExpirationDate":"",
"Value":"",
"Type":""
}'
//Este ejemplo requiere de la librería OkHttp para JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"Amount\":\"\",\r\n \"ExpirationDate\":\"\",\r\n \"Value\":\"\",\r\n \"Type\":\"\"\r\n}");
Request request = new Request.Builder()
.url("https://sb-api-pais-emisor.paycashglobal.com/v1/reference") //Es necesario reemplazar 'pais' por tu país en la URL
.method("POST", body)
.addHeader("Authorization", "")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.EmisorApi;
public class EmisorApiExample {
public static void main(String[] args) {
EmisorApi apiInstance = new EmisorApi();
String authorization = authorization_example; // String | Token to business partner , from PayCash Global.
BodyCreateRef body = ; // BodyCreateRef | por definir
try {
array[RespCreateRef] result = apiInstance.referenceCreate(authorization, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EmisorApi#referenceCreate");
e.printStackTrace();
}
}
}
//Este ejemplo requiere de la librería NSURLSession para Obj-C
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais-emisor.paycashglobal.com/v1/reference"] //Es necesario reemplazar 'pais' por tu país en la URL
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Authorization": @"",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\r\n \"Amount\":\"\",\r\n \"ExpirationDate\":\"\",\r\n \"Value\":\"\",\r\n \"Type\":\"\"\r\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
var myHeaders = new Headers();
myHeaders.append("Authorization", "");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"Amount": "",
"ExpirationDate": "",
"Value": "",
"Type": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://sb-api-pais-emisor.paycashglobal.com/v1/reference", requestOptions) //Es necesario reemplazar 'pais' por tu país en la URL
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
//Este ejemplo requiere de la librería RestSharp para C#
var client = new RestClient("https://sb-api-pais-emisor.paycashglobal.com/v1/reference"); //Es necesario reemplazar 'pais' por tu país en la URL
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""Amount"":"""",
" + "\n" +
@" ""ExpirationDate"":"""",
" + "\n" +
@" ""Value"":"""",
" + "\n" +
@" ""Type"":""""
" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//Este ejemplo requiere de la librería cURL para PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://sb-api-pais-emisor.paycashglobal.com/v1/reference', //Es necesario reemplazar 'pais' por tu país en la URL
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"Amount":"",
"ExpirationDate":"",
"Value":"",
"Type":""
}',
CURLOPT_HTTPHEADER => array(
'Authorization: ',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::EmisorApi;
my $api_instance = WWW::SwaggerClient::EmisorApi->new();
my $authorization = authorization_example; # String | Token to business partner , from PayCash Global.
my $body = WWW::SwaggerClient::Object::BodyCreateRef->new(); # BodyCreateRef | por definir
eval {
my $result = $api_instance->referenceCreate(authorization => $authorization, body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling EmisorApi->referenceCreate: $@\n";
}
#Este ejemplo requiere de la librería http.client para Python
import http.client
import json
conn = http.client.HTTPSConnection("sb-api-pais-emisor.paycashglobal.com") #Es necesario reemplazar 'pais' por tu país en la URL
payload = json.dumps({
"Amount": "",
"ExpirationDate": "",
"Value": "",
"Type": ""
})
headers = {
'Authorization': '',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/reference", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))