When requesting the payment of the PayCash reference, the method validates the following:
1.- The reference must exist.
2.- The reference must be current.
3.- The amount to be paid is greater than zero and less than that allowed by the establishment.
4.- In fixed-amount references, the amount must be the one specified in the reference.
5.- A single reference already paid cannot be paid again.
6.- The payment of a reference from an inactive issuer is not allowed.
7.- The commission charged to the end customer must correspond to what was agreed with the establishment.
8.- The payment sequence is not being paid more than 1 time at the same branch, on the same day.
curl --location --request POST 'https://sb-api-pais.paycashglobal.com/v1/cc/makepayment' \ #It is necessary to replace 'pais' with your country in the URL
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"Reference":"",
"Sequence":"",
"Branch":"",
"Amount":"",
"Commission":""
}'
//This example requires the OkHttp library for JAVA
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"Reference\":\"\",\r\n \"Sequence\":\"\",\r\n \"Branch\":\"\",\r\n \"Amount\":\"\",\r\n \"Commission\":\"\"\r\n}");
Request request = new Request.Builder()
.url("https://sb-api-pais.paycashglobal.com/v1/cc/makepayment") //It is necessary to replace 'pais' with your country in the URL
.method("POST", body)
.addHeader("Authorization", "")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
import io.swagger.client.api.CadenaCCApi;
public class CadenaCCApiExample {
public static void main(String[] args) {
CadenaCCApi apiInstance = new CadenaCCApi();
String authorization = authorization_example; // String | Token to business partner , from PayCash Global.
BodyMakePayment body = ; // BodyMakePayment |
try {
array[RespMakePayment] result = apiInstance.makePayment(authorization, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CadenaCCApi#makePayment");
e.printStackTrace();
}
}
}
//This example requires the NSURLSession library for Obj-C
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sb-api-pais.paycashglobal.com/v1/cc/makepayment"] //It is necessary to replace 'pais' with your country in the URL
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Authorization": @"",
@"Content-Type": @"application/json"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\r\n \"Reference\":\"\",\r\n \"Sequence\":\"\",\r\n \"Branch\":\"\",\r\n \"Amount\":\"\",\r\n \"Commission\":\"\"\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({
"Reference": "",
"Sequence": "",
"Branch": "",
"Amount": "",
"Commission": ""
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://sb-api-pais.paycashglobal.com/v1/cc/makepayment", requestOptions) //It is necessary to replace 'pais' with your country in the URL
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
//This example requires the RestSharp library for C#
var client = new RestClient("https://sb-api-pais.paycashglobal.com/v1/cc/makepayment"); //It is necessary to replace 'pais' with your country in the URL
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "");
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""Reference"":"""",
" + "\n" +
@" ""Sequence"":"""",
" + "\n" +
@" ""Branch"":"""",
" + "\n" +
@" ""Amount"":"""",
" + "\n" +
@" ""Commission"":""""
" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
//This example requires the cURL library for PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://sb-api-pais.paycashglobal.com/v1/cc/makepayment', //It is necessary to replace 'pais' with your country in the 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 =>'{
"Reference":"",
"Sequence":"",
"Branch":"",
"Amount":"",
"Commission":""
}',
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::CadenaCCApi;
my $api_instance = WWW::SwaggerClient::CadenaCCApi->new();
my $authorization = authorization_example; # String | Token to business partner , from PayCash Global.
my $body = WWW::SwaggerClient::Object::BodyMakePayment->new(); # BodyMakePayment |
eval {
my $result = $api_instance->makePayment(authorization => $authorization, body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CadenaCCApi->makePayment: $@\n";
}
#This example requires the http.client library for Python
import http.client
import json
conn = http.client.HTTPSConnection("sb-api-pais.paycashglobal.com") #It is necessary to replace 'pais' with your country in the URL
payload = json.dumps({
"Reference": "",
"Sequence": "",
"Branch": "",
"Amount": "",
"Commission": ""
})
headers = {
'Authorization': '',
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/cc/makepayment", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))