wirecard 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/README.md +2 -0
  4. data/README.rdoc +3 -0
  5. data/circle.yml +7 -0
  6. data/lib/wirecard.rb +22 -0
  7. data/lib/wirecard/backend/approve_reversal.rb +9 -0
  8. data/lib/wirecard/backend/base.rb +20 -0
  9. data/lib/wirecard/backend/deposit.rb +9 -0
  10. data/lib/wirecard/backend/deposit_reversal.rb +9 -0
  11. data/lib/wirecard/backend/generate_order_number.rb +12 -0
  12. data/lib/wirecard/backend/get_order_details.rb +9 -0
  13. data/lib/wirecard/backend/recur_payment.rb +9 -0
  14. data/lib/wirecard/backend/refund.rb +9 -0
  15. data/lib/wirecard/backend/refund_reversal.rb +9 -0
  16. data/lib/wirecard/backend/transfer_fund/base.rb +15 -0
  17. data/lib/wirecard/backend/transfer_fund/existing_order.rb +11 -0
  18. data/lib/wirecard/base.rb +26 -11
  19. data/lib/wirecard/callback.rb +3 -8
  20. data/lib/wirecard/configuration.rb +4 -0
  21. data/lib/wirecard/data_storage/init.rb +1 -3
  22. data/lib/wirecard/fingerprint/base.rb +13 -2
  23. data/lib/wirecard/payment_process/init.rb +11 -0
  24. data/lib/wirecard/request.rb +2 -6
  25. data/lib/wirecard/response.rb +0 -4
  26. data/lib/wirecard/version.rb +1 -1
  27. data/spec/spec_helper.rb +10 -1
  28. data/spec/unit_tests/backend/approve_reversal_spec.rb +54 -0
  29. data/spec/unit_tests/backend/deposit_reversal_spec.rb +91 -0
  30. data/spec/unit_tests/backend/deposit_spec.rb +79 -0
  31. data/spec/unit_tests/backend/generate_order_number_spec.rb +37 -0
  32. data/spec/unit_tests/backend/get_order_details_spec.rb +233 -0
  33. data/spec/unit_tests/backend/recur_payment_spec.rb +86 -0
  34. data/spec/unit_tests/backend/refund_reversal.rb +60 -0
  35. data/spec/unit_tests/backend/refund_spec.rb +66 -0
  36. data/spec/unit_tests/backend/transfer_fund/existing_order_spec.rb +88 -0
  37. data/spec/unit_tests/callback_spec.rb +101 -0
  38. data/spec/unit_tests/data_storage/init_spec.rb +39 -25
  39. data/spec/unit_tests/data_storage/read_spec.rb +47 -0
  40. data/spec/unit_tests/fingerprint/sha_512_spec.rb +69 -0
  41. data/spec/unit_tests/payment_process/init_spec.rb +94 -0
  42. data/spec/unit_tests/support/shared_context.rb +235 -0
  43. data/spec/unit_tests/support/shared_examples.rb +7 -33
  44. data/spec/unit_tests/support/webserver.rb +29 -0
  45. data/spec/wirecard_spec.rb +133 -133
  46. data/wirecard.gemspec +5 -0
  47. metadata +115 -4
  48. data/spec/unit_tests/base_shared.rb +0 -34
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Wirecard::DataStorage::Read do
4
+
5
+ let(:read) { Wirecard::DataStorage::Read.new(options) }
6
+ let(:options) { { storage_id: 'b2737b746627482e0b024097cadb1b41' } }
7
+
8
+ include_context 'configuration'
9
+
10
+ it { is_expected.to be_a_kind_of(Wirecard::DataStorage::Read) }
11
+
12
+ describe '#implicit_fingerprint_order' do
13
+ subject { read.implicit_fingerprint_order }
14
+
15
+ it { is_expected.to eq([:customer_id, :shop_id, :storage_id, :secret]) }
16
+ end
17
+
18
+ describe '#defaults' do
19
+ subject { read.defaults }
20
+
21
+ include_examples 'Wirecard::Base#defaults'
22
+ end
23
+
24
+ describe '#url' do
25
+ subject { read.url }
26
+
27
+ it { is_expected.to eq('https://checkout.wirecard.com/seamless/dataStorage/read') }
28
+ end
29
+
30
+ describe '#post' do
31
+ subject { read.post.response }
32
+ include_context 'stub requests'
33
+
34
+ context 'when storage_id is given' do
35
+ it { is_expected.to eq ({payment_informations: '0',
36
+ storage_id: "b2737b746627482e0b024097cadb1b41"}) }
37
+ end
38
+
39
+ context 'when storage_id is missing' do
40
+ let(:options) { Hash.new }
41
+
42
+ it { is_expected.to eq ({:"error.1.error_code" => "11302",
43
+ :"error.1.message" => "STORAGEID is missing.",
44
+ errors: '1'}) }
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,69 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Wirecard::Callback do
4
+ let(:fingerprinter) { Wirecard::Fingerprint::Sha512.new(params, implicit_fingerprint_order) }
5
+ let(:params) { { 'parameterKey1' => 'parameterValue1',
6
+ 'parameterKey2' => 'parameterValue2' }.merge!(additional_params) }
7
+ let(:additional_params) { {} }
8
+ let(:implicit_fingerprint_order) { nil }
9
+
10
+ describe '#fingerprinted_params' do
11
+ subject { fingerprinter.fingerprinted_params }
12
+
13
+ context 'when no implicit_fingerprint_order is given' do
14
+ let(:implicit_fingerprint_order) { nil }
15
+
16
+ it { is_expected.to eq params.merge({
17
+ "requestFingerprint" => "5b158abcb10055cc9a700a871676559b5444cd9b9e7d6aebb9ae2783dd1230bdb46b6c2db1bbefe816757762b281aa44fbc7b73dcfad115d9d276582e04f603b",
18
+ "requestFingerprintOrder" => "parameterKey1,parameterKey2,requestFingerprintOrder,secret"
19
+ }) }
20
+ end
21
+
22
+ context 'when implicit_fingerprint_order is set' do
23
+ let(:implicit_fingerprint_order) { ['parameterKey2', 'parameterKey1', 'secret'] }
24
+
25
+ it { is_expected.to eq params.merge({
26
+ "requestFingerprint" => "8c558d1efb1fdbb768c92774c622e0b38b6fe1ff0c63ee37513a1bfa138df33c868962acf1e255fb0513adfd23019343412d092e1e3fdfe3ba178bd91e5d9216"
27
+ }) }
28
+ end
29
+ end
30
+
31
+ describe '#request_fingerprint_order' do
32
+ subject { fingerprinter.send(:request_fingerprint_order) }
33
+
34
+ it { is_expected.to eq 'parameterKey1,parameterKey2,requestFingerprintOrder,secret' }
35
+ end
36
+
37
+ describe '#fingerprint_string' do
38
+ subject { fingerprinter.send(:fingerprint_string) }
39
+
40
+ context 'when no implicit_fingerprint_order is given' do
41
+ let(:implicit_fingerprint_order) { nil }
42
+
43
+ context 'when requestFingerprintOrder is set within parameters' do
44
+ let(:additional_params) { {'requestFingerprintOrder' => 'parameterKey1,parameterKey2,requestFingerprintOrder,secret'} }
45
+
46
+ it { is_expected.to eq 'parameterValue1parameterValue2parameterKey1,parameterKey2,requestFingerprintOrder,secretB8AKTPWBRMNBV455FG6M2DANE99WU2' }
47
+ end
48
+
49
+ context 'when responseFingerprintOrder is set within parameters' do
50
+ let(:additional_params) { {'responseFingerprintOrder' => 'parameterKey2,parameterKey1,secret,responseFingerprintOrder'} }
51
+
52
+ it { is_expected.to eq 'parameterValue2parameterValue1B8AKTPWBRMNBV455FG6M2DANE99WU2parameterKey2,parameterKey1,secret,responseFingerprintOrder' }
53
+ end
54
+
55
+ context 'when no order is given in the params' do
56
+ it { expect{ subject }.to raise_error(Wirecard::Fingerprint::NoFingerprintOrderGivenError) }
57
+ end
58
+ end
59
+
60
+ context 'when implicit_fingerprint_order is set' do
61
+ let(:implicit_fingerprint_order) { ['parameterKey2', 'parameterKey1', 'secret'] }
62
+
63
+ it { is_expected.to eq 'parameterValue2parameterValue1B8AKTPWBRMNBV455FG6M2DANE99WU2' }
64
+ end
65
+
66
+
67
+ end
68
+
69
+ end
@@ -0,0 +1,94 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Wirecard::PaymentProcess::Init do
4
+
5
+ let(:init) { Wirecard::PaymentProcess::Init.new(options) }
6
+ let(:options) { Hash.new.merge(payment_type_data).merge(payment_data).merge(consumer_data) }
7
+ let(:payment_type_data) { { payment_type: 'CCARD', storage_id: 'b2737b746627482e0b024097cadb1b41' } }
8
+ let(:payment_data) { { amount: '1000', currency: 'USD', order_description: 'some description' } }
9
+ let(:consumer_data) { { consumer_ip_address: '127.0.0.1', consumer_user_agent: 'some agent', language: 'en'} }
10
+
11
+ include_context 'configuration'
12
+ include_context 'stub requests'
13
+
14
+ it { is_expected.to be_a_kind_of(Wirecard::PaymentProcess::Init) }
15
+
16
+ describe '#implicit_fingerprint_order' do
17
+ subject { init.implicit_fingerprint_order }
18
+
19
+ it { is_expected.to be nil }
20
+ end
21
+
22
+ describe '#defaults' do
23
+ subject { init.defaults }
24
+
25
+ include_examples 'Wirecard::Base#defaults'
26
+ it { expect(subject[:order_number]).to eq(1113051) }
27
+ it { expect(subject[:language]).to eq(config[:language]) }
28
+ it { expect(subject[:currency]).to eq(config[:currency]) }
29
+ it { expect(subject[:success_url]).to eq(config[:success_url]) }
30
+ it { expect(subject[:failure_url]).to eq(config[:failure_url]) }
31
+ it { expect(subject[:cancel_url]).to eq(config[:cancel_url]) }
32
+ it { expect(subject[:service_url]).to eq(config[:service_url]) }
33
+ it { expect(subject[:confirm_url]).to eq(config[:confirm_url]) }
34
+ end
35
+
36
+ describe '#url' do
37
+ subject { init.url }
38
+
39
+ it { is_expected.to eq('https://checkout.wirecard.com/seamless/frontend/init') }
40
+ end
41
+
42
+ describe '#post' do
43
+ subject { init.post.response }
44
+
45
+ context 'when credit card payment' do
46
+ let(:payment_type_data) { { payment_type: 'CCARD', storage_id: 'b2737b746627482e0b024097cadb1b41' } }
47
+
48
+ it { is_expected.to eq ({redirect_url: "https://checkout.wirecard.com/seamless/frontend/D200001qmore_DESKTOP/select.php?SID=ttkbc64otkqk067oca49ft0cr5" } ) }
49
+ end
50
+
51
+ context 'when Sofortüberweisung payment' do
52
+ let(:payment_type_data) { { payment_type: 'SOFORTUEBERWEISUNG' } }
53
+
54
+ it { is_expected.to eq ({redirect_url: "https://checkout.wirecard.com/seamless/frontend/D200001qmore_DESKTOP/select.php?SID=ckovh2titpm7kagm48e532ifc6" } ) }
55
+ end
56
+
57
+ context 'when SEPA payment' do
58
+ let(:payment_type_data) { { payment_type: 'SEPA-DD' } }
59
+
60
+ it { is_expected.to eq ({redirect_url: "https://checkout.wirecard.com/seamless/frontend/D200001qmore_DESKTOP/select.php?SID=j5bk04off945jg6qv25imb1en4" } ) }
61
+ end
62
+
63
+ context 'when PayPal payment' do
64
+ let(:payment_type_data) { { payment_type: 'PAYPAL' } }
65
+
66
+ it { is_expected.to eq ({redirect_url: "https://checkout.wirecard.com/seamless/frontend/D200001qmore_DESKTOP/select.php?SID=1ccoq6lf3euji7dk018sulomg6" } ) }
67
+ end
68
+
69
+ context 'when options are invalid' do
70
+ let(:options) { Hash.new }
71
+
72
+ it { is_expected.to eq ({
73
+ :"error.1.consumer_message" => "PAYMENTTYPE is missing.",
74
+ :"error.1.error_code" => "11051",
75
+ :"error.1.message" => "PAYMENTTYPE is missing.",
76
+ :"error.2.consumer_message" => "Currency is missing.",
77
+ :"error.2.error_code" => "11019",
78
+ :"error.2.message" => "Currency is missing.",
79
+ :"error.3.consumer_message" => "Order description is missing.",
80
+ :"error.3.error_code" => "11020",
81
+ :"error.3.message" => "Order description is missing.",
82
+ :"error.4.consumer_message" => "Amount is missing.",
83
+ :"error.4.error_code" => "11017",
84
+ :"error.4.message" => "Amount is missing.",
85
+ :"error.5.consumer_message" => "IP-Address is missing.",
86
+ :"error.5.error_code" => "11146",
87
+ :"error.5.message" => "IP-Address is missing.",
88
+ :"error.6.consumer_message" => "USER_AGENT is missing.",
89
+ :"error.6.error_code" => "11130",
90
+ :"error.6.message" => "USER_AGENT is missing.",
91
+ errors: "6"}) }
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,235 @@
1
+ RSpec.shared_context 'configuration' do
2
+ let(:config) { {
3
+ host: 'checkout.wirecard.com',
4
+ endpoint: 'https://checkout.wirecard.com/seamless',
5
+ customer_id: 'D200001',
6
+ shop_id: 'qmore',
7
+ password: 'jcv45z',
8
+ secret: 'B8AKTPWBRMNBV455FG6M2DANE99WU2',
9
+ success_url: 'http://localhost.success.url',
10
+ failure_url: 'http://localhost.failure.url',
11
+ cancel_url: 'http://localhost.cancel.url',
12
+ service_url: 'http://localhost.service.url',
13
+ confirm_url: 'http://localhost.confirm.url',
14
+ return_url: 'http://localhost.return.url',
15
+ language: 'en'
16
+ } }
17
+
18
+ before do
19
+ Wirecard.configure do |configuration|
20
+ configuration.host = config[:host]
21
+ configuration.endpoint = config[:endpoint]
22
+ configuration.customer_id = config[:customer_id]
23
+ configuration.shop_id = config[:shop_id]
24
+ configuration.password = config[:password]
25
+ configuration.secret = config[:secret]
26
+ configuration.success_url = config[:success_url]
27
+ configuration.failure_url = config[:failure_url]
28
+ configuration.cancel_url = config[:cancel_url]
29
+ configuration.service_url = config[:service_url]
30
+ configuration.confirm_url = config[:confirm_url]
31
+ configuration.return_url = config[:return_url]
32
+ configuration.language = config[:language]
33
+ end
34
+ end
35
+ end
36
+
37
+ RSpec.shared_context 'stub requests' do
38
+
39
+ before do
40
+ ##### Wirecard::DataStorage::Init #####
41
+ stub_request(:post, "https://checkout.wirecard.com/seamless/dataStorage/init").
42
+ with(body: {"customerId"=>"D200001", "javascriptScriptVersion"=>"pci3", "language"=>"en", "orderIdent"=>"order123", "requestFingerprint"=>"855b5ac85144d35c4b32d35ddfbdbbd34770cb33b4d5271a1566c3892e43eb2507253e17e840fd6f2ddcc49d49c79580ba96e239bfe5d4df90bf02ea0484e1b2", "returnUrl"=>"http://localhost.return.url", "shopId"=>"qmore"},
43
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'284', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
44
+ to_return(status: 200, body: "storageId=b2737b746627482e0b024097cadb1b41&javascriptUrl=https%3A%2F%2Fcheckout.wirecard.com%2Fseamless%2FdataStorage%2Fjs%2FD200001%2Fqmore%2Fb2737b746627482e0b024097cadb1b41%2FdataStorage.js", headers: {})
45
+
46
+ stub_request(:post, "https://checkout.wirecard.com/seamless/dataStorage/init").
47
+ with(body: {"customerId"=>"D200001", "javascriptScriptVersion"=>"pci3", "language"=>"en", "requestFingerprint"=>"6ebcaa502c04de25dbdca74e6eaa44a7cb3cd0adb2b171433099726848ea40cee3adac2f9c89b6102e02bd2a19106a1012fe0fe72f68b75cc7432adf973cdc18", "returnUrl"=>"http://localhost.return.url", "shopId"=>"qmore"},
48
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'264', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
49
+ to_return(status: 200, body: "error.1.errorCode=15300&error.1.message=ORDERIDENT+has+an+invalid+length.&error.1.consumerMessage=ORDERIDENT+has+an+invalid+length.&errors=1", headers: {})
50
+
51
+
52
+ ##### Wirecard::DataStorage::Read #####
53
+ stub_request(:post, "https://checkout.wirecard.com/seamless/dataStorage/read").
54
+ with(body: {"customerId"=>"D200001", "requestFingerprint"=>"eb6a688db153b6f215c12d98c9cccaf8d60dec0e64bab967e2cae0b868fa30a3edf91ef8a17ee40d3984b0a4742aecf049446fea696740470e45121ccdfe6cbd", "shopId"=>"qmore", "storageId"=>"b2737b746627482e0b024097cadb1b41"},
55
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'222', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
56
+ to_return(status: 200, body: "storageId=b2737b746627482e0b024097cadb1b41&paymentInformations=0", headers: {})
57
+
58
+ stub_request(:post, "https://checkout.wirecard.com/seamless/dataStorage/read").
59
+ with(body: {"customerId"=>"D200001", "requestFingerprint"=>"7378bce0cab7ef7edb08f178c23146332ecce459409393b4d97e4e0e2da0bf86489f0d1c28a3cb8d549b56879e8b42a42a61a59c184d4f2335a1531b97b5bc27", "shopId"=>"qmore"},
60
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'179', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
61
+ to_return(status: 200, body: "error.1.errorCode=11302&error.1.message=STORAGEID+is+missing.&errors=1", :headers => {})
62
+
63
+
64
+ ##### Wirecard::PaymentProcess::Init #####
65
+
66
+ stub_request(:post, "https://checkout.wirecard.com/seamless/frontend/init").
67
+ with(body: {"amount"=>"1000", "cancelUrl"=>"http://localhost.cancel.url", "confirmUrl"=>"http://localhost.confirm.url", "consumerIpAddress"=>"127.0.0.1", "consumerUserAgent"=>"some agent", "currency"=>"USD", "customerId"=>"D200001", "failureUrl"=>"http://localhost.failure.url", "language"=>"en", "orderDescription"=>"some description", "orderNumber"=>"1113051", "paymentType"=>"CCARD", "requestFingerprint"=>"db79d074ea5a1572425d54877097cde8fd72ae32a7587cc5d77103e9ff0d807ee64f7b4010ad06b3a2e13be605f87ea35895cf541a9790d15e46f1008e8e638d", "requestFingerprintOrder"=>"customerId,shopId,orderNumber,language,currency,successUrl,failureUrl,cancelUrl,serviceUrl,confirmUrl,paymentType,storageId,amount,orderDescription,consumerIpAddress,consumerUserAgent,requestFingerprintOrder,secret", "serviceUrl"=>"http://localhost.service.url", "shopId"=>"qmore", "storageId"=>"b2737b746627482e0b024097cadb1b41", "successUrl"=>"http://localhost.success.url"},
68
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'889', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
69
+ to_return(status: 200, body: "redirectUrl=https%3A%2F%2Fcheckout.wirecard.com%2Fseamless%2Ffrontend%2FD200001qmore_DESKTOP%2Fselect.php%3FSID%3Dttkbc64otkqk067oca49ft0cr5", headers: {})
70
+
71
+ stub_request(:post, "https://checkout.wirecard.com/seamless/frontend/init").
72
+ with(body: {"amount"=>"1000", "cancelUrl"=>"http://localhost.cancel.url", "confirmUrl"=>"http://localhost.confirm.url", "consumerIpAddress"=>"127.0.0.1", "consumerUserAgent"=>"some agent", "currency"=>"USD", "customerId"=>"D200001", "failureUrl"=>"http://localhost.failure.url", "language"=>"en", "orderDescription"=>"some description", "orderNumber"=>"1113051", "paymentType"=>"SOFORTUEBERWEISUNG", "requestFingerprint"=>"4c03194780d2383617ac360af521b9cfb2a201cec496e7f205b1ffc276b7de586fb354ad39546d9561ad99f8df5edf0bc3cf8ebeed490212da289e1d90c1db4b", "requestFingerprintOrder"=>"customerId,shopId,orderNumber,language,currency,successUrl,failureUrl,cancelUrl,serviceUrl,confirmUrl,paymentType,amount,orderDescription,consumerIpAddress,consumerUserAgent,requestFingerprintOrder,secret", "serviceUrl"=>"http://localhost.service.url", "shopId"=>"qmore", "successUrl"=>"http://localhost.success.url"},
73
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'847', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
74
+ to_return(status: 200, body: "redirectUrl=https%3A%2F%2Fcheckout.wirecard.com%2Fseamless%2Ffrontend%2FD200001qmore_DESKTOP%2Fselect.php%3FSID%3Dckovh2titpm7kagm48e532ifc6", headers: {})
75
+
76
+ stub_request(:post, "https://checkout.wirecard.com/seamless/frontend/init").
77
+ with(body: {"amount"=>"1000", "cancelUrl"=>"http://localhost.cancel.url", "confirmUrl"=>"http://localhost.confirm.url", "consumerIpAddress"=>"127.0.0.1", "consumerUserAgent"=>"some agent", "currency"=>"USD", "customerId"=>"D200001", "failureUrl"=>"http://localhost.failure.url", "language"=>"en", "orderDescription"=>"some description", "orderNumber"=>"1113051", "paymentType"=>"SEPA-DD", "requestFingerprint"=>"b1fbcb93f59b5e1a90d1525a5eb889bea2a6fa5ebac5b1956999d09a6cc0707ca0bb02dc4cb13c4ecda8533175f5be9275680328a00f70976b06d0ef410699f9", "requestFingerprintOrder"=>"customerId,shopId,orderNumber,language,currency,successUrl,failureUrl,cancelUrl,serviceUrl,confirmUrl,paymentType,amount,orderDescription,consumerIpAddress,consumerUserAgent,requestFingerprintOrder,secret", "serviceUrl"=>"http://localhost.service.url", "shopId"=>"qmore", "successUrl"=>"http://localhost.success.url"},
78
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'836', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
79
+ to_return(status: 200, body: "redirectUrl=https%3A%2F%2Fcheckout.wirecard.com%2Fseamless%2Ffrontend%2FD200001qmore_DESKTOP%2Fselect.php%3FSID%3Dj5bk04off945jg6qv25imb1en4", headers: {})
80
+
81
+ stub_request(:post, "https://checkout.wirecard.com/seamless/frontend/init").
82
+ with(body: {"amount"=>"1000", "cancelUrl"=>"http://localhost.cancel.url", "confirmUrl"=>"http://localhost.confirm.url", "consumerIpAddress"=>"127.0.0.1", "consumerUserAgent"=>"some agent", "currency"=>"USD", "customerId"=>"D200001", "failureUrl"=>"http://localhost.failure.url", "language"=>"en", "orderDescription"=>"some description", "orderNumber"=>"1113051", "paymentType"=>"PAYPAL", "requestFingerprint"=>"96ba6c823b9d4a4f18cdd4b6eff062b951a91e70df0a61805a821dcd4640a84ff582ed79810887d0e96953d7d1ef7fd08844d9b9780e2ae8af0653a9a77c12b6", "requestFingerprintOrder"=>"customerId,shopId,orderNumber,language,currency,successUrl,failureUrl,cancelUrl,serviceUrl,confirmUrl,paymentType,amount,orderDescription,consumerIpAddress,consumerUserAgent,requestFingerprintOrder,secret", "serviceUrl"=>"http://localhost.service.url", "shopId"=>"qmore", "successUrl"=>"http://localhost.success.url"},
83
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'835', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
84
+ to_return(status: 200, body: "redirectUrl=https%3A%2F%2Fcheckout.wirecard.com%2Fseamless%2Ffrontend%2FD200001qmore_DESKTOP%2Fselect.php%3FSID%3D1ccoq6lf3euji7dk018sulomg6", headers: {})
85
+
86
+ stub_request(:post, "https://checkout.wirecard.com/seamless/frontend/init").
87
+ with(body: {"cancelUrl"=>"http://localhost.cancel.url", "confirmUrl"=>"http://localhost.confirm.url", "currency"=>true, "customerId"=>"D200001", "failureUrl"=>"http://localhost.failure.url", "language"=>"en", "orderNumber"=>"1113051", "requestFingerprint"=>"e830fb6a2fcd7ae6f00d3163fb8b9aef5bf2bbfc2ce0b203e51cd3e66925f266e1babc7715f7c93047b78bbf0b4bd0787b20589bdbab03efdeb00f011ddc5c30", "requestFingerprintOrder"=>"customerId,shopId,orderNumber,language,successUrl,failureUrl,cancelUrl,serviceUrl,confirmUrl,requestFingerprintOrder,secret", "serviceUrl"=>"http://localhost.service.url", "shopId"=>"qmore", "successUrl"=>"http://localhost.success.url"},
88
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'616', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
89
+ to_return(status: 200, body: "error.1.message=PAYMENTTYPE+is+missing.&error.1.consumerMessage=PAYMENTTYPE+is+missing.&error.1.errorCode=11051&error.2.message=Currency+is+missing.&error.2.consumerMessage=Currency+is+missing.&error.2.errorCode=11019&error.3.message=Order+description+is+missing.&error.3.consumerMessage=Order+description+is+missing.&error.3.errorCode=11020&error.4.message=Amount+is+missing.&error.4.consumerMessage=Amount+is+missing.&error.4.errorCode=11017&error.5.message=IP-Address+is+missing.&error.5.consumerMessage=IP-Address+is+missing.&error.5.errorCode=11146&error.6.message=USER_AGENT+is+missing.&error.6.consumerMessage=USER_AGENT+is+missing.&error.6.errorCode=11130&errors=6", headers: {})
90
+
91
+ ##### Wirecard::Backend::GetOrderDetails #####
92
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/getorderdetails").
93
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"4b5b4733bf2ec86456f180a75ed08eb7c0d3abbe8b3f834f313a5f35b8fe85fdf9568765f08cf8921be864764585d85a12357b9826e0f197255d69afc4155a45", "shopId"=>"qmore"},
94
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'228', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
95
+ to_return(status: 200, body: "payment.1.1.currency=EUR&payment.1.1.state=payment_approved&payment.1.1.orderNumber=23473341&payment.1.1.timeModified=30.07.2015+10%3A52%3A53&payment.1.1.merchantNumber=1&payment.1.1.timeCreated=30.07.2015+10%3A52%3A53&payment.1.1.depositAmount=0.00&payment.1.1.paymentType=VPG&payment.1.1.approvalCode=123456&payment.1.1.paymentNumber=23473341&payment.1.1.approveAmount=1.00&payment.1.1.operationsAllowed=DEPOSIT%2CAPPROVEREVERSAL&order.1.orderNumber=23473341&order.1.paymentType=VPG&order.1.brand=VISA&order.1.depositAmount=0&order.1.state=ORDERED&order.1.timeModified=30.07.2015+10%3A52%3A53&order.1.currency=EUR&order.1.contractNumber=0815DemoContract&order.1.orderDescription=Lisa+Kaufrausch%2C+K-Nr%3A+54435&order.1.payments=1&order.1.timeCreated=30.07.2015+10%3A52%3A53&order.1.orderReference=OR-23473341&order.1.refundAmount=0&order.1.acquirer=card+complete&order.1.customerStatement=Danke+f%C3%BCr+den+Einkauf%21&order.1.amount=1.00&order.1.credits=0&order.1.approveAmount=1.00&order.1.merchantNumber=1&objectsTotal=1&status=0&orders=1", headers: {})
96
+
97
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/getorderdetails").
98
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"56453412", "password"=>"jcv45z", "requestFingerprint"=>"512954a4d75c781d02c36504fe51f170470af50e1438bd61e757ed21d262072d1e292a3df96c5c4a5fcce7fdb24b25be211346692175ec6ebe09f574f2e7d478", "shopId"=>"qmore"},
99
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'228', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
100
+ to_return(:status => 200, :body => "payment.1.1.currency=EUR&payment.1.1.state=payment_approved&payment.1.1.orderNumber=56453412&payment.1.1.timeModified=30.07.2015+11%3A20%3A53&payment.1.1.merchantNumber=1&payment.1.1.timeCreated=30.07.2015+11%3A20%3A53&payment.1.1.depositAmount=0.00&payment.1.1.paymentType=APG&payment.1.1.approvalCode=123456&payment.1.1.paymentNumber=56453412&payment.1.1.approveAmount=1.00&payment.1.1.operationsAllowed=DEPOSIT%2CAPPROVEREVERSAL&order.1.orderNumber=56453412&order.1.paymentType=APG&order.1.brand=MasterCard&order.1.depositAmount=0&order.1.state=ORDERED&order.1.timeModified=30.07.2015+11%3A20%3A53&order.1.currency=EUR&order.1.contractNumber=0815DemoContract&order.1.orderDescription=Max+Mustermann%2C+K-Nr%3A+12345&order.1.payments=1&order.1.timeCreated=30.07.2015+11%3A20%3A53&order.1.orderReference=OR-56453412&order.1.refundAmount=0&order.1.acquirer=PayLife&order.1.customerStatement=Danke+f%C3%BCr+den+Einkauf%21&order.1.amount=1.00&order.1.credits=0&order.1.approveAmount=1.00&order.1.merchantNumber=1&objectsTotal=1&status=0&orders=1", :headers => {})
101
+
102
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/getorderdetails").
103
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"543132154", "password"=>"jcv45z", "requestFingerprint"=>"865d590cfa0b89587893ce64fb510977b1c49e81d47c6591c887a7470cc85828022034f262dbfcc8aadad6a2e269e4f85eb836427ece3699cf4d898364502dbb", "shopId"=>"qmore"},
104
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'229', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
105
+ to_return(status: 200, body: "payment.1.1.currency=EUR&payment.1.1.state=payment_deposited&payment.1.1.senderAccountOwner=Test+Consumer&payment.1.1.timeModified=30.07.2015+11%3A32%3A49&payment.1.1.merchantNumber=1&payment.1.1.timeCreated=30.07.2015+11%3A32%3A49&payment.1.1.senderIBAN=DE0000000000000000&payment.1.1.depositAmount=1.00&payment.1.1.senderBIC=PNAGDE00000&payment.1.1.senderBankName=Test+Bank&payment.1.1.senderBankNumber=1234578&payment.1.1.approvalCode=00000-00000-AAAAAAAA-BBBB&payment.1.1.senderCountry=DE&payment.1.1.orderNumber=543132154&payment.1.1.paymentType=SUE&payment.1.1.securityCriteria=1&payment.1.1.paymentNumber=543132154&payment.1.1.approveAmount=1.00&payment.1.1.senderAccountNumber=1234567890&payment.1.1.batchNumber=131&order.1.brand=sofortueberweisung&order.1.paymentType=SUE&order.1.state=ORDERED&order.1.currency=EUR&order.1.orderDescription=F.+Realtime%2C+K-Nr%3A+12111&order.1.orderReference=OR-543132154&order.1.refundAmount=0&order.1.customerStatement=Danke+f%C3%BCr+den+Einkauf%21&order.1.orderNumber=543132154&order.1.depositAmount=1.00&order.1.timeModified=30.07.2015+11%3A32%3A49&order.1.contractNumber=1234%2F1234&order.1.payments=1&order.1.timeCreated=30.07.2015+11%3A32%3A49&order.1.amount=1.00&order.1.credits=0&order.1.approveAmount=0&order.1.merchantNumber=1&objectsTotal=1&status=0&orders=1", headers: {})
106
+
107
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/getorderdetails").
108
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"3485464", "password"=>"jcv45z", "requestFingerprint"=>"c057221a6a402100f70f2ab519b71f047fe15d0e3b20d3777c0a6620682efde52c0902c321dca0185bd72f461acfc5634ecd6ab14c1791e316883a31d8560f42", "shopId"=>"qmore"},
109
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'227', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
110
+ to_return(status: 200, body: "payment.1.1.currency=EUR&payment.1.1.state=payment_deposited&payment.1.1.timeModified=30.07.2015+11%3A41%3A37&payment.1.1.paypalPayerAddressStatus=unverified&payment.1.1.merchantNumber=1&payment.1.1.timeCreated=30.07.2015+11%3A41%3A37&payment.1.1.paypalPayerAddressState=Musterland&payment.1.1.depositAmount=1.00&payment.1.1.approvalCode=4PW61566G53703003&payment.1.1.paypalPayerAddressCountry=AT&payment.1.1.paypalPayerFirstName=Test&payment.1.1.orderNumber=3485464&payment.1.1.paypalPayerEmail=buyer%40paypal.com&payment.1.1.paypalPayerLastName=Consumer&payment.1.1.paymentType=PPL&payment.1.1.paypalPayerAddressCity=Musterstadt&payment.1.1.paypalPayerAddressZIP=1234&payment.1.1.paypalProtectionEligibility=ExtendedCustomerProtection&payment.1.1.paymentNumber=3485464&payment.1.1.approveAmount=1.00&payment.1.1.paypalPayerID=PAYER123456ID&payment.1.1.batchNumber=129&order.1.brand=PayPal&order.1.paymentType=PPL&order.1.state=ORDERED&order.1.currency=EUR&order.1.orderDescription=E.+Bay%2C+K-Nr%3A+55266&order.1.orderReference=OR-3485464&order.1.refundAmount=0&order.1.customerStatement=Danke+f%C3%BCr+den+Einkauf%21&order.1.orderNumber=3485464&order.1.depositAmount=1.00&order.1.timeModified=30.07.2015+11%3A41%3A37&order.1.contractNumber=mail%40shop.com&order.1.payments=1&order.1.timeCreated=30.07.2015+11%3A41%3A37&order.1.amount=1.00&order.1.credits=0&order.1.approveAmount=0&order.1.merchantNumber=1&objectsTotal=1&status=0&orders=1", headers: {})
111
+
112
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/getorderdetails").
113
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"123456789", "password"=>"jcv45z", "requestFingerprint"=>"05590300ee16cd890e900bb45923b9f950d4d1743ec9b335f20da86f8c9ec9838882f49736fef09a47560a8462d0833c05d0aa978c32fe9adcc4086f95c4751f", "shopId"=>"qmore"},
114
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'229', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
115
+ to_return(status: 200, body: "status=0&objectsTotal=0&orders=0", headers: {})
116
+
117
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/getorderdetails").
118
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"dfd315b6687aa1f213450008cb3932b29c23601097a0f1a120377938149c3be84e54dafd36e7cf75385e6f356cff79f1a084712d099bedeb2735e63df861b2c5", "shopId"=>"qmore"},
119
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'207', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
120
+ to_return(status: 200, body: "error.1.consumer_message=Order+number+is+missing.&error.1.error_code=11011&error.1.message=Order+number+is+missing.&errors=1&status=1", headers: {})
121
+
122
+ ##### Wirecard::Backend::Deposit #####
123
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/deposit").
124
+ with(body: {"amount"=>"1000", "currency"=>"EUR", "customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"db96723ef9e69e323a63d65f634c03badaa7e373f8ca65f1e764162464e28414e476072aca98b7ae2aee7dd045b52abd102b3f74b3a6d72223ca51f105368792", "shopId"=>"qmore"},
125
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'253', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
126
+ to_return(status: 200, body: "paymentNumber=23473341&status=0", headers: {})
127
+
128
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/deposit").
129
+ with(body: {"currency"=>"EUR", "customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"8f998a36a3060d88970dd90b648aafec16ecc11db82c60f84dd636e1bb0a976b11a93b5f204d84e426356c6c0bdad8514c954e56ad351fcbcb12c5484cc6002f", "shopId"=>"qmore"},
130
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'241', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
131
+ to_return(status: 200, body: "error.1.errorCode=11017&error.1.message=Amount+is+missing.&error.1.consumerMessage=Amount+is+missing.&errors=1&status=1", headers: {})
132
+
133
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/deposit").
134
+ with(body: {"amount"=>"1000", "customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"fbd960f2ed92db219ee1c85790bda0b7c591e0d7b004d8cf1a4a554f112b33a02ee13203e62d53395f80dbc10c6b98f070dbb5b03084387deacc3689f8143753", "shopId"=>"qmore"},
135
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'240', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
136
+ to_return(status: 200, body: "error.1.errorCode=11019&error.1.message=Currency+is+missing.&error.1.consumerMessage=Currency+is+missing.&errors=1&status=1", headers: {})
137
+
138
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/deposit").
139
+ with(body: {"amount"=>"1000", "currency"=>"EUR", "customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"85482e191e98ba78be9699348a51a0b848efafe60d7afc3cb091ad33cf0fb487838096540bbf3c7201b4c9bd0a1a897a5d9e3b440243cc2ee5a22114d585ddf5", "shopId"=>"qmore"},
140
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'232', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
141
+ to_return(status: 200, body: "error.1.errorCode=11011&error.1.message=Order+number+is+missing.&error.1.consumerMessage=Order+number+is+missing.&errors=1&status=1", headers: {})
142
+
143
+ ##### Wirecard::Backend::DepositReversal #####
144
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/depositreversal").
145
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "paymentNumber"=>"23473341", "requestFingerprint"=>"51b6ba02b404a79a3ae20b60d8f37c8756be90940e6b7ee5f1399eb541ad26839b06a880959a6837cad9c694b8f44974a8855e5cbdc04cd95337352f2cd53f12", "shopId"=>"qmore"},
146
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'251', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
147
+ to_return(status: 200, body: "status=0", headers: {})
148
+
149
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/depositreversal").
150
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"4b5b4733bf2ec86456f180a75ed08eb7c0d3abbe8b3f834f313a5f35b8fe85fdf9568765f08cf8921be864764585d85a12357b9826e0f197255d69afc4155a45", "shopId"=>"qmore"},
151
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'228', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
152
+ to_return(status: 200, body: "error.1.errorCode=11012&error.1.message=Payment+number+is+missing.&error.1.consumerMessage=Payment+number+is+missing.&errors=1&status=1", headers: {})
153
+
154
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/depositreversal").
155
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "paymentNumber"=>"23473341", "requestFingerprint"=>"4b5b4733bf2ec86456f180a75ed08eb7c0d3abbe8b3f834f313a5f35b8fe85fdf9568765f08cf8921be864764585d85a12357b9826e0f197255d69afc4155a45", "shopId"=>"qmore"},
156
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'230', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
157
+ to_return(status: 200, body: "error.1.errorCode=11011&error.1.message=Order+number+is+missing.&error.1.consumerMessage=Order+number+is+missing.&errors=1&status=1", headers: {})
158
+
159
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/depositreversal").
160
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"dfd315b6687aa1f213450008cb3932b29c23601097a0f1a120377938149c3be84e54dafd36e7cf75385e6f356cff79f1a084712d099bedeb2735e63df861b2c5", "shopId"=>"qmore"},
161
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'207', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
162
+ to_return(status: 200, body: "error.1.errorCode=11011&error.1.message=Order+number+is+missing.&error.1.consumerMessage=Order+number+is+missing.&error.2.errorCode=11012&error.2.message=Payment+number+is+missing.&error.2.consumerMessage=Payment+number+is+missing.&errors=2&status=1", headers: {})
163
+
164
+ ##### Wirecard::Backend::GenerateOrderNumber #####
165
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/generateordernumber").
166
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"dfd315b6687aa1f213450008cb3932b29c23601097a0f1a120377938149c3be84e54dafd36e7cf75385e6f356cff79f1a084712d099bedeb2735e63df861b2c5", "shopId"=>"qmore"},
167
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'207', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
168
+ to_return(status: 200, body: "status=0&orderNumber=1113051", headers: {})
169
+
170
+ ##### Wirecard::Backend::ApproveReversal #####
171
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/approvereversal").
172
+ with(body: {"customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"4b5b4733bf2ec86456f180a75ed08eb7c0d3abbe8b3f834f313a5f35b8fe85fdf9568765f08cf8921be864764585d85a12357b9826e0f197255d69afc4155a45", "shopId"=>"qmore"},
173
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'228', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
174
+ to_return(status: 200, body: "status=0", headers: {})
175
+
176
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/approvereversal").
177
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"dfd315b6687aa1f213450008cb3932b29c23601097a0f1a120377938149c3be84e54dafd36e7cf75385e6f356cff79f1a084712d099bedeb2735e63df861b2c5", "shopId"=>"qmore"},
178
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'207', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
179
+ to_return(status: 200, body: "error.1.errorCode=11011&error.1.message=Order+number+is+missing.&error.1.consumerMessage=Order+number+is+missing.&errors=1&status=1", headers: {})
180
+
181
+ ##### Wirecard::Backend::RecurPayment #####
182
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/recurpayment").
183
+ with(body: {"amount"=>"1000", "autoDeposit"=>"Yes", "currency"=>"EUR", "customerId"=>"D200001", "customerStatement"=>"some statement", "language"=>"en", "orderDescription"=>"some description", "orderNumber"=>"23473341", "orderReference"=>"MercantID_X345456", "password"=>"jcv45z", "requestFingerprint"=>"aceb23e9015a4b84fbafd0e0498d526c7e92ca4e7a96fe4ca7c042852271d46e8c54dd217eb1ddaf3a343f9f170fb52629e4a91b8fabd9f13e6c4b2df0077b6f", "shopId"=>"qmore", "sourceOrderNumber"=>"23473341"},
184
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'396', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
185
+ to_return(status: 200, body: "status=0&orderNumber=23473341", headers: {})
186
+
187
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/recurpayment").
188
+ with(body: {"autoDeposit"=>"Yes", "customerId"=>"D200001", "customerStatement"=>"some statement", "language"=>"en", "orderNumber"=>"23473341", "orderReference"=>"MercantID_X345456", "password"=>"jcv45z", "requestFingerprint"=>"a2170fe58a24491b64e57fe08c18f9711faa819051cdae13cabb85c46a93d6fc844abb9fa85857d02d806caf6a54e4b74ab89487b35564deafce432a30de9609", "shopId"=>"qmore"},
189
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'310', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
190
+ to_return(status: 200, body: "error.1.errorCode=11159&error.1.message=Source+ORDERNUMBER+is+missing.&error.1.consumerMessage=Source+ORDERNUMBER+is+missing.&error.2.errorCode=11020&error.2.message=Order+description+is+missing.&error.2.consumerMessage=Order+description+is+missing.&error.3.errorCode=11017&error.3.message=Amount+is+missing.&error.3.consumerMessage=Amount+is+missing.&error.4.errorCode=11019&error.4.message=Currency+is+missing.&error.4.consumerMessage=Currency+is+missing.&errors=4&status=1", headers: {})
191
+
192
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/recurpayment").
193
+ with(body: {"amount"=>"1000", "currency"=>"EUR", "customerId"=>"D200001", "language"=>"en", "orderDescription"=>"some description", "password"=>"jcv45z", "requestFingerprint"=>"aa3ea63cc812e30d1b2a412e8e24dbc26d3379dbe1b7c5ca672cc67d42aa45e0dc8454e5de07635aa3514449ff3bb7792d40ecc086a0a7c252119380cc738f40", "shopId"=>"qmore", "sourceOrderNumber"=>"23473341"},
194
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'293', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
195
+ to_return(status: 200, body: "status=0&orderNumber=23473341", headers: {})
196
+
197
+ ##### Wirecard::Backend::Refund #####
198
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/refund").
199
+ with(body: {"amount"=>"1000", "currency"=>"EUR", "customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"db96723ef9e69e323a63d65f634c03badaa7e373f8ca65f1e764162464e28414e476072aca98b7ae2aee7dd045b52abd102b3f74b3a6d72223ca51f105368792", "shopId"=>"qmore"},
200
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'253', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
201
+ to_return(status: 200, body: "creditNumber=14949449&status=0", headers: {})
202
+
203
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/refund").
204
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"dfd315b6687aa1f213450008cb3932b29c23601097a0f1a120377938149c3be84e54dafd36e7cf75385e6f356cff79f1a084712d099bedeb2735e63df861b2c5", "shopId"=>"qmore"},
205
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'207', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
206
+ to_return(status: 200, body: "error.1.errorCode=11011&error.1.message=Order+number+is+missing.&error.1.consumerMessage=Order+number+is+missing.&error.2.errorCode=11019&error.2.message=Currency+is+missing.&error.2.consumerMessage=Currency+is+missing.&error.3.errorCode=11017&error.3.message=Amount+is+missing.&error.3.consumerMessage=Amount+is+missing.&errors=3&status=1", headers: {})
207
+
208
+
209
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/refundreversal").
210
+ with(body: {"creditNumber"=>"14949449", "customerId"=>"D200001", "language"=>"en", "orderNumber"=>"23473341", "password"=>"jcv45z", "requestFingerprint"=>"4f92a11fb765e115e9c7e2e89ff1b08692fb61f7cce1aac88ab5afec4dc61d9d76ff1e72ccd18b836232177df29c03f5e4416c61c7954275e5a8fe9026545e5c", "shopId"=>"qmore"},
211
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'250', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
212
+ to_return(status: 200, body: "status=0", headers: {})
213
+
214
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/refundreversal").
215
+ with(body: {"customerId"=>"D200001", "language"=>"en", "password"=>"jcv45z", "requestFingerprint"=>"dfd315b6687aa1f213450008cb3932b29c23601097a0f1a120377938149c3be84e54dafd36e7cf75385e6f356cff79f1a084712d099bedeb2735e63df861b2c5", "shopId"=>"qmore"},
216
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'207', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
217
+ to_return(status: 200, body: "error.1.errorCode=11011&error.1.message=Order+number+is+missing.&error.1.consumerMessage=Order+number+is+missing.&error.2.errorCode=11013&error.2.message=Credit+number+is+missing.&error.2.consumerMessage=Credit+number+is+missing.&errors=2&status=1", headers: {})
218
+
219
+ ##### Wirecard::Backend::TransferFund::ExistingOrder #####
220
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/transferfund").
221
+ with(body: {"amount"=>"1000", "creditNumber"=>"14949449", "currency"=>"EUR", "customerId"=>"D200001", "customerStatement"=>"invoice text", "fundTransferType"=>"EXISTINGORDER", "language"=>"en", "orderDescription"=>"some description", "orderNumber"=>"56453412", "orderReference"=>"MercantID F34545", "password"=>"jcv45z", "requestFingerprint"=>"9514833a4bc44c6c13c320a04ae55d4ae1dabf6c99645f01658dd6f6370f49f8806de59e7dbdb1f8b75994e57e011c347d7908650164955b43f28a7a8d11127b", "shopId"=>"qmore", "sourceOrderNumber"=>"23473341"},
222
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'430', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
223
+ to_return(status: 200, body: "status=0&creditNumber=14949449", headers: {})
224
+
225
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/transferfund").
226
+ with(body: {"amount"=>"1000", "currency"=>"EUR", "customerId"=>"D200001", "fundTransferType"=>"EXISTINGORDER", "language"=>"en", "orderDescription"=>"some description", "password"=>"jcv45z", "requestFingerprint"=>"403782c9e852642fd0dbdbf21ca741c92f1c7df7ab18aece4cec68171d5d9cc59647a56aa539714228413e582973a9c7e31f79036d02bcf77ae2af289d4d662d", "shopId"=>"qmore", "sourceOrderNumber"=>"23473341"},
227
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'324', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
228
+ to_return(status: 200, body: "status=0&creditNumber=14949449", headers: {})
229
+
230
+ stub_request(:post, "https://checkout.wirecard.com/seamless/backend/transferfund").
231
+ with(body: {"creditNumber"=>"14949449", "customerId"=>"D200001", "customerStatement"=>"invoice text", "language"=>"en", "orderNumber"=>"56453412", "orderReference"=>"MercantID F34545", "password"=>"jcv45z", "requestFingerprint"=>"8e12d164fd45310ba0772e9c81c0362fb133ee9a137a2071acba359f1608c687e046604e8f58988c84c6d1bed1949c3ef437cad13599287b5801529445838b83", "shopId"=>"qmore"},
232
+ headers: {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Connection'=>'close', 'Content-Length'=>'313', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'checkout.wirecard.com', 'User-Agent'=>'### User Agent ###'}).
233
+ to_return(status: 200, body: "error.1.errorCode=11017&error.1.message=Amount+is+missing.&error.1.consumerMessage=Amount+is+missing.&error.2.errorCode=11019&error.2.message=Currency+is+missing.&error.2.consumerMessage=Currency+is+missing.&error.3.errorCode=11020&error.3.message=Order+description+is+missing.&error.3.consumerMessage=Order+description+is+missing.&error.4.errorCode=11216&error.4.message=FUNDTRANSFERTYPE+is+missing.&error.4.consumerMessage=FUNDTRANSFERTYPE+is+missing.&errors=4&status=1", headers: {})
234
+ end
235
+ end
@@ -1,35 +1,9 @@
1
- RSpec.shared_examples 'configuration' do
2
- let(:default_config) { {
3
- host: 'checkout.wirecard.com',
4
- endpoint: 'https://checkout.wirecard.com/seamless',
5
- customer_id: 'D200001',
6
- shop_id: 'qmore',
7
- secret: 'B8AKTPWBRMNBV455FG6M2DANE99WU2',
8
- success_url: 'http://localhost.success.url',
9
- failure_url: 'http://localhost.failure.url',
10
- cancel_url: 'http://localhost.cancel.url',
11
- service_url: 'http://localhost.service.url',
12
- confirm_url: 'http://localhost.confirm.url',
13
- return_url: 'http://localhost.return.url',
14
- language: 'en'
15
- } }
16
-
17
- before do
18
- Wirecard.configure do |config|
19
- binding.pry
20
- config.host = config[:host]
21
- config.endpoint = config[:endpoint]
22
- config.customer_id = config[:customer_id]
23
- config.shop_id = config[:shop_id]
24
- config.secret = config[:secret]
25
- config.success_url = config[:success_url]
26
- config.failure_url = config[:failure_url]
27
- config.cancel_url = config[:cancel_url]
28
- config.service_url = config[:service_url]
29
- config.confirm_url = config[:confirm_url]
30
- config.return_url = config[:return_url]
31
- config.language = config[:language]
32
- end
33
- end
1
+ RSpec.shared_examples 'Wirecard::Base#defaults' do
2
+ it { expect(subject[:customer_id]).to eq(config[:customer_id]) }
3
+ it { expect(subject[:shop_id]).to eq(config[:shop_id]) }
34
4
  end
35
5
 
6
+ RSpec.shared_examples 'Wirecard::Backend::Base#defaults' do
7
+ it { expect(subject[:password]).to eq(config[:password]) }
8
+ it { expect(subject[:language]).to eq(config[:language]) }
9
+ end