lib/braintree/transaction_gateway.rb in braintree-2.11.0 vs lib/braintree/transaction_gateway.rb in braintree-2.12.0
- old
+ new
@@ -8,10 +8,15 @@
def create(attributes)
Util.verify_keys(TransactionGateway._create_signature, attributes)
_do_create "/transactions", :transaction => attributes
end
+ def clone_transaction(transaction_id, attributes)
+ Util.verify_keys(TransactionGateway._clone_signature, attributes)
+ _do_create "/transactions/#{transaction_id}/clone", :transaction_clone => attributes
+ end
+
# Deprecated
def create_from_transparent_redirect(query_string)
params = @gateway.transparent_redirect.parse_and_validate_query_string query_string
_do_create("/transactions/all/confirm_transparent_redirect_request", :id => params[:id])
end
@@ -83,9 +88,13 @@
elsif response[:api_error_response]
ErrorResult.new(@gateway, response[:api_error_response])
else
raise UnexpectedError, "expected :transaction or :api_error_response"
end
+ end
+
+ def self._clone_signature # :nodoc:
+ [:amount, {:options => [:submit_for_settlement]}]
end
def self._create_signature # :nodoc:
[
:amount, :customer_id, :merchant_account_id, :order_id, :payment_method_token,