To make a GrabPay PayLater payment, you also need to collect and send additional information:
The delivery address
Information about the purchased items
API reference
Collecting and sending additional information is only needed for GrabPay PayLater payments. However, we highly recommend you do the same in your initial integration for GrabPay Wallet because it will help save development resources if you plan to enable GrabPay PayLater afterwards.
To make a GrabPay PayLater payment, either postpaid or installment, you need to send additional fields. Select which endpoint you're integrating:
This is the default with Web Components v5.0.0 or later.
// 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("SGD");
amount.setValue(15000L);
paymentsRequest.setAmount(amount);
DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();
paymentMethodDetails.setType("grabpay_SG");
paymentsRequest.setPaymentMethod(paymentMethodDetails);
paymentsRequest.setReference("YOUR_ORDER_NUMBER");
paymentsRequest.setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..");
Address deliveryAddress = new Address();
deliveryAddress.setCity("Singapore");
deliveryAddress.setCountry("SG");
deliveryAddress.setHouseNumberOrName("109");
deliveryAddress.setPostalCode("179097");
deliveryAddress.setStreet("North Bridge Road");
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.
var client = new Client ("YOUR_X-API-KEY", Environment.Test);
var checkout = new Checkout(client);
var amount = new Adyen.Model.Checkout.Amount("SGD", 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 = "https://your-company.com/checkout?shopperOrder=12xy..",
MerchantAccount = "YOUR_MERCHANT_ACCOUNT",
DeliveryAddress = new Adyen.Model.Checkout.Address
{
City = "Singapore",
Country = "SG",
HouseNumberOrName = "109",
PostalCode = "179097",
Street = "North Bridge Road"
},
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: "SGD",
value: 1000
},
paymentMethod: {
type: 'grabpay_SG'
},
reference: "YOUR_ORDER_NUMBER",
merchantAccount: config.merchantAccount,
returnUrl: "https://your-company.com/checkout?shopperOrder=12xy..",
deliveryAddress: {
city: "Singapore",
country: "SG",
houseNumberOrName: "109",
postalCode: "179097",
street: "North Bridge Road"
},
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);
Contact our Support Team to register for a GrabPay test wallet. You'll need to fill out a form and provide a phone number (local or international) and an email address. Note that the wallet will have a balance limit depending on the wallet regulations in each market.
In the simulator, log in to Grab with the phone number you registered, and specify the one-time password you receive on that phone number.
Check the status of the GrabPay test payments in your Customer Area > Transactions > Payments.