lib/active_merchant/billing/gateway.rb in activemerchant-1.95.0 vs lib/active_merchant/billing/gateway.rb in activemerchant-1.96.0

- old
+ new

@@ -198,9 +198,19 @@ def supports_network_tokenization? false end + def add_fields_to_post_if_present(post, options, fields) + fields.each do |field| + add_field_to_post_if_present(post, options, field) + end + end + + def add_field_to_post_if_present(post, options, field) + post[field] = options[field] if options[field] + end + protected # :nodoc: all def normalize(field) case field when 'true' then true