CMS Development

Julian-Harris
Participant

Passing parameters into custom modules

I am adding a Stripe button to HubSpot so my pages can do payments.

 

var stripe = Stripe('pk_live_XXXXXXXXXX', { betas: ['checkout_beta_3'] });

 

the pk_live cannot be hard-coded in the component; it needs to be an input parameter. Would it be something like this:

 

var stripe = Stripe('{{stripe_sku_id}}', { betas: ['checkout_beta_3'] });

 

How do I set this in a given instance of a form (ie a landing page)?

 

@tjoyce apparently you're a wizard of forms? 🙂  Any guidance most appreciated. HubSpot themselves don't seem to be able to explain this which I think is very odd.

0 Votes
1 Réponse
tjoyce
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Passing parameters into custom modules

Hi @Julian-Harris - 

yes, you would create a field with text_field and then use the code you have with just 1 modification the module value - it would be {{module.stripe_sku_id}}.

You won't be able to use the value in the js section of the module so put it in the hubl section.