🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Xendit Payment Setup Guide

Updated 8 min read Gravity Forms Payments & Pricing
On this page
  1. How Xendit Checkout Works With Your Form
  2. Step 1: Install and License the Add-on
  3. Step 2: Connect Your Xendit Account
  4. Test and Live mode
  5. Business country and currency
  6. Add your secret key and webhook token
  7. Step 3: Set Up Webhooks in Xendit
  8. Step 4: Build the Payment Form
  9. Step 5: Create the Xendit Feed
  10. Managing Payments From the Entry Screen
  11. Test in Sandbox Before Going Live
  12. Developer Filter: Customize the Checkout Session
  13. Troubleshooting & FAQ
  14. Saving the settings says Xendit rejected the secret key.
  15. Customers see “Online payment is not available in …”.
  16. Customers see “We could not start the online payment”.
  17. Entries stay on Processing after the customer paid.
  18. Resource Hub

Customers in Southeast Asia expect to pay by card, e-wallet, bank transfer or QR code. The Gravity Forms Xendit Payment Premium Add-on connects any Gravity Forms order, booking or membership form to Xendit’s hosted checkout. The customer submits the form, pays on Xendit’s secure page and returns to your confirmation message. One-time payments, subscriptions and refunds are all handled from Gravity Forms.

System Requirements & Prerequisites

  • WordPress: Version 6.5 or higher
  • PHP: Version 7.4 or higher
  • Gravity Forms: Version 2.5 or higher
  • Xendit account: a Xendit business account in Indonesia, the Philippines, Vietnam, Thailand, Malaysia or Singapore. Test Mode is available as soon as you sign up; Live Mode needs Xendit’s business verification.
  • Currency: a Gravity Forms currency that Xendit accepts for your business country (see the table below)
  • Website: a public HTTPS site. Xendit only returns customers to HTTPS addresses and needs to reach your webhook URL.
  • GravityExtra license: the Xendit add-on installed, activated and licensed

How Xendit Checkout Works With Your Form

There is no card field to add and no payment script on your site. On submit, the add-on creates a Xendit checkout session and sends the customer to Xendit’s hosted page. Card numbers, e-wallet logins and bank details are entered there, so they never reach WordPress or your entries.

  • Amounts are calculated on your server from the form’s pricing fields, never from values in the browser.
  • The payment is checked with Xendit when the customer returns and when a webhook arrives. The add-on reads the session from Xendit and marks the entry Paid only if the amount and currency match.
  • Expired or cancelled checkouts set the entry to Failed or Cancelled, and the customer is told they have not been charged.

Step 1: Install and License the Add-on

  1. Go to Plugins → Add New → Upload Plugin, upload the add-on ZIP file and click Activate.
  2. Open Forms → Settings → Xendit.
  3. Enter your license key in the Gravity Extra License section and save. The Xendit settings appear once the license is active.

Step 2: Connect Your Xendit Account

Test and Live mode

Test (sandbox) is the default, and a new installation stays in Test mode until you choose Live. In Test mode the settings page shows a yellow “Sandbox mode” notice, payments use your Xendit Test Mode keys and no real money is charged. Entries paid in Test mode carry a “Sandbox mode — test payment” badge on the entry screen.

Business country and currency

Choose your Business country, the country of your Xendit account. It decides which currencies the add-on accepts. Then set the same currency under Forms → Settings → Currency. Gravity Forms has no Indonesian rupiah or Vietnamese dong by default, so the add-on adds both as whole-number currencies.

Business country Form currency
Indonesia IDR
Philippines PHP or USD
Vietnam VND
Thailand THB
Malaysia MYR
Singapore SGD or USD

If the form currency does not fit the country, the settings page and the feed editor show a clear message, and customers see “Online payment is not available” on the form instead of a gateway error. IDR and VND totals must be whole numbers. The mapping follows Xendit’s card currency rules; confirm other channels, and USD in Singapore, with Xendit before going live.

Add your secret key and webhook token

In the Xendit Dashboard go to Settings → Developers → API Keys and generate a secret key with Write access to Payment Sessions, Refunds and Subscriptions. Then open Settings → Webhooks and click View Webhook Verification Token. Paste both into the Test fields (or the Live fields for your live account) and click Save Settings. Both are stored in masked fields.

Saving checks the key with Xendit. A rejected key is not saved, and a live key pasted into a Test field (or the reverse) is refused. A working key shows Connected to Xendit (Test mode) or (Live mode).

Xendit account settings in Gravity Forms in Sandbox mode with Philippines as business country, PHP currency accepted, masked test secret key and token, Connected to Xendit (Test mode) and the webhook URL
Forms → Settings → Xendit in Test mode, connected, with the webhook URL to copy.

Step 3: Set Up Webhooks in Xendit

Webhooks confirm payments, refunds and renewals, even if the customer never returns to your site. Copy the Webhook URL from the settings page (your site address followed by /?callback=gfxenditaddon). In the Xendit Dashboard go to Settings → Webhooks and paste it for Payment Session, Refund and Subscription events. Do this once in Test Mode and again in Live Mode.

Every webhook must carry your verification token in the x-callback-token header; requests without the right token are rejected. The add-on then reads the session, plan or cycle again from Xendit, so the amounts it records always come from Xendit.

Test and live tokens are different. After switching to Live, save the Live token and register the URL in Live Mode too.

Step 4: Build the Payment Form

Use standard Gravity Forms pricing fields: one or more Product fields, optional Option or Shipping fields and a Total field. Add Name, Email and Phone fields for the customer details Xendit receives. Ask for the phone number in international format (for example +63 917 …). If you also accept offline payment, add a “Payment method” choice.

Gravity Forms booking form for a barista workshop with workshop seat and brew kit products, a PHP total, customer name, email and mobile number, and Pay online selected as the payment method
A booking form with products and a total. There is no card field: payment happens on Xendit.

Step 5: Create the Xendit Feed

Open the form, go to Settings → Xendit and click Add New. Choose the Transaction Type:

  • Products and Services takes a one-time payment. Set Payment Amount to Form Total or a single product field.
  • Subscription creates a Xendit recurring plan. Choose the Recurring Amount, the Billing Cycle (days, weeks, months or years; yearly is sent to Xendit as every 12 months) and Recurring Times (or infinite). The customer links a card or e-wallet on Xendit’s page and Xendit charges each cycle. Setup fees and trials are not available, and your account needs a channel that supports recurring charges, such as cards.
Xendit feed with Subscription transaction type, Form Total recurring amount, a 1 month billing cycle and infinite recurring times
A monthly membership feed: Xendit runs the recurring plan.

Under Billing Information, map first name, last name, phone and email; they are sent to Xendit as the customer. Under Conditional Logic, process the feed only when the customer chooses to pay online. Keep Send form notifications only after Xendit confirms the payment switched on (the default) so your team is not notified about checkouts that were never paid.

Xendit feed billing information mapped to name, mobile number and email, conditional logic Payment method is Pay online, and notifications held until Xendit confirms the payment
Customer details for Xendit, a payment-method condition and delayed notifications.

Managing Payments From the Entry Screen

Each Xendit entry has a Xendit box with the status, the session, payment request and payment IDs (or the recurring plan ID for subscriptions), the amount and the refunded total, plus a link to your Xendit dashboard. Users who can edit entries get these actions, each with a confirmation prompt:

  • Refund a full or partial amount of a paid one-time payment. The field is pre-filled with the refundable amount and you cannot refund more than was paid. A partial refund sets the status to Partially Refunded. Some channels, for example many bank transfers and QR payments, cannot be refunded through Xendit; the error is shown on the entry.
  • Refresh status from Xendit reads the payment again.
  • Cancel Subscription (the standard Gravity Forms button) deactivates the recurring plan at Xendit and sets the entry to Cancelled.
Xendit box on a paid Gravity Forms entry after a PHP 1,200.00 partial refund, showing Partially Refunded status, payment IDs and the remaining refundable amount
One-time payment: brew kit refunded.
Xendit box on an active subscription entry with the recurring plan ID and PHP 890.00 amount per cycle
Subscription: active recurring plan.

Each renewal Xendit collects is added as a subscription payment, failed renewals are recorded, and every change is written to the entry notes.

Test in Sandbox Before Going Live

Xendit Test Mode is free and opens as soon as you sign up:

  1. Sign up at dashboard.xendit.co/register with your business email and choose your business country. The account opens in Test Mode with virtual funds.
  2. Keep the Test Mode toggle on, open Settings → Developers → API Keys and generate a secret key with Write access to Payment Sessions, Refunds and Subscriptions. Copy it; it is shown once.
  3. Open Settings → Webhooks, click View Webhook Verification Token and copy the token. Paste your webhook URL there for Payment Session, Refund and Subscription events.
  4. In WordPress keep Test (sandbox), choose your business country, paste the key and token and save. Your test site must be public and use HTTPS.
  5. Place test payments: a successful card payment, a declined one, an e-wallet or bank transfer payment, a cancelled checkout, and a full and a partial refund. For a subscription form, check that the entry becomes Active.

Xendit lists its test cards and decline scenarios on the Simulate card scenarios page, for example Visa 4000 0000 0000 1000 for a frictionless successful payment, with any CVV and a future expiry date. Declines are simulated with specific amounts, and test numbers can differ by country, so check the page for your market. When everything works, finish Xendit’s business verification for Live Mode, paste your live key and token, register the webhook in Live Mode and switch the add-on to Live.

Developer Filter: Customize the Checkout Session

The gravityextra_xendit_session_payload filter changes the session request before it is sent to Xendit. It passes $payload, $feed, $entry and $form. Leave the amount and currency alone: the add-on compares Xendit’s amount with the entry and will not mark a mismatch as paid. This example gives form 3 a clearer description and adds a short campaign key to the metadata:

functions.php
PHP
// Clearer description and a campaign tag for Xendit sessions from form 3
add_filter( 'gravityextra_xendit_session_payload', function( $payload, $feed, $entry, $form ) {
    if ( (int) $form['id'] !== 3 ) {
        return $payload;
    }
    $payload['description'] = sprintf( 'Barista workshop booking #%d', $entry['id'] );
    $payload['metadata']['campaign'] = 'oct-workshops';
    return $payload;
}, 10, 4 );

To change which currencies are accepted for a business country, use the gravityextra_xendit_country_currencies filter.

Troubleshooting & FAQ

Saving the settings says Xendit rejected the secret key.

Check that the key belongs to the selected mode: Test Mode keys only work in Test mode and live keys only in Live mode. Generate the key again under Settings → Developers → API Keys in the matching mode of the Xendit Dashboard, with Write access to Payment Sessions, Refunds and Subscriptions, and save.

Customers see “Online payment is not available in …”.

The Gravity Forms currency does not match your business country. Change Forms → Settings → Currency to a currency from the table above, or change the business country on the Xendit settings page.

Customers see “We could not start the online payment”.

Xendit refused to create the checkout and the customer was not charged. The entry is marked Failed, and its note shows the HTTP status and Xendit’s error code, for example INVALID_AMOUNT.

Entries stay on Processing after the customer paid.

Check that the webhook URL is registered for Payment Session events in the current mode, that the matching verification token is saved and that the site is reachable over HTTPS. Refresh status from Xendit on the entry updates it immediately.

Resource Hub

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr