wirecard_sepa 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61250ea6cf2f1c321deed60a0ccef9f795026c4c
4
- data.tar.gz: d7a623352e27ef25e428655646aad1fc6d6cb700
3
+ metadata.gz: 7e83046b3f57557e44d08a6a2df2dec954a28c91
4
+ data.tar.gz: 0d6756bc2a7b42e13f19f0ab6e3d171459657c65
5
5
  SHA512:
6
- metadata.gz: 1dfa320d0471b1c4d0cbca473abee2eb30638e31945e50941993ad9af3e4260de3aabf7ec142e9d1c777da26d97e41083ca825ac4b514199d1785375b2422545
7
- data.tar.gz: 3d25629dea2b7731c08c63851c92162231b5e4b51f40c24e63dd4db1fa1a42699fa2d9a1f7720142b14d7db908ec3cec6ea6c4bb31188963b1d2942905212c1f
6
+ metadata.gz: c41241a3374124c0e4a98a02340b86ef0fa6b941a076299e85c577c260579e998f140752ee2871fc6ff3f52170d3ea71aeeb7b5e248506510f96f022f1fc6807
7
+ data.tar.gz: 74192be4200efacdff1967bd89b00040fdf9ed6e9baae113276494a77dcf859d8fdcb55b5df2a59d7415daf000f9e669f2ad8992f8ce351818305276abc5541b
data/README.md CHANGED
@@ -31,7 +31,7 @@ response.success?
31
31
 
32
32
  ## TODOS
33
33
  - [x] Simple error handling
34
- - [ ] Docs for usage in README.md
34
+ - [x] Docs for usage in README.md
35
35
 
36
36
  ## Contributing
37
37
  1. Fork it ( https://github.com/betterplace/wirecard_sepa/fork )
@@ -8,6 +8,7 @@
8
8
  <last-name>{{ACCOUNT_HOLDER_LAST_NAME}}</last-name>
9
9
  </account-holder>
10
10
  <order-number>{{ORDER_NUMBER}}</order-number>
11
+ {{CUSTOM_FIELDS}}
11
12
  <payment-methods>
12
13
  <payment-method name="sepadirectdebit"/>
13
14
  </payment-methods>
@@ -17,7 +17,9 @@ module WirecardSepa
17
17
  def expected_params
18
18
  %i( merchant_account_id request_id requested_amount
19
19
  account_holder_first_name account_holder_last_name bank_account_iban
20
- bank_account_bic mandate_id mandate_signed_date creditor_id order_number )
20
+ bank_account_bic mandate_id mandate_signed_date creditor_id order_number
21
+ custom_fields
22
+ )
21
23
  end
22
24
  end
23
25
  end
@@ -16,21 +16,13 @@ module WirecardSepa
16
16
  end
17
17
 
18
18
  def debit(params)
19
- request_params = params.merge({
20
- merchant_account_id: config.merchant_account_id,
21
- creditor_id: config.creditor_id,
22
- request_id: request_id,
23
- })
19
+ request_params = add_auth_params_and_custom_fields(params)
24
20
  request_xml = DirectDebit::Request.new(request_params).to_xml
25
21
  DirectDebit::Response.for_request post(request_xml)
26
22
  end
27
23
 
28
24
  def recurring_init(params)
29
- request_params = params.merge({
30
- merchant_account_id: config.merchant_account_id,
31
- creditor_id: config.creditor_id,
32
- request_id: request_id,
33
- })
25
+ request_params = add_auth_params_and_custom_fields(params)
34
26
  request_xml = Recurring::FirstRequest.new(request_params).to_xml
35
27
  Recurring::FirstResponse.for_request post(request_xml)
36
28
  end
@@ -55,6 +47,14 @@ module WirecardSepa
55
47
  )
56
48
  end
57
49
 
50
+ def add_auth_params_and_custom_fields(params)
51
+ { custom_fields: {} }.merge(params).merge({
52
+ merchant_account_id: config.merchant_account_id,
53
+ creditor_id: config.creditor_id,
54
+ request_id: request_id
55
+ })
56
+ end
57
+
58
58
  def request_id
59
59
  # From the Wirecard processing spec:
60
60
  # Type: Alphanumeric, Length: 150
@@ -17,7 +17,9 @@ module WirecardSepa
17
17
  def expected_params
18
18
  %i( merchant_account_id request_id requested_amount
19
19
  account_holder_first_name account_holder_last_name bank_account_iban
20
- bank_account_bic mandate_id mandate_signed_date creditor_id order_number )
20
+ bank_account_bic mandate_id mandate_signed_date creditor_id order_number
21
+ custom_fields
22
+ )
21
23
  end
22
24
  end
23
25
  end
@@ -9,15 +9,19 @@ module WirecardSepa
9
9
 
10
10
  def to_xml
11
11
  xml_template = File.open template_path, "r:UTF-8", &:read
12
- xml_template.gsub(/{{\w+}}/, request_params)
12
+ xml_template.gsub(/{{\w+}}/, request_params)#.tap { byebug }
13
13
  end
14
14
 
15
15
  private
16
16
 
17
17
  def request_params
18
- request.params.each_with_object({}) do |(k,v), h|
18
+ params_without_custom_fields.each_with_object({}) do |(k,v), h|
19
19
  h["{{#{k.upcase}}}"] = v
20
- end
20
+ end.merge('{{CUSTOM_FIELDS}}' => custom_fields_xml)
21
+ end
22
+
23
+ def params_without_custom_fields
24
+ request.params.reject { |k,_| k == :custom_fields }
21
25
  end
22
26
 
23
27
  def template_path
@@ -30,6 +34,18 @@ module WirecardSepa
30
34
  gsub('::_', '/').
31
35
  downcase + '.xml'
32
36
  end
37
+
38
+ def custom_fields_xml
39
+ # TODO: Refactor me :>
40
+ custom_fields = request.params[:custom_fields] || Hash.new
41
+ return '' if custom_fields.empty?
42
+ fields_xml = custom_fields.map do |k,v|
43
+ " <custom-field field-name=\"#{k}\" field-value=\"#{v}\"/>\n"
44
+ end.join.to_s
45
+ '<custom-fields>' "\n" +
46
+ " #{fields_xml}" +
47
+ ' </custom-fields>'
48
+ end
33
49
  end
34
50
  end
35
51
  end
@@ -1,3 +1,3 @@
1
1
  module WirecardSepa
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -15,6 +15,9 @@ describe WirecardSepa::DirectDebit::Request do
15
15
  mandate_id: '12345678',
16
16
  mandate_signed_date: '2013-09-24',
17
17
  creditor_id: 'DE98ZZZ09999999999',
18
+ custom_fields: {
19
+ "Company Name" => "gut.org"
20
+ }
18
21
  }
19
22
  end
20
23
 
@@ -28,7 +31,7 @@ describe WirecardSepa::DirectDebit::Request do
28
31
 
29
32
  describe '#to_xml' do
30
33
  it 'builds the correct xml' do
31
- expected_xml = read_support_file('direct_debit/success/request.xml')
34
+ expected_xml = read_support_file('direct_debit/success/request_with_custom_fields.xml')
32
35
  expect(subject.to_xml).to eq expected_xml
33
36
  end
34
37
 
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ describe WirecardSepa::DirectDebit::Request do
4
+ subject { described_class.new(params) }
5
+ let(:params) do
6
+ {
7
+ order_number: 666,
8
+ merchant_account_id: 'eefc804c-f9d3-43a8-bd15-a1c92de10000',
9
+ request_id: '7f55aacb-3e15-4185-b80f-1e0ad5b51d6c',
10
+ requested_amount: '10.01',
11
+ account_holder_first_name: 'John',
12
+ account_holder_last_name: 'Doe',
13
+ bank_account_iban: 'DE42512308000000060004',
14
+ bank_account_bic: 'WIREDEMMXXX',
15
+ mandate_id: '12345678',
16
+ mandate_signed_date: '2013-09-24',
17
+ creditor_id: 'DE98ZZZ09999999999',
18
+ custom_fields: {
19
+ 'Company Name' => 'gut.org'
20
+ }
21
+ }
22
+ end
23
+
24
+ describe '#to_xml' do
25
+ it 'builds the correct xml' do
26
+ expected_xml = read_support_file('direct_debit/success/request_with_custom_fields.xml')
27
+ expect(subject.to_xml).to eq expected_xml
28
+ end
29
+
30
+ it 'builds a valid request' do
31
+ xsd = Nokogiri::XML::Schema(read_support_file('payment.xsd'))
32
+ doc = Nokogiri::XML(subject.to_xml)
33
+ errors = xsd.validate(doc)
34
+ expect(errors).to be_empty
35
+ end
36
+ end
37
+ end
@@ -4,69 +4,86 @@ require 'spec_helper'
4
4
  # [x] Record response from wirecard w/ VCR
5
5
  describe WirecardSepa::Gateway do
6
6
  let(:gateway) { described_class.new(sandbox_gateway_config) }
7
- let(:debit_params) do
8
- {
9
- requested_amount: '12.12',
10
- account_holder_first_name: 'John',
11
- account_holder_last_name: 'Doe',
12
- bank_account_iban: 'DE42512308000000060004',
13
- bank_account_bic: 'WIREDEMMXXX',
14
- mandate_id: '1235678',
15
- mandate_signed_date: '2013-09-24',
16
- order_number: 666,
17
- }
18
- end
19
- let(:recurring_init_params) do
20
- {
21
- requested_amount: '15.00',
22
- account_holder_first_name: 'Bob',
23
- account_holder_last_name: 'Hawk',
24
- bank_account_iban: 'DE42512308000000060004',
25
- bank_account_bic: 'WIREDEMMXXX',
26
- mandate_id: '2356789',
27
- mandate_signed_date: '2013-08-11',
28
- order_number: 666,
29
- }
30
- end
31
- THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30
32
7
 
33
8
  describe '#debit(params)' do
9
+ let(:debit_params) do
10
+ {
11
+ requested_amount: '12.12',
12
+ account_holder_first_name: 'John',
13
+ account_holder_last_name: 'Doe',
14
+ bank_account_iban: 'DE42512308000000060004',
15
+ bank_account_bic: 'WIREDEMMXXX',
16
+ mandate_id: '1235678',
17
+ mandate_signed_date: '2013-09-24',
18
+ order_number: 666,
19
+ custom_fields: {
20
+ 'Company Name' => 'gut.org'
21
+ }
22
+ }
23
+ end
24
+
34
25
  it 'posts the correct XML' do
35
- VCR.use_cassette 'gateway.debit', re_record_interval: THIRTY_DAYS_IN_SECONDS do
26
+ VCR.use_cassette 'gateway.debit' do
36
27
  response = gateway.debit(debit_params)
37
28
  expect(response).to be_success
38
29
  expect(response.params).to_not be_empty
39
30
  expect(response.transaction_id).to_not be_empty
40
31
  end
41
32
  end
42
- end
33
+ end # describe
43
34
 
44
35
  describe '#recurring_init(params)' do
36
+ let(:recurring_init_params) do
37
+ {
38
+ requested_amount: '15.00',
39
+ account_holder_first_name: 'Bob',
40
+ account_holder_last_name: 'Hawk',
41
+ bank_account_iban: 'DE42512308000000060004',
42
+ bank_account_bic: 'WIREDEMMXXX',
43
+ mandate_id: '2356789',
44
+ mandate_signed_date: '2013-08-11',
45
+ order_number: 666,
46
+ }
47
+ end
48
+
45
49
  it 'posts the correct XML' do
46
- VCR.use_cassette 'gateway.recurring_init', re_record_interval: THIRTY_DAYS_IN_SECONDS do
50
+ VCR.use_cassette 'gateway.recurring_init' do
47
51
  response = gateway.recurring_init(recurring_init_params)
48
52
  expect(response).to be_success
49
53
  expect(response.params).to_not be_empty
50
54
  expect(response.transaction_id).to_not be_empty
51
55
  end
52
56
  end
53
- end
57
+ end # describe
54
58
 
55
59
  describe '#recurring_process(params)' do
60
+ let(:recurring_init_params) do
61
+ {
62
+ requested_amount: '15.00',
63
+ account_holder_first_name: 'Bob',
64
+ account_holder_last_name: 'Hawk',
65
+ bank_account_iban: 'DE42512308000000060004',
66
+ bank_account_bic: 'WIREDEMMXXX',
67
+ mandate_id: '2356789',
68
+ mandate_signed_date: '2013-08-11',
69
+ order_number: 666,
70
+ }
71
+ end
72
+
56
73
  let(:parent_transaction_id) do
57
- VCR.use_cassette 'gateway.recurring_process/init', re_record_interval: THIRTY_DAYS_IN_SECONDS do
74
+ VCR.use_cassette 'gateway.recurring_process/init' do
58
75
  init_response = gateway.recurring_init(recurring_init_params)
59
76
  init_response.transaction_id
60
77
  end
61
78
  end
62
79
 
63
80
  it 'posts the correct XML' do
64
- VCR.use_cassette 'gateway.recurring_process', re_record_interval: THIRTY_DAYS_IN_SECONDS do
81
+ VCR.use_cassette 'gateway.recurring_process' do
65
82
  response = gateway.recurring_process({ parent_transaction_id: parent_transaction_id })
66
83
  expect(response).to be_success
67
84
  expect(response.params).to_not be_empty
68
85
  expect(response.transaction_id).to_not be_empty
69
86
  end
70
87
  end
71
- end
88
+ end # describe
72
89
  end
@@ -15,6 +15,7 @@ describe WirecardSepa::Recurring::FirstRequest do
15
15
  mandate_signed_date: '2013-12-19',
16
16
  creditor_id: 'DE98ZZZ09999999999',
17
17
  order_number: 666,
18
+ custom_fields: {}
18
19
  }
19
20
  end
20
21
 
data/spec/spec_helper.rb CHANGED
@@ -24,6 +24,14 @@ def sandbox_gateway_config
24
24
  end
25
25
 
26
26
  VCR.configure do |config|
27
+ cache_timeout = if ENV['CACHE'] == '0'
28
+ 1
29
+ else
30
+ THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30
31
+ end
32
+ config.default_cassette_options = {
33
+ re_record_interval: cache_timeout
34
+ }
27
35
  config.cassette_library_dir = "spec/support/fixtures/vcr"
28
36
  config.hook_into :typhoeus
29
37
  end
@@ -0,0 +1,27 @@
1
+ <payment xmlns="http://www.elastic-payments.com/schema/payment">
2
+ <merchant-account-id>eefc804c-f9d3-43a8-bd15-a1c92de10000</merchant-account-id>
3
+ <request-id>7f55aacb-3e15-4185-b80f-1e0ad5b51d6c</request-id>
4
+ <transaction-type>pending-debit</transaction-type>
5
+ <requested-amount currency="EUR">10.01</requested-amount>
6
+ <account-holder>
7
+ <first-name>John</first-name>
8
+ <last-name>Doe</last-name>
9
+ </account-holder>
10
+ <order-number>666</order-number>
11
+ <custom-fields>
12
+ <custom-field field-name="Company Name" field-value="gut.org"/>
13
+ </custom-fields>
14
+ <payment-methods>
15
+ <payment-method name="sepadirectdebit"/>
16
+ </payment-methods>
17
+ <bank-account>
18
+ <iban>DE42512308000000060004</iban>
19
+ <bic>WIREDEMMXXX</bic>
20
+ </bank-account>
21
+ <mandate>
22
+ <mandate-id>12345678</mandate-id>
23
+ <signed-date>2013-09-24</signed-date>
24
+ </mandate>
25
+ <creditor-id>DE98ZZZ09999999999</creditor-id>
26
+ </payment>
27
+
@@ -8,13 +8,17 @@ http_interactions:
8
8
  string: |+
9
9
  <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
10
  <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
- <request-id>1b9084cb-ca19-45e1-9802-0036e2344bb9</request-id>
11
+ <request-id>24c99a63-86de-4ae5-bc0b-54d59baef94f</request-id>
12
12
  <transaction-type>pending-debit</transaction-type>
13
13
  <requested-amount currency="EUR">12.12</requested-amount>
14
14
  <account-holder>
15
15
  <first-name>John</first-name>
16
16
  <last-name>Doe</last-name>
17
17
  </account-holder>
18
+ <order-number>666</order-number>
19
+ <custom-fields>
20
+ <custom-field field-name="Company Name" field-value="gut.org"/>
21
+ </custom-fields>
18
22
  <payment-methods>
19
23
  <payment-method name="sepadirectdebit"/>
20
24
  </payment-methods>
@@ -27,7 +31,6 @@ http_interactions:
27
31
  <signed-date>2013-09-24</signed-date>
28
32
  </mandate>
29
33
  <creditor-id>DE00000000000000000000</creditor-id>
30
- <order-number>666</order-number>
31
34
  </payment>
32
35
 
33
36
  headers:
@@ -41,23 +44,24 @@ http_interactions:
41
44
  message: Created
42
45
  headers:
43
46
  Date:
44
- - Tue, 02 Jun 2015 13:20:59 GMT
47
+ - Tue, 28 Jul 2015 09:49:15 GMT
45
48
  Content-Type:
46
49
  - application/xml;charset=UTF-8
47
50
  Content-Language:
48
51
  - en-US
49
52
  Content-Length:
50
- - '1182'
53
+ - '1322'
51
54
  Connection:
52
55
  - close
53
56
  body:
54
57
  encoding: UTF-8
55
- string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>358fcfa6-092a-11e5-a7b4-005056a96a54</transaction-id><request-id>1b9084cb-ca19-45e1-9802-0036e2344bb9</request-id><transaction-type>pending-debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-06-02T13:20:59.000Z</completion-time-stamp><statuses><status
58
+ string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>e85f5aac-350d-11e5-b074-005056a96a54</transaction-id><request-id>24c99a63-86de-4ae5-bc0b-54d59baef94f</request-id><transaction-type>pending-debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-07-28T09:49:15.000Z</completion-time-stamp><statuses><status
56
59
  code="201.0000" description="The resource was successfully created." severity="information"/></statuses><requested-amount
57
- currency="EUR">12.12</requested-amount><account-holder><first-name>John</first-name><last-name>Doe</last-name></account-holder><payment-methods><payment-method
58
- name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>1235678</mandate-id><signed-date>2013-09-24</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><due-date>2015-06-05</due-date><provider-transaction-reference-id>BA68B8D736</provider-transaction-reference-id></payment>
60
+ currency="EUR">12.12</requested-amount><account-holder><first-name>John</first-name><last-name>Doe</last-name></account-holder><order-number>666</order-number><custom-fields><custom-field
61
+ field-name="Company Name" field-value="gut.org"></custom-field></custom-fields><payment-methods><payment-method
62
+ name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>1235678</mandate-id><signed-date>2013-09-24</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><due-date>2015-07-31</due-date><provider-transaction-reference-id>2C7E9C6B88</provider-transaction-reference-id></payment>
59
63
  http_version: '1.1'
60
64
  adapter_metadata:
61
65
  effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
62
- recorded_at: Tue, 02 Jun 2015 13:20:59 GMT
66
+ recorded_at: Tue, 28 Jul 2015 09:49:15 GMT
63
67
  recorded_with: VCR 2.9.3
@@ -8,13 +8,14 @@ http_interactions:
8
8
  string: |+
9
9
  <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
10
  <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
- <request-id>4d760d12-0226-46e8-bc2c-7e6878e46914</request-id>
11
+ <request-id>fe1435ba-9986-4d33-a795-bdd5779f6ea0</request-id>
12
12
  <transaction-type>debit</transaction-type>
13
13
  <requested-amount currency="EUR">15.00</requested-amount>
14
14
  <account-holder>
15
15
  <first-name>Bob</first-name>
16
16
  <last-name>Hawk</last-name>
17
17
  </account-holder>
18
+ <order-number>666</order-number>
18
19
  <payment-methods>
19
20
  <payment-method name="sepadirectdebit" />
20
21
  </payment-methods>
@@ -27,7 +28,6 @@ http_interactions:
27
28
  <signed-date>2013-08-11</signed-date>
28
29
  </mandate>
29
30
  <creditor-id>DE00000000000000000000</creditor-id>
30
- <order-number>666</order-number>
31
31
  <periodic>
32
32
  <periodic-type>recurring</periodic-type>
33
33
  <sequence-type>first</sequence-type>
@@ -45,23 +45,23 @@ http_interactions:
45
45
  message: Created
46
46
  headers:
47
47
  Date:
48
- - Tue, 02 Jun 2015 13:44:59 GMT
48
+ - Tue, 28 Jul 2015 09:49:15 GMT
49
49
  Content-Type:
50
50
  - application/xml;charset=UTF-8
51
51
  Content-Language:
52
52
  - en-US
53
53
  Content-Length:
54
- - '1271'
54
+ - '1303'
55
55
  Connection:
56
56
  - close
57
57
  body:
58
58
  encoding: UTF-8
59
- string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>8f9ed85e-092d-11e5-a7b4-005056a96a54</transaction-id><request-id>4d760d12-0226-46e8-bc2c-7e6878e46914</request-id><transaction-type>debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-06-02T13:44:59.000Z</completion-time-stamp><statuses><status
59
+ string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>e8ad3cf4-350d-11e5-b074-005056a96a54</transaction-id><request-id>fe1435ba-9986-4d33-a795-bdd5779f6ea0</request-id><transaction-type>debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-07-28T09:49:16.000Z</completion-time-stamp><statuses><status
60
60
  code="201.0000" description="The resource was successfully created." severity="information"/></statuses><requested-amount
61
- currency="EUR">15.00</requested-amount><account-holder><first-name>Bob</first-name><last-name>Hawk</last-name></account-holder><payment-methods><payment-method
62
- name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>2356789</mandate-id><signed-date>2013-08-11</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><due-date>2015-06-05</due-date><periodic><periodic-type>recurring</periodic-type><sequence-type>first</sequence-type></periodic><provider-transaction-reference-id>1FF4627884</provider-transaction-reference-id></payment>
61
+ currency="EUR">15.00</requested-amount><account-holder><first-name>Bob</first-name><last-name>Hawk</last-name></account-holder><order-number>666</order-number><payment-methods><payment-method
62
+ name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>2356789</mandate-id><signed-date>2013-08-11</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><due-date>2015-07-31</due-date><periodic><periodic-type>recurring</periodic-type><sequence-type>first</sequence-type></periodic><provider-transaction-reference-id>9CCCDAC774</provider-transaction-reference-id></payment>
63
63
  http_version: '1.1'
64
64
  adapter_metadata:
65
65
  effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
66
- recorded_at: Tue, 02 Jun 2015 13:44:59 GMT
66
+ recorded_at: Tue, 28 Jul 2015 09:49:16 GMT
67
67
  recorded_with: VCR 2.9.3
@@ -8,13 +8,14 @@ http_interactions:
8
8
  string: |+
9
9
  <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
10
  <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
- <request-id>2b0b2952-c6bb-4736-b26e-7984ae90e2dc</request-id>
11
+ <request-id>b1d367a7-e20e-46fc-99f3-e6c2e32f6809</request-id>
12
12
  <transaction-type>debit</transaction-type>
13
13
  <requested-amount currency="EUR">15.00</requested-amount>
14
14
  <account-holder>
15
15
  <first-name>Bob</first-name>
16
16
  <last-name>Hawk</last-name>
17
17
  </account-holder>
18
+ <order-number>666</order-number>
18
19
  <payment-methods>
19
20
  <payment-method name="sepadirectdebit" />
20
21
  </payment-methods>
@@ -27,7 +28,6 @@ http_interactions:
27
28
  <signed-date>2013-08-11</signed-date>
28
29
  </mandate>
29
30
  <creditor-id>DE00000000000000000000</creditor-id>
30
- <order-number>666</order-number>
31
31
  <periodic>
32
32
  <periodic-type>recurring</periodic-type>
33
33
  <sequence-type>first</sequence-type>
@@ -45,23 +45,23 @@ http_interactions:
45
45
  message: Created
46
46
  headers:
47
47
  Date:
48
- - Tue, 02 Jun 2015 13:25:14 GMT
48
+ - Tue, 28 Jul 2015 09:49:16 GMT
49
49
  Content-Type:
50
50
  - application/xml;charset=UTF-8
51
51
  Content-Language:
52
52
  - en-US
53
53
  Content-Length:
54
- - '1271'
54
+ - '1303'
55
55
  Connection:
56
56
  - close
57
57
  body:
58
58
  encoding: UTF-8
59
- string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>cd77460a-092a-11e5-a7b4-005056a96a54</transaction-id><request-id>2b0b2952-c6bb-4736-b26e-7984ae90e2dc</request-id><transaction-type>debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-06-02T13:25:14.000Z</completion-time-stamp><statuses><status
59
+ string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>e8f7b248-350d-11e5-b074-005056a96a54</transaction-id><request-id>b1d367a7-e20e-46fc-99f3-e6c2e32f6809</request-id><transaction-type>debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-07-28T09:49:16.000Z</completion-time-stamp><statuses><status
60
60
  code="201.0000" description="The resource was successfully created." severity="information"/></statuses><requested-amount
61
- currency="EUR">15.00</requested-amount><account-holder><first-name>Bob</first-name><last-name>Hawk</last-name></account-holder><payment-methods><payment-method
62
- name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>2356789</mandate-id><signed-date>2013-08-11</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><due-date>2015-06-05</due-date><periodic><periodic-type>recurring</periodic-type><sequence-type>first</sequence-type></periodic><provider-transaction-reference-id>3F4944A293</provider-transaction-reference-id></payment>
61
+ currency="EUR">15.00</requested-amount><account-holder><first-name>Bob</first-name><last-name>Hawk</last-name></account-holder><order-number>666</order-number><payment-methods><payment-method
62
+ name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>2356789</mandate-id><signed-date>2013-08-11</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><due-date>2015-07-31</due-date><periodic><periodic-type>recurring</periodic-type><sequence-type>first</sequence-type></periodic><provider-transaction-reference-id>AEFA692A30</provider-transaction-reference-id></payment>
63
63
  http_version: '1.1'
64
64
  adapter_metadata:
65
65
  effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
66
- recorded_at: Tue, 02 Jun 2015 13:25:14 GMT
66
+ recorded_at: Tue, 28 Jul 2015 09:49:16 GMT
67
67
  recorded_with: VCR 2.9.3
@@ -8,9 +8,9 @@ http_interactions:
8
8
  string: |
9
9
  <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
10
  <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
- <request-id>04a1bc43-843c-437c-9db1-4c6d4d3e34cf</request-id>
11
+ <request-id>fdffd13c-8fb7-4aac-9bfe-1c82d8b1fe91</request-id>
12
12
  <transaction-type>debit</transaction-type>
13
- <parent-transaction-id>cd77460a-092a-11e5-a7b4-005056a96a54</parent-transaction-id>
13
+ <parent-transaction-id>e8f7b248-350d-11e5-b074-005056a96a54</parent-transaction-id>
14
14
  <payment-methods>
15
15
  <payment-method name="sepadirectdebit" />
16
16
  </payment-methods>
@@ -30,23 +30,23 @@ http_interactions:
30
30
  message: Created
31
31
  headers:
32
32
  Date:
33
- - Tue, 02 Jun 2015 13:27:19 GMT
33
+ - Tue, 28 Jul 2015 09:49:16 GMT
34
34
  Content-Type:
35
35
  - application/xml;charset=UTF-8
36
36
  Content-Language:
37
37
  - en-US
38
38
  Content-Length:
39
- - '1378'
39
+ - '1424'
40
40
  Connection:
41
41
  - close
42
42
  body:
43
43
  encoding: UTF-8
44
- string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>17edef90-092b-11e5-a7b4-005056a96a54</transaction-id><request-id>04a1bc43-843c-437c-9db1-4c6d4d3e34cf</request-id><transaction-type>debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-06-02T13:27:19.000Z</completion-time-stamp><statuses><status
44
+ string: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><payment xmlns="http://www.elastic-payments.com/schema/payment"><merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id><transaction-id>e9478066-350d-11e5-b074-005056a96a54</transaction-id><request-id>fdffd13c-8fb7-4aac-9bfe-1c82d8b1fe91</request-id><transaction-type>debit</transaction-type><transaction-state>success</transaction-state><completion-time-stamp>2015-07-28T09:49:17.000Z</completion-time-stamp><statuses><status
45
45
  code="201.0000" description="The resource was successfully created." severity="information"/></statuses><requested-amount
46
- currency="EUR">15.00</requested-amount><parent-transaction-id>cd77460a-092a-11e5-a7b4-005056a96a54</parent-transaction-id><account-holder><first-name>Bob</first-name><last-name>Hawk</last-name></account-holder><payment-methods><payment-method
47
- name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>2356789</mandate-id><signed-date>2013-08-11</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><api-id>---</api-id><due-date>2015-06-05</due-date><periodic><periodic-type>recurring</periodic-type><sequence-type>recurring</sequence-type></periodic><provider-transaction-reference-id>9467C8568D</provider-transaction-reference-id></payment>
46
+ currency="EUR">15.00</requested-amount><parent-transaction-id>e8f7b248-350d-11e5-b074-005056a96a54</parent-transaction-id><account-holder><first-name>Bob</first-name><last-name>Hawk</last-name></account-holder><order-number>666</order-number><payment-methods><payment-method
47
+ name="sepadirectdebit"/></payment-methods><bank-account><iban>DE42512308000000060004</iban><bic>WIREDEMMXXX</bic></bank-account><mandate><mandate-id>2356789</mandate-id><signed-date>2013-08-11T00:00:00.000Z</signed-date></mandate><creditor-id>DE00000000000000000000</creditor-id><api-id>---</api-id><due-date>2015-07-31</due-date><periodic><periodic-type>recurring</periodic-type><sequence-type>recurring</sequence-type></periodic><provider-transaction-reference-id>D73B657F3D</provider-transaction-reference-id></payment>
48
48
  http_version: '1.1'
49
49
  adapter_metadata:
50
50
  effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
51
- recorded_at: Tue, 02 Jun 2015 13:27:19 GMT
51
+ recorded_at: Tue, 28 Jul 2015 09:49:17 GMT
52
52
  recorded_with: VCR 2.9.3
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wirecard_sepa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - betterplace developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-11 00:00:00.000000000 Z
11
+ date: 2015-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -156,6 +156,7 @@ files:
156
156
  - lib/wirecard_sepa/version.rb
157
157
  - spec/lib/wirecard_sepa/config_spec.rb
158
158
  - spec/lib/wirecard_sepa/direct_debit/request_spec.rb
159
+ - spec/lib/wirecard_sepa/direct_debit/request_with_custom_fields_spec.rb
159
160
  - spec/lib/wirecard_sepa/direct_debit/response_spec.rb
160
161
  - spec/lib/wirecard_sepa/gateway_spec.rb
161
162
  - spec/lib/wirecard_sepa/recurring/first_request_spec.rb
@@ -167,6 +168,7 @@ files:
167
168
  - spec/support/direct_debit/failure/request.xml
168
169
  - spec/support/direct_debit/failure/response.xml
169
170
  - spec/support/direct_debit/success/request.xml
171
+ - spec/support/direct_debit/success/request_with_custom_fields.xml
170
172
  - spec/support/direct_debit/success/response.xml
171
173
  - spec/support/fixtures/vcr/gateway_debit.yml
172
174
  - spec/support/fixtures/vcr/gateway_recurring_init.yml
@@ -200,13 +202,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
202
  version: '0'
201
203
  requirements: []
202
204
  rubyforge_project:
203
- rubygems_version: 2.2.2
205
+ rubygems_version: 2.4.8
204
206
  signing_key:
205
207
  specification_version: 4
206
208
  summary: Wirecard SEPA implementation
207
209
  test_files:
208
210
  - spec/lib/wirecard_sepa/config_spec.rb
209
211
  - spec/lib/wirecard_sepa/direct_debit/request_spec.rb
212
+ - spec/lib/wirecard_sepa/direct_debit/request_with_custom_fields_spec.rb
210
213
  - spec/lib/wirecard_sepa/direct_debit/response_spec.rb
211
214
  - spec/lib/wirecard_sepa/gateway_spec.rb
212
215
  - spec/lib/wirecard_sepa/recurring/first_request_spec.rb
@@ -218,6 +221,7 @@ test_files:
218
221
  - spec/support/direct_debit/failure/request.xml
219
222
  - spec/support/direct_debit/failure/response.xml
220
223
  - spec/support/direct_debit/success/request.xml
224
+ - spec/support/direct_debit/success/request_with_custom_fields.xml
221
225
  - spec/support/direct_debit/success/response.xml
222
226
  - spec/support/fixtures/vcr/gateway_debit.yml
223
227
  - spec/support/fixtures/vcr/gateway_recurring_init.yml