Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChaseWiseman/62fc790959bb3643fbf8fa1cabb4ded1 to your computer and use it in GitHub Desktop.
Save ChaseWiseman/62fc790959bb3643fbf8fa1cabb4ded1 to your computer and use it in GitHub Desktop.
<?php // Remove if not needed
/**
* Sets a dummy postcode if required by the CIM payment processor.
*/
function sv_wc_authorize_net_cim_set_uae_postcode( $data ) {
if ( ! empty( $data['billing_country'] ) && 'AE' === $data['billing_country'] ) {
$data['billing_postcode'] = '00000';
}
if ( ! empty( $data['shipping_country'] ) && 'AE' === $data['shipping_country'] ) {
$data['shipping_postcode'] = '00000';
}
return $data;
}
add_filter( 'woocommerce_checkout_posted_data', 'sv_wc_authorize_net_cim_set_uae_postcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment