Hola! ¡Tenemos nuestra Comunidad en Español!

Passing parameters into custom modules

Visitor

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? Smiley Happy  Any guidance most appreciated. HubSpot themselves don't seem to be able to explain this which I think is very odd.

Reply
0 Upvotes
1 Reply
Regular Advisor | Gold Partner | HubSpot Certified Trainer

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.