offsite_payments
offsite_payments copied to clipboard
Added 'role' attribute to hidden tag fields of payment service form.
Issue by divineforest
Friday Oct 11, 2013 at 09:30 GMT
Originally opened as https://github.com/Shopify/active_merchant/pull/878
Without this change it's not possible to programmatically find these input elements by Javascript integration-independently because fields like "order" will have other actual names as set by particular service mappings.
With this patch "order" input for example for Paysbuy integration will be:
<input id="inv" name="inv" role="payment-form-order" type="hidden" value="42">
So I can query it with
$("[role='payment-form-order']")
without having to know particular input name.
More info on "role" html attribute http://www.w3.org/TR/role-attribute/
divineforest included the following code: https://github.com/Shopify/active_merchant/pull/878/commits