NFT Posted September 29, 2023 Share Posted September 29, 2023 Hi Team I am trying to send billing address and shipping address to the formbuilder stripe checkout via hook but it is not working. Here's the code I am trying for setting billing address but on the stripe checkout page it is again showing the dropdown to select the billing address. Any suggestions! $wire->addHookAfter('FormBuilderProcessorStripe::getSessionOptions', function($e) { // Get the existing session options $sessionOptions = $e->return; // Add billing address collection to the session options $sessionOptions['billing_address_collection'] = 'required'; // You can also specify allowed countries for billing address collection $sessionOptions['shipping_address_collection']['allowed_countries'] = ['US', 'CA']; // Set the modified session options $e->return = $sessionOptions; }); I also tried setting the line items with getLineItems hook and it is working fine. Here's the code for that as well. In $stripeProductsArr I have stored the details of all the line items. $wire->addHookAfter('FormBuilderProcessorStripe::getLineItems', function($e) use ($stripeProductsArr) { $e->return = $stripeProductsArr; }); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now