omise-woocommerce
omise-woocommerce copied to clipboard
[FRON-1464]: Added customer name to the metadata.
1. Objective
Add customer name to the metadata
Jira Ticket: https://omise.atlassian.net/browse/FRON-1464
2. Description of change
Customer name is fetched from the $order object. A new function getOrderMetadata which is created in the class-omise-payment.php that abstracts the code to generate the metadata to be sent to the OMISE server. It takes $order_id and $order as the parameters.
Even though we could obtain the order ID from the $order obejct, we passed the $order_id to the getOrderMetada method to avoid checking for backward compatibility.
/** override order_id as a reference for webhook handlers **/
/** backward compatible with WooCommerce v2.x series **/
'order_id' => version_compare( WC()->version, '3.0.0', '>=' ) ? $order->get_id() : $order->id
3. Quality assurance
Add item to the cart and checkout using following payment methods
- Alipay
- Alipay Plus
- Bill payment Tesco
- Credit Card
- FPX
- Installment
- Internet banking
- Konbini
- Mobile banking
- Rabbit linepay
- True Money
Tested with following payment methods

On the dashboard, go to any one charge and you should see the customer name in the metadata.
🔧 Environments:
- WooCommerce: v6.4.1
- WordPress: v5.9.3
- PHP version: 7.4.28
- Omise plugin version: Omise-WooCommerce 4.19.2
Need to update this on includes/gateway/class-omise-payment-ocbc-pao.php from https://github.com/omise/omise-woocommerce/pull/265 as well. 🤔
I've tested with my website but even I'm filled all the billing address
the metadata here still empty value
I've tested with my website but even I'm filled all the billing address
the metadata here still empty value
Thanks for reporting it. It should have worked. I will ping you via slack to know more about it.
https://github.com/omise/omise-woocommerce/pull/270 if you release after me, can you incorporate your change on GrabPay (new payment method) too?
#270 if you release after me, can you incorporate your change on GrabPay (new payment method) too?
Sure
retest again with billing address fixed, now it works
SonarCloud Quality Gate failed. 
3 Bugs
0 Vulnerabilities
0 Security Hotspots
10 Code Smells
No Coverage information
5.9% Duplication