Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Document `Braintree.submit_for_settlement`

This has been available since version 0.4.1, but was not in the README.
  • Loading branch information...
commit 55ec560109c872b9d90ca166a740bc44c5bc0280 1 parent 759d3e3
@gabebw gabebw authored
View
1  README.md
@@ -41,6 +41,7 @@ of them (yet).
* `Braintree::Transaction.refund`
* `Braintree::Transaction.sale`
* `Braintree::Transaction.void`
+* `Braintree::Transaction.submit_for_settlement`
### TransparentRedirect
* `Braintree::TransparentRedirect.confirm` (only for creating customers)
View
2  lib/fake_braintree/sinatra_app.rb
@@ -157,7 +157,7 @@ def hash_from_request_body_with_key(key)
gzipped_response(200, transaction_response.to_xml(root: 'transaction'))
end
-
+ # Braintree:Transaction.submit_for_settlement
put '/merchants/:merchant_id/transactions/:transaction_id/submit_for_settlement' do
transaction = FakeBraintree.registry.transactions[params[:transaction_id]]
transaction_response = {'id' => transaction['id'],
View
17 spec/fake_braintree/transaction_spec.rb
@@ -119,3 +119,20 @@ def create_transaction(amount = 10.00)
end
end
end
+
+describe FakeBraintree::SinatraApp do
+ context "Braintree::Transaction.submit_for_settlement" do
+ it "should be able to mark transaction as completed" do
+ id = create_transaction.id
+
+ result = Braintree::Transaction.submit_for_settlement(id)
+
+ expect(result).to be_success
+ expect(Braintree::Transaction.find(id).status).to eq Braintree::Transaction::Status::SubmittedForSettlement
+ end
+
+ def create_transaction
+ Braintree::Transaction.sale(payment_method_token: cc_token, amount: 10.0).transaction
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.