Skip to content

Instantly share code, notes, and snippets.

@ChromeOrange
Created February 9, 2022 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChromeOrange/e5950c3517516bd9a90362d4fbc906b8 to your computer and use it in GitHub Desktop.
Save ChromeOrange/e5950c3517516bd9a90362d4fbc906b8 to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_sagepay_direct_data', 'telephone_order_payment', 10, 2 );
add_filter( 'woocommerce_sagepay_direct_data', 'telephone_order_payment', 10, 2 );
function telephone_order_payment( $data, $order ) {
$order_id = $order->get_id();
$type = get_post_meta( $order_id, '_created_via', TRUE);
if ( $type !== 'checkout' ) {
$data['AccountType'] = 'M';
}
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment