Skip to content

Instantly share code, notes, and snippets.

@LaxusCroco
Last active May 20, 2025 08:29
Show Gist options
  • Save LaxusCroco/351b46b51f5036bfe5245f91c7988c19 to your computer and use it in GitHub Desktop.
Save LaxusCroco/351b46b51f5036bfe5245f91c7988c19 to your computer and use it in GitHub Desktop.
Change the language on Stripe gateway of JetFormBuilder. In 'locale' => 'da', change 'da' to your language code.
<?php
add_action(
'jet-form-builder/gateways/before-create',
function ( $request ) {
$need_request = \Jet_FB_Stripe_Gateway\Compatibility\Jet_Form_Builder\Actions\Create_Checkout_Session::class;
// We check whether this is a request to create a new payment in Stripe
if ( ! is_a( $request, $need_request ) ) {
return;
}
// We initialize the settings before the request. It is important
$request->get_request_args();
/**
* Here we can add the parameters we need. All their types are listed here
*
* @link https://stripe.com/docs/api/checkout/sessions/create
*/
$request->set_body(
array(
/**
* Here you can specify your locale
*
* @see https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-locale
*/
'locale' => 'da',
)
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment