VibeFox Xendit for Adobe Commerce — Hilfe
Requirements
Magento: Magento Open Source or Adobe Commerce 2.4.6 to 2.4.9, on your own server or hosting, on premises or on Adobe Commerce on cloud infrastructure. The module does not work with Adobe Commerce as a Cloud Service (the SaaS edition), which does not accept PHP modules.
PHP: 8.1 to 8.4, with the cURL extension.
Order currency: IDR, PHP, VND, THB, MYR, USD or SGD. For other order currencies the payment method is not shown. Which payment channels and currencies are really available depends on your Xendit account.
Xendit account: you need a secret API key with write permission for Money-in (invoices) for test mode and another one for live mode, and the webhook verification token of each mode (see Configuration). Only the secret keys and the verification tokens are used. No public key is needed, because the customer pays on the Xendit hosted invoice page.
VibeFox license key: bought on vibefox.net. One key works on one domain.
Installation
The module is one ZIP file. It is a Composer package and can also be copied into app/code. Run the commands in the Magento root folder as the user that owns the Magento files.
1. With Composer: put the ZIP file into a folder that your project uses as a Composer "artifact" repository and run composer require vibefox/module-xendit-payment. Without Composer: unpack the ZIP file into app/code/Vibefox/XenditPayment/, so that registration.php is directly in that folder.
2. Run bin/magento module:enable Vibefox_XenditPayment and bin/magento setup:upgrade. In production mode also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy, then bin/magento cache:flush.
3. In the Admin go to Stores > Configuration > Sales > Payment Methods and open VibeFox Xendit Payment Gateway. When the Magento PayPal module is enabled, the group is listed under Other Payment Methods. Paste your VibeFox license key into License key in the license block, the first row of the group, and click Activate (see License key).
4. Paste your Xendit secret keys, set the webhook URL in the Xendit Dashboard and paste the verification tokens (see Configuration). Set Enable to Yes and click Save Config. Place a test order in test mode, then set Test mode to No to take real payments.
The module adds the Xendit payment method to the Magento checkout. It is off after installation (Enable = No). The module uses the standard Magento order states and creates no order statuses of its own. It creates two tables for the Xendit invoice attempts of orders.
Configuration
All settings are in Stores > Configuration > Sales > Payment Methods > VibeFox Xendit Payment Gateway, in the standard Magento configuration form. Like other Magento settings, they can be changed for a website with the Scope switcher at the top of the page; Title, Description and Invoice Description also for a store view. Delete data on uninstall is read from the Default Config only. Save Config saves the whole page.
If a value is wrong, Magento shows an error and nothing on the page is saved: an empty Title or a title longer than 128 characters shows Enter a payment method title from 1 to 128 characters.; a Sort order that is not a whole number shows Sort order must be a whole number.; a Minimum order total or Maximum order total that is not a number of 0 or greater shows Order total limits must be nonnegative numbers or empty. Use a dot as the decimal separator, for example 9.99.
While Enable is Yes, the row Connection and webhooks shows the state of the current mode: Enter the Test secret API key. or Enter the Live secret API key. when the key of the current mode is missing, The Test secret key must start with xnd_development_. or The Live secret key must start with xnd_production_. when it has the wrong prefix (in both cases Xendit is hidden at checkout), The current webhook verification token is empty. Notifications are rejected; payments can be verified when the customer returns. and the mode: TEST MODE: invoices use the Test key; no real money is charged. or LIVE MODE: invoices use the Live key and can charge real money.
General
Enable: shows or hides Xendit at checkout. It is shown only when the secret key of the current mode is set with the right prefix. Default: No.
Title: the payment method name customers see at checkout. It is also stored in the order when the order is placed, so later changes do not rename old orders. Default: Xendit. Required, 1 to 128 characters.
Description: the text shown under the payment method when the customer selects it at checkout. Default: Pay with virtual accounts, e-wallets, QR codes, retail outlets or cards via Xendit. It can be empty.
API keys
Create a secret API key with write permission for Money-in (invoices) in Xendit Dashboard > Settings > Developers > API keys, once in Test mode and once in Live mode. The key decides where the invoice is created.
Test mode: creates invoices with the Test secret key, so no real money is charged. Default: Yes. Set it to No to accept real payments with the Live secret key. While it is on, customers see Test mode — no real money is charged. under the payment method.
Test secret API key: the secret key of the Xendit Test mode. It must start with xnd_development_.
Live secret API key: the secret key of the Xendit Live mode. It must start with xnd_production_.
When you save, a key that does not start with the prefix of its field is not saved: the previous key stays and the page shows Test secret key was not saved: it must start with xnd_development_. Other valid settings were saved. (or the same for the Live key). The other settings are saved.
Webhook
The webhook tells your store that an invoice has been paid or has expired. The row Connection and webhooks shows the Webhook URL: the storefront address of the store view selected with the Scope switcher, in the Default Config that of the default store view. It looks like https://your-store/wcpxenditpaymentgateway/webhook/index. Copy the URL exactly as the settings show it. In Xendit Dashboard > Settings > Developers > Webhooks set it for Invoices > Invoice paid and Invoice expired, in Test mode and in Live mode. The page reminds you: Configure Invoice paid and Invoice expired in both Test and Live in the Xendit Dashboard. Callbacks require the original invoice mode token and are verified through the API.
Then copy the webhook verification token of each mode from the Xendit Dashboard into the matching field below. Xendit sends it in the x-callback-token header. Notifications without the token of the mode the invoice was created in are rejected; the token is read for the store view where the order was placed. The token only proves that the notification comes from Xendit: the invoice status, amount and currency are always read again from the Xendit API with the secret key of the mode the invoice was created in. Without the webhook, an order is confirmed only when the customer comes back to the store after paying.
Test webhook verification token: the x-callback-token of Xendit Test mode.
Live webhook verification token: the x-callback-token of Xendit Live mode.
Magento stores the keys and tokens encrypted and shows only a mask (******) after saving. Leave the mask as it is to keep the saved value, type a new value to change it. To delete a saved key or token, clear the field and click Save Config.
Payment
Invoice Description: the description shown on the Xendit invoice. You can use the placeholders {order_id} (the internal ID of the Magento order), {order_number} (the order number the customer sees, for example 000000123) and {site_name} (the name of the store view). HTML is removed and the text is cut to 255 characters. Default: Order #{order_id}.
Order status after payment: the order status set after Xendit confirms the payment. The note under the field says: Native Magento fulfillment rules apply. A physical unshipped order remains Processing.
Conditions
Payment from applicable countries: All Allowed Countries offers Xendit for every country your store allows, Specific Countries only for the countries below.
Payment from specific countries: offer Xendit only for these countries. The billing address and, for orders with shipping, also the shipping address must be in the list.
Minimum order total: offer Xendit only from this order total, in the base currency of your store. Empty or 0 means no minimum.
Maximum order total: offer Xendit only up to this order total, in the base currency. Empty or 0 means no maximum.
Sort order: the position among the payment methods at checkout. A whole number; negative values are allowed.
Advanced
Debug log: writes API requests and webhooks to var/log/xendit_p_debug.log.php in the Magento folder. The file cannot be opened from the web and is rotated at 5 MB. Errors and warnings are always recorded, even when this is off. Keys, tokens and customer e-mails are not logged. Default: No.
Log: shows the size and the last 50 KB of the log. Click Clear log to empty it.
Delete data on uninstall: when Yes, uninstalling the module with its data deletes the module settings and the log (see Uninstall). The license key is always removed. The Xendit invoice attempts of orders always stay. Default: No.
Checkout
Xendit is shown when the order currency is IDR, PHP, VND, THB, MYR, USD or SGD and the order total is above zero. At the payment step the customer chooses the payment method (by default Xendit) and sees the description and the note You will be redirected to Xendit to complete your payment. After Place Order, Magento places the order in Pending Payment. No invoice is created and no order e-mail is sent yet. The module then creates a Xendit invoice for the order total in the order currency and sends the customer to the Xendit invoice page. IDR and VND amounts are rounded to whole numbers, because Xendit does not accept decimals for them. The customer's e-mail is passed to Xendit. On the invoice page the customer pays with one of the payment channels activated in your Xendit account for this currency, for example a virtual account, an e-wallet, a QR code, a retail outlet or a card.
After paying, the customer returns to your store. The order is marked paid only after Xendit confirms it: by the webhook, or by a server-side request to the Xendit API when the customer comes back. Magento then creates the invoice with the Xendit invoice ID as the transaction ID, sets the status from Order status after payment and sends the order e-mail. The customer sees the standard order success page. If Xendit has not confirmed the payment yet, a Payment confirmation page shows Your payment has not been confirmed by Xendit yet. Please do not pay again while confirmation is pending. with the buttons Check again and Back to checkout. Check again asks Xendit again at most every ten seconds. The webhook confirms the order as soon as it arrives. A customer who comes back in another browser lands on the home page; the order is confirmed by the webhook.
If the invoice fails or expires, Xendit sends the customer back. The module first checks the invoice (it may have been paid in another tab), then expires it, so it can no longer be paid. The order is cancelled (the stock goes back), the cart is restored and the customer sees The Xendit payment was not completed. You can try again or choose another payment method. in the cart.
If the customer opens the payment again for the same order and the order total, currency and mode are unchanged and the open invoice is still valid for at least five more minutes, the customer is sent to the same invoice. Otherwise the old invoice is expired first and a new one is created, so there are never two open invoices for one cart. If the old invoice was already paid, that payment is confirmed instead of a new one. If the cart was already paid with another order, no new invoice is created and the customer sees A payment for this quote has already been received or requires review. Please do not pay again.
If Xendit rejects the payment, or the request cannot be sent at all, the order is cancelled, the cart is restored and the customer sees a short message in the cart: Xendit does not accept this currency for your account. Please choose another payment method., The order total is outside the amount limits of Xendit. Please choose another payment method. or Xendit could not create the payment. Please check your billing details or choose another payment method. When the request cannot be sent, the message is This payment method is temporarily unavailable. Please choose another payment method. The technical reason is written to the log. If Xendit cannot be reached or does not answer, the module cannot know whether the invoice was created. It does not create a second one: the order stays in Pending Payment, and the customer sees The Xendit payment requires confirmation or manual review. Please do not pay again; contact the store if this continues. If the invoice was created and paid, the webhook still confirms the order. Such an order can be cancelled like any other; if its invoice is paid later, the order is not reopened and a note asks you to reconcile or refund the payment in the Xendit Dashboard.
When an order in Pending Payment is cancelled in Magento, by you or by the Magento cron after the Pending Payment Order Lifetime (Stores > Configuration > Sales > Sales > Orders Cron Settings), its open Xendit invoices are expired with the secret key of the mode they were created in and can no longer be paid. If Xendit does not confirm the expiry, a cancellation in the Admin is refused with a message, for example Xendit is temporarily unavailable. The previous invoice was retained; please try again later. When the Magento cron cancels expired orders, such an order stays in Pending Payment with the note Xendit invoice … could not be expired — expire it in the Xendit dashboard. The order was not cancelled., and the cron goes on with the other orders; it tries again on a later run. If the invoice turns out to be paid, the payment is confirmed instead.
The payment always happens on the Xendit page. The module works with the standard Magento checkout. It has no online refunds, no saved cards, subscriptions or recurring payments, no card or e-wallet fields on the checkout page, no separate authorize and capture, and no xenPlatform sub-accounts. Xendit is not offered for orders created in the Admin.
Orders and refunds
Order statuses
Pending Payment: the order was placed and the customer was sent to Xendit, but Xendit has not confirmed the payment yet. There is no invoice.
Processing or Complete: the payment was confirmed. The status follows Order status after payment. The invoice is created with the Xendit invoice ID as the transaction ID, and a note shows the invoice ID, the paid amount, the payment channel, the mode and how it was confirmed (webhook, return or checkout).
On Hold after a mismatch: the paid invoice did not match the order total or currency, or less than the total was paid. No invoice is created. The note shows the reported amount and the amount expected. Check the payment in the Xendit Dashboard, then fulfil the order or refund the payment there. If another invoice of the same order is later paid with the right amount, the payment is recorded and the order leaves On Hold.
Canceled: the customer cancelled or did not complete the payment, Xendit rejected the payment, the invoice expired, or the order was cancelled in Magento.
If an invoice is paid for an order that is already cancelled or refunded, the order is not reopened. A note asks you to reconcile or refund the payment in the Xendit Dashboard. If a second invoice is paid for an order that is already paid, or the cart was already paid with another order, the order is not changed and a note asks you to refund the duplicate in the Xendit Dashboard. The notes are order comments that the customer does not see.
Xendit payment information
On the admin order page (Sales > Orders > View) the payment information shows the payment method title and one row Xendit invoice attempt with its number for every Xendit invoice of the cart: invoice ID, external ID, mode, status, Xendit status, amount, paid amount and payment channel. The row Refunds reminds you how to refund. The customer sees only the payment method title.
Refunds
Refunds are not sent to Xendit from Magento. Refund the payment in the Xendit Dashboard (search for the invoice ID shown in the payment information), then open the order in Magento, click Credit Memo and choose Refund Offline to record it. The credit memo does not send money back. A full refund closes the order (Closed).
License key
The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Xendit Payment Gateway is the first row of the VibeFox Xendit Payment Gateway group in Stores > Configuration > Sales > Payment Methods, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this store. Below them are the line Product: magento-payment-xendit and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only Admin users whose role allows the Payment Methods configuration section can change the key. The texts of the block follow the Admin interface locale (English and Russian are included).
If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the store address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the module keeps working on the last known status.
One key works on one domain: the domain of the default store view, also when the installation has several websites or stores. Removing the key from the store does not free its domain slot. Free the slot in your vibefox.net account.
Without an active key, Xendit is not shown to customers at checkout. If a payment is started anyway, the order is cancelled, the cart is restored and the customer sees This payment method is not available. Please choose another one. The Magento storefront does not know that you are logged in to the Admin, so the payment method is hidden for you too: you can set up the module before you buy a key, but not test it at checkout. A reminder appears in the System Messages of the Admin, with the links Enter the license key and Dismiss, which hides it for 7 days. Existing orders are not affected: payments already started are still confirmed.
When a license expires, the module keeps working, but updates and support need a renewal. The status is checked again automatically: once a day for the first 14 days after the key is entered, then once a week, by the Magento cron and while you work in the Admin. Uninstalling the module with its data always removes the license key and license status.
Troubleshooting
Xendit does not appear at checkout: check that the license is active and Enable is Yes for the website of the store, and that the current mode has a secret key with the right prefix: Test secret API key with xnd_development_ in test mode, Live secret API key with xnd_production_ in live mode. The row Connection and webhooks shows a warning when the key is missing or wrong. Check that the order currency is IDR, PHP, VND, THB, MYR, USD or SGD, Payment from applicable countries and Payment from specific countries against the customer's addresses, and Minimum order total and Maximum order total.
The payment went through, but the order stays Pending Payment: the webhook is not working. In the Xendit Dashboard of the mode you use (test or live) check that the URL shown in Webhook URL is set for Invoice paid, and that the verification token of that mode is saved in the matching field for the store view of the order. The Xendit Dashboard shows the answer of your store for each webhook. The order is also confirmed when the customer returns to the store after paying.
Webhook answers Webhook verification token is not configured: neither verification token is set. Paste the token into the settings.
Webhook answers Unauthorized: the token sent by Xendit does not match any token in the settings. Copy the token of the right mode again.
Webhook answers Token does not match the mode of this invoice: the invoice was created in the other mode, or the token is saved for another store view than the order's. A test notification never confirms a live payment and the other way round.
Webhook answers Ignored: not an invoice of this store: the invoice was not created by this store, for example by another integration on the same Xendit account. The Test button of the Xendit Dashboard also gets this answer, which confirms that the URL and the token work. Ignored: unknown order and Ignored: unknown invoice mean that the order or the invoice is not known to this store.
Webhook answers Temporary error: the Xendit API could not be reached to check the invoice, the secret key of the invoice's mode is missing, or the order was being updated by another request at the same moment. Xendit retries the webhook. Check that both secret keys are set if payments were started in both modes, and turn on Debug log to see the reason.
The webhook URL shows Method not allowed in the browser: this is normal. The URL accepts only requests from Xendit.
Webhooks fail while the store is in maintenance mode: Magento maintenance mode closes the whole site, the webhook URL too. Xendit retries the webhook later, and the order is also confirmed when the customer returns.
A key is not saved: the value does not start with the prefix of its field. Test keys start with xnd_development_, live keys with xnd_production_.
The customer is back in the cart with an error after Place Order: Xendit rejected the request, for example because the secret key lacks write permission for Money-in (invoices), the currency is not activated for your account or the total is outside the Xendit limits. Turn on Debug log and look at the Log field. The order of that attempt is cancelled.
The customer sees The Xendit payment requires confirmation or manual review: Xendit did not answer when the invoice was created, or a payment of this cart needs review. Check the payment in the Xendit Dashboard, the order notes and the log.
An order cannot be cancelled, or a Pending Payment order has the note could not be expired: the module must expire its open Xendit invoice first. When the message says that Xendit is temporarily unavailable or that the original API key is required, check that the secret key of the mode the invoice was created in is set, and try again later. Or expire the invoice in the Xendit Dashboard; the invoice expired webhook then cancels the order.
Order is On Hold after payment: read the order notes (see Order statuses), then fulfil the order or refund the payment in the Xendit Dashboard.
There is no Refund button on the credit memo: this is normal. The module has no online refunds. Refund in the Xendit Dashboard and record the refund with Refund Offline.
The settings page or the checkout looks unchanged after installing or updating: run bin/magento setup:upgrade and bin/magento cache:flush; in production mode also setup:di:compile and setup:static-content:deploy.
For developers, the module dispatches the events xendit_p_invoice_request, xendit_p_supported_currencies and xendit_p_currency_decimals to change the invoice request, the list of currencies and the number of decimals per currency.
Uninstall
Deleting the module code alone removes nothing from the database: the license key and the settings stay. To remove the data, uninstall the module with the Magento command:
Installed with Composer: run bin/magento module:uninstall --remove-data Vibefox_XenditPayment. It removes the data and the code.
Installed in app/code: run bin/magento module:uninstall --non-composer Vibefox_XenditPayment to remove the data, then bin/magento module:disable Vibefox_XenditPayment, delete the folder app/code/Vibefox/XenditPayment and run bin/magento setup:upgrade.
The license key and license status are always removed. If Delete data on uninstall is Yes, the module settings and the log are removed too. If it is No, the settings are kept for a re-install. The Xendit invoice attempts of orders are always kept. Existing orders keep their invoices, payment notes and transaction IDs.
Xendit is a trademark of its respective owner. This module is not affiliated with or endorsed by Xendit.
