forked from MarkEdmondson1234/googleID
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Given(/^the user creates a refund$/) do | ||
sleep(1) | ||
@response = @client.refund_invoice(id: REFUND_TRANSACTION, params: {amount: 1, currency: 'USD', bitcoinAddress: REFUND_ADDRESS}) | ||
end | ||
|
||
Then(/^they will receive a refund id$/) do | ||
@refund_id = @response["id"] | ||
expect(@refund_id).not_to be_empty | ||
end | ||
|
||
Given(/^the user requests a specific refund$/) do | ||
@response = @client.get_refund(invoice_id: REFUND_TRANSACTION, request_id: @refund_id) | ||
end | ||
|
||
Then(/^they will receive the refund$/) do | ||
expect(@response.first["status"]).not_to be_empty | ||
end | ||
|
||
Given(/^the user requests all refunds for an invoice$/) do | ||
client = new_client_from_stored_values | ||
@response = client.get_all_refunds_for_invoice(id: REFUND_TRANSACTION) | ||
end | ||
|
||
Then(/^they will receive an array of refunds$/) do | ||
expect(@response).to be_instance_of Array | ||
end | ||
|
||
Given(/^a properly formatted cancellation request$/) do | ||
sleep(1) | ||
client = new_client_from_stored_values | ||
@refund_id = client.get_all_refunds_for_invoice(id: REFUND_TRANSACTION).first["id"] | ||
@response = client.cancel_refund(invoice_id: REFUND_TRANSACTION, request_id: @refund_id) | ||
end | ||
|
||
Then(/^the refund will be cancelled$/) do | ||
expect(@response).to eq("Success") | ||
end | ||
© 2020 GitHub, Inc. |