createPayment
Initiate Payments
Initiate Payments
/payments
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://api.payments.xft.com/payment/v2/payments"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.GlobalPaymentsApi;
import java.io.File;
import java.util.*;
public class GlobalPaymentsApiExample {
public static void main(String[] args) {
GlobalPaymentsApi apiInstance = new GlobalPaymentsApi();
Payment body = {
"$ref" : "#/components/examples/RealTimeUKFPS"
}; // Payment | Representation of a Payment Initiation Request
IdempotencyKey idempotencyKey = ; // IdempotencyKey | Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.**
RequestId requestId = ; // RequestId | Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis.
try {
PaymentInitiationResponse result = apiInstance.createPayment(body, idempotencyKey, requestId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GlobalPaymentsApi#createPayment");
e.printStackTrace();
}
}
}
import io.swagger.client.api.GlobalPaymentsApi;
public class GlobalPaymentsApiExample {
public static void main(String[] args) {
GlobalPaymentsApi apiInstance = new GlobalPaymentsApi();
Payment body = {
"$ref" : "#/components/examples/RealTimeUKFPS"
}; // Payment | Representation of a Payment Initiation Request
IdempotencyKey idempotencyKey = ; // IdempotencyKey | Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.**
RequestId requestId = ; // RequestId | Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis.
try {
PaymentInitiationResponse result = apiInstance.createPayment(body, idempotencyKey, requestId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling GlobalPaymentsApi#createPayment");
e.printStackTrace();
}
}
}
Payment *body = {
"$ref" : "#/components/examples/RealTimeUKFPS"
}; // Representation of a Payment Initiation Request
IdempotencyKey *idempotencyKey = ; // Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.** (optional)
RequestId *requestId = ; // Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis. (optional)
GlobalPaymentsApi *apiInstance = [[GlobalPaymentsApi alloc] init];
// Initiate Payments
[apiInstance createPaymentWith:body
idempotencyKey:idempotencyKey
requestId:requestId
completionHandler: ^(PaymentInitiationResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var XftGlobalPayments = require('xft_global_payments');
var api = new XftGlobalPayments.GlobalPaymentsApi()
var body = {
"$ref" : "#/components/examples/RealTimeUKFPS"
}; // {{Payment}} Representation of a Payment Initiation Request
var opts = {
'idempotencyKey': // {{IdempotencyKey}} Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.**
'requestId': // {{RequestId}} Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createPayment(body, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createPaymentExample
{
public void main()
{
var apiInstance = new GlobalPaymentsApi();
var body = new Payment(); // Payment | Representation of a Payment Initiation Request
var idempotencyKey = new IdempotencyKey(); // IdempotencyKey | Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.** (optional)
var requestId = new RequestId(); // RequestId | Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis. (optional)
try
{
// Initiate Payments
PaymentInitiationResponse result = apiInstance.createPayment(body, idempotencyKey, requestId);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling GlobalPaymentsApi.createPayment: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiGlobalPaymentsApi();
$body = {
"$ref" : "#/components/examples/RealTimeUKFPS"
}; // Payment | Representation of a Payment Initiation Request
$idempotencyKey = ; // IdempotencyKey | Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.**
$requestId = ; // RequestId | Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis.
try {
$result = $api_instance->createPayment($body, $idempotencyKey, $requestId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling GlobalPaymentsApi->createPayment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::GlobalPaymentsApi;
my $api_instance = WWW::SwaggerClient::GlobalPaymentsApi->new();
my $body = WWW::SwaggerClient::Object::Payment->new(); # Payment | Representation of a Payment Initiation Request
my $idempotencyKey = ; # IdempotencyKey | Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.**
my $requestId = ; # RequestId | Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis.
eval {
my $result = $api_instance->createPayment(body => $body, idempotencyKey => $idempotencyKey, requestId => $requestId);
print Dumper($result);
};
if ($@) {
warn "Exception when calling GlobalPaymentsApi->createPayment: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.GlobalPaymentsApi()
body = {
"$ref" : "#/components/examples/RealTimeUKFPS"
} # Payment | Representation of a Payment Initiation Request
idempotencyKey = # IdempotencyKey | Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.** (optional)
requestId = # RequestId | Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis. (optional)
try:
# Initiate Payments
api_response = api_instance.create_payment(body, idempotencyKey=idempotencyKey, requestId=requestId)
pprint(api_response)
except ApiException as e:
print("Exception when calling GlobalPaymentsApi->createPayment: %s\n" % e)
Parameters
Name | Description |
---|---|
Idempotency-Key |
IdempotencyKey
Client generated unique idempotency key used in recognizing consecutive retries of the same request
**Usage of V4 UUIDs is recommended.**
|
Request-Id |
RequestId
Client generated identifier for the current request invocation.
If provided, this identifier will be included in error responses to assist in problem diagnosis.
|
Name | Description |
---|---|
body * |