Skip to content

Instantly share code, notes, and snippets.

@vanbo
Last active January 14, 2021 15:29
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 vanbo/91a31f398a648b298d712d505d701fc2 to your computer and use it in GitHub Desktop.
Save vanbo/91a31f398a648b298d712d505d701fc2 to your computer and use it in GitHub Desktop.
WC Paysafe Modify Overlay settings
/**
* Add the gist to your "theme/functions.php" file or any file loading with after the "theme/functions.php" file
*/
add_filter( 'wc_paysafe_checkoutjs_order_iframe_props', 'prefix_modify_overlay_parameters', 10, 3 );
/**
* @param array $parameters
* @param \WC_Order $order
* @param \WcPaysafe\Api\Checkoutjs\Service $service
*
* @return array
*/
function prefix_modify_overlay_parameters( $parameters, $order, $service ) {
// Change the overlay language on demand.
if ( true ) {
// Values: "en_US", "fr_CA"
$parameters['options']['locale'] = 'en_US';
}
// Always return the parameters!!!!
return $parameters;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment