Skip to main content
dLocal is a global payments platform that helps you accept local payment methods and cards across emerging markets. GCash is the leading mobile wallet in the Philippines, offering digital payment services and financial solutions.

Setup

Please follow the common dLocal instructions to get set up with GCash. Next, make sure to enable GCash as a payment method on your configured account.

Features

  • Tokenization - Save payment methods for future recurring use
  • Delete tokens - Remove stored payment methods
  • Partial refunds - Refund a portion of the captured amount
  • Refunds - Full refund support
  • Settlement reporting - Access to settlement reports
  • Transaction sync - Automatic transaction status synchronization

Supported countries

dLocal supports transactions from buyers in PH.

Supported currencies

dLocal supports processing payments in PHP.

Limitations

  • Capture - Delayed capture is not supported
  • Void - Transaction void is not supported

Integration

For GCash, the default integration is through a redirect to a hosted payments page. Start by creating a new transaction with the following required fields.
var transaction = await client.Transactions.CreateAsync(
    transactionCreate: new TransactionCreate()
    {
        Amount = 1299,
        Currency = "PHP",
        Country = "PH",
        PaymentMethod =
            TransactionCreatePaymentMethod.CreateCheckoutSessionWithUrlPaymentMethodCreate(
                new RedirectPaymentMethodCreate()
                {
                    Method = "gcash",
                    RedirectUrl = "https://example.com/callback",
                }
            ),
    }
);
After the transaction is created, the API response includes payment_method.approval_url and the status is set to buyer_approval_pending. Redirect the buyer to the approval_url so they can complete 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).

Recurring transactions

Enrollment

To enroll a buyer in recurring transactions, create an initial transaction with tokenization enabled and pass the dlocal-gcash connection options.
  • Set store to true to save the payment method.
  • Set payment_source to recurring.
  • Pass connection_options.dlocal-gcash.wallet with recurring enrollment details.
  • Include wallet.username in connection options. dLocal expects this value for recurring enrollment.
For provider-side requirements for GCash recurring (dLocal RG), see dLocal — Philippines: GCash Recurring. Use one of the following SDK requests:
var transaction = await client.Transactions.CreateAsync(
    transactionCreate: new TransactionCreate()
    {
        Amount = 1299,
        Currency = "PHP",
        Country = "PH",
        PaymentMethod =
            TransactionCreatePaymentMethod.CreateCheckoutSessionWithUrlPaymentMethodCreate(
                new RedirectPaymentMethodCreate()
                {
                    Method = "gcash",
                    RedirectUrl = "https://example.com/callback",
                }
            ),
        Store = true,
        PaymentSource = TransactionCreate.PaymentSourceEnum.Recurring,
        ConnectionOptions = new Dictionary<string, object>()
        {
            ["dlocal-gcash"] = new Dictionary<string, object>()
            {
                ["wallet"] = new Dictionary<string, string>()
                {
                    ["username"] = "Jane2002",
                    ["email"] = "jane@example.com",
                    ["name"] = "Jane Doe"
                }
            }
        }
    }
);
After you create the enrollment transaction, redirect the buyer to the approval_url to complete enrollment. The payment method token can be finalized asynchronously after dLocal webhook processing, so rely on webhooks for the final token state.

Subsequent payment

After enrollment succeeds, create subsequent recurring charges with the saved payment method ID.
  • 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",
        PaymentMethod = TransactionCreatePaymentMethod.CreatePaymentMethodIdRequest(
            new PaymentMethodIdRequest()
            {
                Method = PaymentMethodIdRequest.MethodEnum.Id,
                Id = "f758d736-9a81-4bd0-85a9-2d3ee361b863"
            }
        ),
        IsSubsequentPayment = true,
        MerchantInitiated = true,
        PaymentSource = TransactionCreate.PaymentSourceEnum.Recurring,
    }
);

Connection options

You can pass wallet fields using the dLocal GCash connection options. The example below shows typical enrollment values for wallet:
  "connection_options": {
    "dlocal-gcash": {
      "wallet": {
        "username": "Jane2002",
        "email": "jane@example.com",
        "name": "Jane Doe"
      }
    }
  }
  • wallet.username - Wallet account username used for recurring enrollment. This should be provided for GCash recurring enrollment.
  • wallet.email - Wallet email passed through to dLocal.
  • wallet.name - Wallet account holder name passed through to dLocal.