Configure GCash via Adyen as a payment method in Gr4vy.
Adyen is a global payment technology company founded in 2006 in Amsterdam, Netherlands. The company provides a single platform for accepting payments across online, mobile, and in-store channels for major enterprises worldwide including Uber, Spotify, and Microsoft.GCash is the leading mobile wallet in the Philippines. It allows buyers to pay using their GCash account balance, linked bank cards, and other funding sources. GCash supports one-time payments and recurring billing through its tokenization scheme.
Redirect the buyer to the approval_url so they can complete authentication and approve the payment. After approval the buyer is redirected to the redirect_url you provided when creating the transaction. Do not rely solely on the redirect - either poll the transaction or (recommended) rely on webhooks to detect the final status (for example capture_succeeded or failure states).
Adyen provides web, Android and iOS SDKs for a direct integration. For these flows you should indicate the platform by setting an appropriate integration_client when creating the transaction, and then build a client-side integration that uses the POST /transactions/:transaction_id/session API to initialize the Adyen SDK.To start, create a new transaction with the appropriate integration_client.
var transaction = await client.Transactions.CreateAsync( transactionCreate: new TransactionCreate() { Amount = 1299, Currency = "PHP", Country = "PH", Intent = "capture", IntegrationClient = "ios", PaymentMethod = TransactionCreatePaymentMethod.CreateRedirectPaymentMethodCreate( new RedirectPaymentMethodCreate() { Method = "gcash", Country = "PH", Currency = "PHP", RedirectUrl = "yourapp://callback", } ), });
For mobile, set integration_client to ios or android and use your app deep link for redirect_url (for example, yourapp://).After the transaction is created, the API response includes a session_token which can be used to get the session data for that transaction.
POST /transactions/:transaction_id/session?token=:session_token
RecommendedOn mobile integrations, after the buyer completes the payment flow, the Adyen SDK provides the developer with an onFinished call, which includes a statusCode.The system automatically syncs the status through webhooks, but to complete the transaction it is also recommended sending a GET request to the default_completion_url provided in the session response with the sessionId and the sessionResult as query parameters to finalize the transaction. This also moves the transaction to a completed status without waiting for the webhook to be sent.The call returns a 204 No Content response. After receiving this response, you can also optionally fetch the transaction to confirm final status.
func didComplete(with result: AdyenSessionResult, component: Component, session: AdyenSession){ var urlComponents = URLComponents(string: defaultCompletionUrl)! urlComponents.queryItems = [ URLQueryItem(name: "sessionId", value: session.session.id), URLQueryItem(name: "sessionResult", value: result.sessionResult) ] var request = URLRequest(url: urlComponents.url!) request.httpMethod = "GET" let task = URLSession.shared.dataTask(with: request) { data, response, error in // Handle 204 response, you can now poll the transaction } task.resume()}
override fun onFinished(result: SessionPaymentResult) { val sessionResult = result.sessionResult val uri = Uri.parse(defaultCompletionUrl) .buildUpon() .appendQueryParameter("sessionId", result.sessionId) .appendQueryParameter("sessionResult", sessionResult) .build() val url = URL(uri.toString()) val urlConnection = url.openConnection() as HttpURLConnection urlConnection.requestMethod = "GET" val responseCode = urlConnection.responseCode if (responseCode == HttpURLConnection.HTTP_NO_CONTENT) { // Handle 204 response, you can now poll the transaction }}
Please refer to the Adyen documentation for the web, Android and iOS for further guidance.
The Adyen GCash connector supports tokenized recurring payments. After a buyer authorizes the initial payment and their GCash wallet is stored, subsequent merchant-initiated charges are sent directly to Adyen using the stored payment method — no second redirect is required.
Redirect the buyer to the approval_url to complete the GCash authorization flow. After the buyer approves, Adyen delivers the stored payment method token through a recurring.token.created webhook. Rely on webhooks rather than the redirect to confirm that the token is ready for subsequent charges.
To enroll a buyer without charging them — for example, when starting a free trial — send the enrollment request above with amount set to 0 and store set to true.The buyer still completes the GCash approval flow and authorizes the auto-debit agreement, but no funds are taken. The stored payment method arrives through the same recurring.token.created webhook, and subsequent charges work exactly as described below.
Zero-amount transactions are not enabled by default on Adyen accounts. Ask your Adyen contact to enable them for GCash on your merchant account before using this flow. Adyen refers to this as zero-value auth.Until it is enabled, Adyen does not return gcash as an available payment method for a zero amount, so the approval flow never starts and the buyer sees an error. To confirm it is active, call Adyen’s /paymentMethods endpoint with amount.value set to 0 and amount.currency set to PHP, then check that gcash is in the response.
A zero amount can also be sent without store when you only need the buyer to confirm their GCash account, without charging or storing it.This is not a card-style zero-amount verification. The buyer is present and approves through GCash either way.GCash is capture-only, so there is no separate authorization step to void afterwards. A zero amount is the only way to complete a GCash transaction without taking funds.
After the payment method is stored, create each recurring charge using the saved payment method ID. Gr4vy routes the charge directly to Adyen without requiring a buyer redirect.
Set payment_method.method to id and pass the saved payment method ID.
Set payment_source to recurring.
Set merchant_initiated and is_subsequent_payment to true.
var transaction = await client.Transactions.CreateAsync( transactionCreate: new TransactionCreate() { Amount = 1299, Currency = "PHP", Country = "PH", Intent = "capture", PaymentMethod = TransactionCreatePaymentMethod.CreateTokenPaymentMethodCreate( new TokenPaymentMethodCreate() { Id = "f758d736-9a81-4bd0-85a9-2d3ee361b863" } ), IsSubsequentPayment = true, MerchantInitiated = true, PaymentSource = "recurring", });