curl https://checkout-test.adyen.com/v68/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"amount": {
"value": 1000,
"currency": ""
},
"reference": "YOUR_ORDER_NUMBER",
"paymentMethod": {
"type": "grabpay_SG"
},
"returnUrl": "",
"deliveryAddress": {
"city": "",
"country": "",
"houseNumberOrName": "",
"postalCode": "",
"street": ""
},
"lineItems":[
{
"quantity":"1",
"taxPercentage":"2100",
"description":"Shoes",
"id":"Item #1",
"amountIncludingTax":"400",
"productUrl": "URL_TO_PURCHASED_ITEM",
"imageUrl": "URL_TO_PICTURE_OF_PURCHASED_ITEM"
}
]
}'
# Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen::Client.new
adyen.api_key = "YOUR_X-API-KEY"
response = adyen.checkout.payments({
:amount => {
:currency => "",
:value => 1000
},
:reference => "YOUR_ORDER_NUMBER",
:paymentMethod => {
:type => "grabpay_SG"
},
:returnUrl => "",
:merchantAccount => "YOUR_MERCHANT_ACCOUNT",
:deliveryAddress => {
:city => "",
:country => "",
:houseNumberOrName => "",
:postalCode => "",
:street => ""
},
:lineItems => [
{
:quantity =>"1",
:taxPercentage =>"2100",
:description =>"Shoes",
:id =>"Item #1",
:amountIncludingTax =>"400",
:productUrl => "URL_TO_PURCHASED_ITEM",
:imageUrl => "URL_TO_PICTURE_OF_PURCHASED_ITEM"
}
]
})
// Set YOUR_X-API-KEY with the API key from the Customer Area.
// Change to Environment.LIVE and add the Live URL prefix when you're ready to accept live payments.
Client client = new Client("YOUR_X-API-KEY", Environment.TEST);
Checkout checkout = new Checkout(client);
PaymentsRequest paymentsRequest = new PaymentsRequest();
String merchantAccount = "YOUR_MERCHANT_ACCOUNT";
paymentsRequest.setMerchantAccount(merchantAccount);
Amount amount = new Amount();
amount.setCurrency("");
amount.setValue(15000L);
paymentsRequest.setAmount(amount);
DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();
paymentMethodDetails.setType("grabpay_SG");
paymentsRequest.setPaymentMethod(paymentMethodDetails);
paymentsRequest.setReference("YOUR_ORDER_NUMBER");
paymentsRequest.setReturnUrl("");
Address deliveryAddress = new Address();
deliveryAddress.setCity("");
deliveryAddress.setCountry("");
deliveryAddress.setHouseNumberOrName("");
deliveryAddress.setPostalCode("");
deliveryAddress.setStreet("");
List<LineItem> lineItems = new ArrayList<>();
lineItems.add(
new LineItem()
.quantity(1L)
.taxPercentage(2100L)
.description("Shoes")
.id("Item #1")
.amountIncludingTax(400L)
.productUrl("URL_TO_PURCHASED_ITEM")
.imageUrl("URL_TO_PICTURE_OF_PURCHASED_ITEM")
);
paymentsRequest.setLineItems(lineItems);
PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);
$params = array(
"amount" => array(
"currency" => "",
"value" => 1000
),
"reference" => "YOUR_ORDER_NUMBER",
"paymentMethod" => array(
"type" => "grabpay_SG"
),
"returnUrl" => "",
"merchantAccount" => "YOUR_MERCHANT_ACCOUNT",
"deliveryAddress" => [
"city" => "",
"country" => "",
"houseNumberOrName" => "",
"postalCode" => "",
"street" => ""
],
"lineItems" => [
[
"quantity" => "1",
"taxPercentage" => "2100",
"description" => "Shoes",
"id" => "Item #1",
"amountIncludingTax" => "400",
"productUrl" => "URL_TO_PURCHASED_ITEM",
"imageUrl" => "URL_TO_PICTURE_OF_PURCHASED_ITEM"
]
]
);
$result = $service->payments($params);
#Set your X-API-KEY with the API key from the Customer Area.
adyen = Adyen.Adyen()
adyen.client.xapikey = 'YOUR_X-API-KEY'
result = adyen.checkout.payments({
'amount': {
'value': 1000,
'currency': ''
},
'reference': 'YOUR_ORDER_NUMBER',
'paymentMethod': {
'type': 'grabpay_SG'
},
'returnUrl': 'https: //your-company.com/checkout?shopperOrder=12xy..',
'merchantAccount': 'YOUR_MERCHANT_ACCOUNT',
'deliveryAddress': {
'city': '',
'country': '',
'houseNumberOrName': '',
'postalCode': '',
'street': ''
},
'lineItems': [
{
'quantity': '1',
'taxPercentage': '2100',
'description': 'Shoes',
'id': 'Item #1',
'amountIncludingTax': '400',
'productUrl': 'URL_TO_PURCHASED_ITEM',
'imageUrl': 'URL_TO_PICTURE_OF_PURCHASED_ITEM'
}
]
})
// Set your X-API-KEY with the API key from the Customer Area.
var client = new Client ("YOUR_X-API-KEY", Environment.Test);
var checkout = new Checkout(client);
var amount = new Adyen.Model.Checkout.Amount("", 1000);
var details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{
Type = "grabpay_SG"
};
var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest
{
Reference = "YOUR_ORDER_NUMBER",
Amount = amount,
ReturnUrl = "",
MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
DeliveryAddress = new Adyen.Model.Checkout.Address
{
City = "",
Country = "",
HouseNumberOrName = "",
PostalCode = "",
Street = ""
},
LineItems = new List<LineItem>
{
new LineItem(quantity:1, taxPercentage:2100, description:"Shoes", id:"Item #1", amountIncludingTax:400, productUrl:"URL_TO_PURCHASED_ITEM", imageUrl:"URL_TO_PICTURE_OF_PURCHASED_ITEM"),
},
PaymentMethod = details
};
var paymentResponse = checkout.Payments(paymentsRequest);
// Set your X-API-KEY with the API key from the Customer Area.
const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
const config = new Config();
// Set your X-API-KEY with the API key from the Customer Area.
config.apiKey = '[API_KEY]';
config.merchantAccount = '[YOUR_MERCHANT_ACCOUNT]';
const client = new Client({ config });
client.setEnvironment("TEST");
const checkout = new CheckoutAPI(client);
checkout.payments({
amount: {
currency: "",
value: 1000
},
paymentMethod: {
type: 'grabpay_SG'
},
reference: "YOUR_ORDER_NUMBER",
merchantAccount: config.merchantAccount,
returnUrl: "",
deliveryAddress: {
city: "",
country: "",
houseNumberOrName: "",
postalCode: "",
street: ""
},
lineItems: [
{
quantity: "1",
taxPercentage: "2100",
description: "Shoes",
id: "Item #1",
amountIncludingTax: "400",
productUrl: "URL_TO_PURCHASED_ITEM",
imageUrl: "URL_TO_PICTURE_OF_PURCHASED_ITEM"
}
]
}).then(res => res);