lib/active_merchant/billing/gateways/fat_zebra.rb in activemerchant-1.97.0 vs lib/active_merchant/billing/gateways/fat_zebra.rb in activemerchant-1.98.0
- old
+ new
@@ -25,10 +25,11 @@
add_amount(post, money, options)
add_creditcard(post, creditcard, options)
add_extra_options(post, options)
add_order_id(post, options)
add_ip(post, options)
+ add_metadata(post, options)
commit(:post, 'purchases', post)
end
def authorize(money, creditcard, options = {})
@@ -37,10 +38,11 @@
add_amount(post, money, options)
add_creditcard(post, creditcard, options)
add_extra_options(post, options)
add_order_id(post, options)
add_ip(post, options)
+ add_metadata(post, options)
post[:capture] = false
commit(:post, 'purchases', post)
end
@@ -134,9 +136,13 @@
post[:reference] = options[:order_id] || SecureRandom.hex(15)
end
def add_ip(post, options)
post[:customer_ip] = options[:ip] || '127.0.0.1'
+ end
+
+ def add_metadata(post, options)
+ post[:metadata] = options.fetch(:metadata, {})
end
def commit(method, uri, parameters=nil)
response = begin
parse(ssl_request(method, get_url(uri), parameters.to_json, headers))