-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Iulian Masar
committed
Nov 15, 2024
1 parent
dc8e5b0
commit 866b00f
Showing
4 changed files
with
119 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
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,30 @@ | ||
describe MangoPay::PayIn::Swish::Web, type: :feature do | ||
include_context 'wallets' | ||
include_context 'payins' | ||
|
||
def check_type_and_status(payin) | ||
expect(payin['Type']).to eq('PAYIN') | ||
expect(payin['Nature']).to eq('REGULAR') | ||
expect(payin['PaymentType']).to eq('SWISH') | ||
expect(payin['ExecutionType']).to eq('WEB') | ||
expect(payin['Status']).to eq('CREATED') | ||
end | ||
|
||
describe 'CREATE' do | ||
it 'creates a swish web payin' do | ||
created = new_payin_swish_web | ||
expect(created['Id']).not_to be_nil | ||
check_type_and_status(created) | ||
end | ||
end | ||
|
||
describe 'FETCH' do | ||
it 'fetches a payin' do | ||
created = new_payin_swish_web | ||
fetched = MangoPay::PayIn.fetch(created['Id']) | ||
expect(fetched['Id']).to eq(created['Id']) | ||
check_type_and_status(created) | ||
check_type_and_status(fetched) | ||
end | ||
end | ||
end |
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,30 @@ | ||
describe MangoPay::PayIn::Twint::Web, type: :feature do | ||
include_context 'wallets' | ||
include_context 'payins' | ||
|
||
def check_type_and_status(payin) | ||
expect(payin['Type']).to eq('PAYIN') | ||
expect(payin['Nature']).to eq('REGULAR') | ||
expect(payin['PaymentType']).to eq('TWINT') | ||
expect(payin['ExecutionType']).to eq('WEB') | ||
expect(payin['Status']).to eq('CREATED') | ||
end | ||
|
||
describe 'CREATE' do | ||
it 'creates a twint web payin' do | ||
created = new_payin_twint_web | ||
expect(created['Id']).not_to be_nil | ||
check_type_and_status(created) | ||
end | ||
end | ||
|
||
describe 'FETCH' do | ||
it 'fetches a payin' do | ||
created = new_payin_twint_web | ||
fetched = MangoPay::PayIn.fetch(created['Id']) | ||
expect(fetched['Id']).to eq(created['Id']) | ||
check_type_and_status(created) | ||
check_type_and_status(fetched) | ||
end | ||
end | ||
end |
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