Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Prevent empty string values from getOrderProperty func return value #73

Open
rizdaprasetya opened this issue Aug 24, 2022 · 0 comments

Comments

@rizdaprasetya
Copy link
Contributor

rizdaprasetya commented Aug 24, 2022

public static function getOrderProperty($order, $property){
$functionName = "get_".$property;
if (method_exists($order, $functionName)){ // WC v3
return (string)$order->{$functionName}();
} else { // WC v2
return (string)$order->{$property};
}
}

This function should

  • check if the return value is empty string "", then do not return empty string. Because it may cause issue if billing_email is empty string, Snap API will reject w/ msg "customer_details.email format is invalid"

Enhancement needed to prevent that issue.

Reporting merchant: G019146562 NextCool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant