omise / omise-woocommerce

Omise WooCommerce Plugin
https://docs.opn.ooo/woocommerce-plugin
MIT License
47 stars 27 forks source link

[ENGA3-1178]: Billing address will be sent to create token only if all the fields required for AVS are present. #369

Closed aashishgurung closed 1 year ago

aashishgurung commented 1 year ago

1. Objective

Send billing address to create token only if all the fields required for AVS are present.

Jira Ticket: #1178

2. Description of change

Created a function getBillingAddress that will fetch the billing address of the field specified in the billingAddressFields array. The function returns an object with address details as per token API requirement if all the fields required for AVS are present. Otherwise the function returns null indicating billing address is not complete.

When billing address is not complete as per AVS.

Screenshot 2566-04-18 at 16 58 57

When billing address is complete as per AVS but street address 2 is missing.

Screenshot 2566-04-18 at 16 55 45

When billing address is complete as per AVS and street address 2 is present.

Screenshot 2566-04-18 at 15 27 40

🔧 Environments: