Skip to main content

Receive a GCash payment

Learn how to receive a gcash payment from your customer.

The GCash payment method is when customers use their GCash account. To complete a GCash payment, your customer should select GCash as the payment method and complete the GCash verification step.

The GCash payment flow

At checkout, your customer can select GCash as the preferred payment method. Once your customer clicks the pay button, GCash will verify the transaction, and your customer must complete the verification step. GCash facilitates its verification step. PayRex facilitates the GCash transaction by rendering the payment page provided by GCash.

Low-code integration

PayRex offers a low-code solution that gives you more payment integration control.

  • Checkout: This lets you redirect your customers to a PayRex-hosted checkout page.
  • Elements: A UI component that you can embed into your website. When your customer is ready to complete a purchase, you create a PaymentIntent and configure how you want to display payment methods.

Receiving a GCash payment

To receive a GCash payment, you must specify that you allow a GCash payment when creating a payment intent. The example below is for payment intent workflow.

create_payment_intent.js
// Protect your PayRex Secret API key at all costs. One common approach
// to store it in an environment variable.
// Add your PayRex test secret API key.
const payrexSecretApiKey = '';

const payrex = require('payrex-node')(payrexSecretApiKey);

// Create a PaymentIntent with amount and currency
const paymentIntent = await payrex.paymentIntents.create({
// Amount is in cents. The sample below is 100.00.
amount: 10000,
currency: 'PHP',
payment_methods: [
'gcash',
// add more payment methods if this is your preference
],
});

const output = {
clientSecret: paymentIntent.clientSecret,
}

console.log(JSON.stringify(output));

Once you specify the gcash string, PayRex will handle the rest of your customer's payment flow.

Upcoming changes with GCash Authentication

warning

PayRex has an ongoing initiative to transition to the new authentication of GCash. Existing and new PayRex merchants should apply the relevant code changes. If you don't implement the necessary code changes, your customer's payment experience for gcash payment method in mobile will not proceed once the new authentication is deployed by GCash.

If you have integrated gcash payment method in a mobile app, you must apply some code changes in your app to handle the authentication of GCash. GCash dynamically adjusts their UI if your customer is paying through mobile or desktop.

For customers who pay through a desktop, GCash displays a QR code that your customer can scan using the GCash app.

For customers who pay through mobile (either via a native mobile app or mobile web), no QR code will be displayed. Your customer should click the "Open app" button provided by GCash. The "Open app" button contains a deep link, and your mobile app should handle the deep link behavior.

For Android

Android GCash Changes

For IOS

IOS GCash Changes