app/helpers/argyle_helper.rb in argyle-0.0.1 vs app/helpers/argyle_helper.rb in argyle-0.1.0
- old
+ new
@@ -6,16 +6,26 @@
id = options[:form_id] || 'plaidForm'
product = options[:product] || Argyle.configuration.product
env = options[:env] || Argyle.configuration.env
- plaid_link_form(id, options[:action]) + plaid_link_script(id, options[:name], product, env)
+ plaid_link_form(id, options[:action]) + plaid_link_script(id, options[:name], product, env, options)
end
def plaid_link_form(id, action)
form_tag action, method: 'POST', id: id
end
- def plaid_link_script(id, name, product, env)
- javascript_tag '', src: Argyle.configuration.plaid_src, data: {'client-name' => name, 'form-id' => id, 'key' => Argyle.configuration.key, 'product' => product, 'env' => env }
+ def plaid_link_script(id, name, product, env, options)
+ data = {
+ 'client-name' => name,
+ 'form-id' => id,
+ 'key' => Argyle.configuration.key,
+ 'product' => product,
+ 'env' => env
+ }
+ data['webhook'] = options[:webhook] if options[:webhook]
+ data['token'] = options[:token] if options[:token]
+
+ javascript_tag '', src: Argyle.configuration.plaid_src, data: data
end
-end
\ No newline at end of file
+end