Skip to content

Instantly share code, notes, and snippets.

@LaxusCroco
Last active May 20, 2025 08:29
Show Gist options
  • Select an option

  • Save LaxusCroco/351b46b51f5036bfe5245f91c7988c19 to your computer and use it in GitHub Desktop.

Select an option

Save LaxusCroco/351b46b51f5036bfe5245f91c7988c19 to your computer and use it in GitHub Desktop.

Revisions

  1. LaxusCroco revised this gist May 20, 2025. No changes.
  2. LaxusCroco created this gist May 20, 2025.
    32 changes: 32 additions & 0 deletions change-stripe-locale-jfb.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    <?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',
    )
    );
    }
    );