Skip to content

Commit

Permalink
Merge pull request #211 from Mangopay/bugfix/failing-tests
Browse files Browse the repository at this point in the history
fixed failing tests
  • Loading branch information
iulian03 authored Oct 18, 2022
2 parents e00db37 + 7e209d6 commit 9fec514
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 17 deletions.
2 changes: 1 addition & 1 deletion spec/mangopay/preauthorization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
expect(created['PaymentStatus']).to eq('WAITING')
expect(created['PaymentType']).to eq('CARD')
expect(created['ExecutionType']).to eq('DIRECT')
expect(created['Requested3DSVersion']).to eq('V1')
expect(created['Requested3DSVersion']).to eq('V2_1')
end
end

Expand Down
68 changes: 52 additions & 16 deletions spec/mangopay/shared_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ def create_new_document(user)

let(:new_payin_payconiq_web) do
MangoPay::PayIn::Payconiq::Web.create(
AuthorId: new_natural_user['Id'],
CreditedWalletId: new_wallet['Id'],
DebitedFunds: {Currency: 'EUR', Amount: 100},
Fees: {Currency: 'EUR', Amount: 0},
ReturnURL: MangoPay.configuration.root_url,
Country: "BE",
Tag: 'Custom Meta'
AuthorId: new_natural_user['Id'],
CreditedWalletId: new_wallet['Id'],
DebitedFunds: {Currency: 'EUR', Amount: 100},
Fees: {Currency: 'EUR', Amount: 0},
ReturnURL: MangoPay.configuration.root_url,
Country: "BE",
Tag: 'Custom Meta'
)
end

Expand Down Expand Up @@ -357,7 +357,7 @@ def create_new_document(user)
data = {
data: cardreg['PreregistrationData'],
accessKeyRef: cardreg['AccessKey'],
cardNumber: 4970100000000154,
cardNumber: 4970105191923460,
cardExpirationDate: 1226,
cardCvx: 123}

Expand All @@ -377,11 +377,11 @@ def create_new_document(user)

# 2nd step: tokenize by payline (fills-in RegistrationData)
data = {
data: cardreg['PreregistrationData'],
accessKeyRef: cardreg['AccessKey'],
cardNumber: 4970105191923460,
cardExpirationDate: 1224,
cardCvx: 123}
data: cardreg['PreregistrationData'],
accessKeyRef: cardreg['AccessKey'],
cardNumber: 4970105191923460,
cardExpirationDate: 1224,
cardCvx: 123}

res = Net::HTTP.post_form(URI(cardreg['CardRegistrationURL']), data)
raise Exception, [res, res.body] unless res.is_a?(Net::HTTPOK) && res.body.start_with?('data=')
Expand All @@ -407,7 +407,19 @@ def create_new_payin_card_direct(to_wallet, amnt = 1000)
CardId: cardreg['CardId'],
SecureModeReturnURL: 'http://test.com',
Tag: 'Test PayIn/Card/Direct',
Requested3DSVersion: 'V1'
Requested3DSVersion: 'V2_1',
BrowserInfo: {
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
JavaEnabled: true,
Language: "FR-FR",
ColorDepth: 4,
ScreenHeight: 1800,
ScreenWidth: 400,
JavascriptEnabled: true,
TimeZoneOffset: "+60",
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
},
IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C"
)
end

Expand All @@ -425,7 +437,19 @@ def create_new_card_preauthorization(cardreg, amnt = 1000)
SecureMode: 'DEFAULT',
SecureModeReturnURL: 'http://test.com',
Tag: 'Test Card PreAuthorization',
Requested3DSVersion: 'V1'
Requested3DSVersion: 'V2_1',
BrowserInfo: {
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
JavaEnabled: true,
Language: "FR-FR",
ColorDepth: 4,
ScreenHeight: 1800,
ScreenWidth: 400,
JavascriptEnabled: true,
TimeZoneOffset: "+60",
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
},
IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C"
)
end

Expand All @@ -440,7 +464,19 @@ def create_new_payin_preauthorized_direct(to_wallet, amnt = 1000)
DebitedFunds: {Currency: 'EUR', Amount: amnt},
Fees: {Currency: 'EUR', Amount: 0},
PreauthorizationId: preauth['Id'],
Tag: 'Test PayIn/PreAuthorized/Direct'
Tag: 'Test PayIn/PreAuthorized/Direct',
BrowserInfo: {
AcceptHeader: "text/html, application/xhtml+xml, application/xml;q=0.9, /;q=0.8",
JavaEnabled: true,
Language: "FR-FR",
ColorDepth: 4,
ScreenHeight: 1800,
ScreenWidth: 400,
JavascriptEnabled: true,
TimeZoneOffset: "+60",
UserAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
},
IpAddress: "2001:0620:0000:0000:0211:24FF:FE80:C12C"
)
end

Expand Down

0 comments on commit 9fec514

Please sign in to comment.