Hands-on Steps for WooCommerce Integration with Philippine Payments
Hands-on Steps for WooCommerce Integration with Philippine Payments: A Comprehensive Guide
Why WooCommerce Merchants Need to Integrate Local Payment Methods in the Philippines
With e-commerce booming, providing localised payment solutions to Filipino customers has become a key strategy to boost conversions. As one of the fastest growing digital economies in Southeast Asia, the Philippines has unique payment habits and preferences. Data shows that more than 60% of Filipino online shoppers prefer local payment methods over international credit cards.
For merchants using WooCommerce to set up their online shops, integrating with the leading e-wallets and bank transfer options in the Philippines such as Gcash, PayMaya, Dragonpay, etc. can significantly reduce shopping cart abandonment rates. These local payment solutions are not only easy to use and have lower processing fees, but they also solve the problem of some consumers not having international credit cards.
From a technical perspective, WooCommerce's high level of scalability makes it the ideal platform for accessing multiple payment methods. With the right plugins and API integrations, merchants can seamlessly add new payment channels without changing the existing site architecture.
Preparation: Opening a Merchant Account and Obtaining API Credentials
The first step to successfully integrating payment methods in the Philippines is choosing the right payment service provider (PSP). Depending on the size of your business and your target customer base, you may need to consider the following factors: transaction rates, settlement cycle time, supported countries/regions, and quality of technical support.
Registering and verifying your merchant account is an essential part of the process. Take GCash for example:
- Visit the GCash Business Solutions website and click "Apply Now".
- Fill in the company information form (including a copy of the business licence)
- Submission of director/shareholder identification documents
- Waiting for 1-3 working days review period
- Receive a welcome email with Merchant ID and API key
Similarly, if you plan to access other gateways such as Dragonpay or PayMaya you will need to complete a similar KYC process. It is recommended to apply for accounts on 2-3 major platforms at the same time to ensure that the majority of your user base is covered.
Important Notes: Keep your API credentials (usually Merchant ID, Secret Key and sometimes cryptographic salts) in a safe place. This sensitive information should be stored in a secure location and should not be written directly into the code.
WooCommerce Backend Configuration Basic Settings
Login to the WordPress admin panel and start configuring the core parameters:
-
Enabling PHP extensions: Ensure that the server has the cURL and OpenSSL modules installed
php -m | grep -E 'curl|openssl'
If these two modules are not shown you need to contact your hosting provider to install them.
-
Updating the permalink structure(Settings > Permanent Links):
Choose "Article Name" or "Numeric", which affects the validity of the callback URL. -
Currency and regional settings::
- WooCommerce > Settings > General
- Currency: Philippine Peso (₱)
- Currency position: Left (₱99)
- Thousand separator: ,
- Decimal separator: .
-
Tax allocation(if applicable):
Correctly set up 12% VAT rules based on item type
GCash Access Detailed Tutorial - Most Popular Filipino E-Wallet
A) GCash official plugin installation method
1. Navigate to "Plugins" > "Install Plugin" in the WordPress dashboard.
2. Search for "GCash for WooCommerce" (Developed by Globe Fintech Innovations)
3. Click Install Now to activate
4. Find the GCash option in WooCommerce > Settings > Payments
B) API Manual Integration Solution
This method can be used if there is no official plugin available:
// Add a custom payment gateway class to functions.php.
add_filter('woocommerce_payment_gateways', 'add_gcash_gateway');
function add_gcash_gateway($gateways){
$gateways[] = 'WC_Gateway_GCASH';
return $gateways.
}
class WC_Gateway_GCASH extends WC_Payment_Gateway {
public function __construct() {
$this->id = 'gcash';
// ... Initialise the other parameters...
// API endpoint configuration (sandbox/production environment)
$this->init_form_fields();
$this->init_settings();
add_action('woocommerce_update_options_payment...' , [$this,'process_admin_options']).
}
}
Description of key parameters.
api_url
: https://gpi.gcash.com/pay/v2/create (production environment)redirect_url
: https://yourdomain.com/gcash-callback/merchant_id
: 8-digit alphanumeric combinations received by Gmail registered mailboxes
C) Webhook callback handling
Create custom endpoints to receive notifications of transaction status.
// register REST API route for callbacks
add_action('rest_api_init', function(){
register_rest_route('gcash/v1','/notify', [
'methods' => WP_REST_Server::CREATABLE,
'callback' => 'handle_gcash_notification',
]);
});
function handle_gcash_notification(WP_REST_Request $request){
// verify HMAC-SHA256 signature first!
if(!verify_signature($request)) wp_send_json_error(null,403);
// update order status based on payment_status parameter
}
Test Tool Recommendations.
- Postman simulates a callback request
- Ngrok exposes local development environment to public network
Due to space constraints it is not possible to show full code examples and technical details...
[Continue reading the next chapter to learn how to integrate more Filipino-specific payment methods and advanced optimisation tips]
Dragonpay Payment Gateway Integration Guide - Covering Bank Transfers and Offline Channels
1. Register for a Dragonpay Merchant Account
Philippines-specific Dragonpay support is included:
- Internet banking (20+ BDO, BPI, etc.)
- Convenience store cash payments (7-Eleven, MLhuillier)
- ATM Counter Deposit
Account Opening Process::
- Visit dragonpay.ph and click on "Merchant Sign Up".
- Submission of company registration documents (SEC/DTI)
- Setting up a settlement account (local bank account in the Philippines is recommended)
- API permissions are obtained after the application is approved:
- Merchant ID (6 digits)
- Secret Key (32 character hash)
2. WooCommerce plug-in configuration method
We recommend using the officially certified "Dragonpay Payment Gateway" plugin:
// wp-config.php add constant definition (optional)
define('DRAGONPAY_MODE', 'production'); // sandbox|production
define('DRAGONPAY_MERCHANTID', '123456');
The backend sets the path:
WooCommerce → Settings → Payments → DragonPay
Mandatory Field Description:
- Description: Copy displayed on the checkout page is recommended to include supported channels e.g. "Payment via BDO/BPI net banking or 7-Eleven"
- Transaction TypeChoose between "SALE" or "AUTH" (pre-authorisation).
3. PHP code snippet to handle callback validation
// verify_dragonpay_response.php Sample Code:
$merchant_id = $_POST['merchantid'];
$txn_id = $_POST['txnid'];
$signature = strtoupper(hash('sha256',$merchant_id.$txn_id.$secret_key));
if($signature ! = $_POST['signature']){
header('HTTP/1.0 403 Forbidden').
exit;
}
// Update order status after signature validation passes: // The order status will be updated when the signature passes.
$order = wc_get_order($_POST['procref']);
switch($_POST['status']){
case 'S'.
$order->payment_complete();
break;
case 'F'.
$order->update_status('failed');
break;
}
Frequently Asked Questions Troubleshooting:
|Error Code |Cause Analysis |Solution |
|—|—|—|
|DP001|Signature mismatch|Check that the Secret Key does not contain spaces|
|DP033|Currency Type Error|Make sure WooCommerce is set to PHP (₱)|
|DP040|||
PayMaya Enterprise Access Process - Credit Card and Scanner Payments
A) SDK Installation and Environment Preparation
PayMaya offers two integration options:
Option1: Checkout API (embedded forms)
# WordPress root executes composer to install SDK.
composer require paymaya/paymaya-sdk:^2.0
Need to ensure that the server meets the requirements:
- PHP ≥ 7.3
- OpenSSL Extension Enabled
Option2: Payment Plugins for WooCommerce
Official Plugin Features Comparison Table:
free version | Enterprise Edition | |
---|---|---|
monthly fee | ₱0 | ₱2999 |
transaction fee | 3%+15₱ | 1,5%+10₱ |
Supported Cards Visa/MC AMEX/JCB |
B) Webhook Security Configuration Points
PayMaya requires HTTPS and TLS ≥ 1,2 callback addresses, and Let's Encrypt free certificates are available during the development phase.
.htaccess
Add a forced jump rule.
RewriteEngine On
RewriteCond %{SERVER_PORT} ! ^443$
RewriteRule ^(. *)$ https://%{HTTP_HOST}/$1 [R=301,L]
Core logic for verifying signatures: the
function verify_paymaya_webhook(){
$received_sign = $_SERVER['HTTP_X_PAYMAYA_SIGNATURE'];
$payload = file_get_contents("php://input");
// YOUR_PUBLIC_KEY from dashboard
openssl_verify(
$payload.
base64_decode($received_sign),
YOUR_PUBLIC_KEY.
OPENSSL_ALGO_SHA256
);
}
Integration of OTC non-electronic payment solutions
For the unbanked user group, consider the following:
a) Palawan Express Pera Padala
Features: 1800+ offline outlets for cash collection across Fifi
Integration Steps:
1. Installation of "PeraPadala Remittance" plugin in Woocommerce backend
2. Configuration page, enter the partner number (PNRC code needs to be applied separately).
Customer Operation Flowchart.
[Place an order] → [Select Palawan for payment] → [Generate an 8-digit reference number] → [Customer pays at any shop with the number]
Points to note ❗️ is subject to a 15₱ fixed handling fee per transaction, usually borne by the buyer.
The next section will delve into multi-gateway switching strategies and performance optimisation tips...
Do you need more detailed code examples or platform-specific test cases? Please let me know the direction of your specific needs so that I can continue to add professional content.
Intelligent Switching and Performance Optimisation Strategies for Multi-Payment Gateways
1. Dynamic payment method display logic
Geofencing technology application: automatic matching of localised payment options based on customer IPs
"`php
add_filter('woocommerce_available_payment_gateways', 'filter_gateways_by_country');
function filter_gateways_by_country($available_gateways) {
if(isset(WC()->customer)) {
$country = WC()->customer->get_billing_country();
// Customer Visibility Channel in the Philippines
if('PH' === $country) {
unset($available_gateways['paypal']); //hide the PayPal
$available_gateways['gcash']->order_button_text = __('Pay in seconds via GCash', ' woocommerce');
} else {
// Default channel for international customers
unset($available_gateways['dragonpay']);
}
}
return $available_gatewares.
}
“`
Device type detection (mobile priority to show code-sweeping payment):
"`php
// add Mobile detection logic to functions.php
function is_mobile_checkout() {
return wp_is_mobile() && is_checkout();
}
// Special text alerts for GCash wallet on mobile
add_action('wp_head', function(){
if(is_mobile_checkout()) {
echo ";;
}
});
“`
2. Transaction success rate improvement programme
A) Failover mechanism implementation code example
Automatic switchover when the primary gateway times out:
"`php
try {
$response = $gcash_api->createPayment(...);
} catch (API_Timeout_Exception $e) {
// Try Dragonpay after GCash interface timeout
log_error("GCash timeout, fallback to Dragonpay");
$_POST['payment_method'] = 'dragonpay';
WC()->session->set('chosen_payment_method','dragonpay');
wp_safe_redirect(wc_get_checkout_url()).
exit;
}
“`
B) Configuration table for parameters of intelligent routing algorithm
|Weighting factor |Calculation |Optimisation objective |
|—|—|—|
Historical Success Rate |(Number of Successful Transactions/Total Requests) x 100% | Maximise Conversion Rate |
Settlement speed |Varies from T+1 to T+3 working days |Fund turnover efficiency |
Handling Fee Cost |Fixed Fee + Percentage Draw |Maximise Profit |
PHP implementation example:
"`php
$gateway_score = [];
foreach ($active_geteways as $id => gateway){
Score = 0.6*$gateway->success_rate +0.3*(1/$settlement_days)+0.1*(1-$fee_rate);
}
arsort($gateway_score); // sort by score in descending order
$recommended_id=key($gateway_score);
// Add "Recommendations tab" to the frontend.
add_filter("woocommerce_{$recommended_id}_title",function(){...});
“`
—
PCI DSS Compliance Key Checkpoints
Focused verification is required to ensure compliance with international payment security standards:
a). SAQ-AEP Self-Assessment Checklist (for third-party hosted payment pages)
- [ ] TLS encryption mandatory (SSLv3 disabled)
- [ ] Web Application Firewall (WAF) rules updated to the latest version
- [ ] PHP Configuration to Disable `allow_url_fopen` to Prevent SSRF Attacks
`.user.in`i recommends setting.
“`
memory_limit=256M
max_execution_time=90
post_max_size=64M
upload_max_filesize=16M
disable_functions="exec,passthru,shell_exec,system"
“`
b). WooCommerce specific security measures
Database level: regular cleaning of stored card number tokens
SQL query example:
"`sql
DELETE FROM wp_postmeta WHERE meta_key LIKE '_ebanx_hash%' AND DATEDIFF(NOW(),post_date)>180;
“`
Example file monitoring script (detecting malicious injections):
"`bash
#!/bin/bash
# Scanning for changes to the core document
diff -qr /var/www/html/wp-content/plugins/woocommerce \
/tmp/original_copy|grep -iv "translations" > /var/log/wc_security.log
# real-time alarm mechanism configuration
inotifywait -m-r -format '%w%f' plugins/paymaya \
| while read file; do
curl -X POST https://api.security.com/alerts \
-d "file=$file modified on $(date)"
done
“`
—
Google Analytics Enhanced Ecommerce Tracking Implementation Guide
The following code needs to be deployed to accurately monitor the performance of each payment channel:
Example of GA4 Measurement Protocol Buried Points
The checkout page adds a data layer:
"`javascript
““
GTAG.js tracking event code:
"`javascript gtag("event", "select_promotion", {
items:[{
item_name: "GrabPay Discount",
creative_name: "Banner_POSA",
promotion_id: "promo_june2024″}],
payment_type:jQuery("#payment input[name='method']:checked").val()
});
“`
Key Indicator Watchdog Suggestion:
- Conversion funnel analysis: Comparison of the churn rate at each stage of "initiating checkout → selecting payment → completing the transaction". For example, it can be found that Dragonpay users have a 15% bounce abnormality in the bank's OTP verification session.
- ARPU Comparison: Gcash users average order value is 37% higher than OTC (data to be collected)
—
Need more in-depth performance benchmarking data or security audit templates? Please be specific about the direction you wish to enhance and I will provide a professional grade solution.