wirecard_sepa 0.0.3 → 0.0.4

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: aaa93141c612cc1f432a50fe6cab5c7f031bb9f6
4
- data.tar.gz: 4016372fc3adbf2c6811a98d3f989e66d02b572c
3
+ metadata.gz: 61250ea6cf2f1c321deed60a0ccef9f795026c4c
4
+ data.tar.gz: d7a623352e27ef25e428655646aad1fc6d6cb700
5
5
  SHA512:
6
- metadata.gz: 9eefb21db2e5e4ba84f62823217b76cef25bf913f063eeea0b06e6a259840704ce250ab16a8ee835706be967cc9b05b78aafa2b00bc92df78cedff45d8ca512c
7
- data.tar.gz: 58c5db146fea9374f7222c6022744440deac8f56c5f594e7f1ce1984d71e25ad7d016f42f25c320299c0a7117240e90f6dd5e7e77622f4a800b94fd1657d69e4
6
+ metadata.gz: 1dfa320d0471b1c4d0cbca473abee2eb30638e31945e50941993ad9af3e4260de3aabf7ec142e9d1c777da26d97e41083ca825ac4b514199d1785375b2422545
7
+ data.tar.gz: 3d25629dea2b7731c08c63851c92162231b5e4b51f40c24e63dd4db1fa1a42699fa2d9a1f7720142b14d7db908ec3cec6ea6c4bb31188963b1d2942905212c1f
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
+ .DS_Store
1
2
  Gemfile.lock
2
3
  /pkg/
data/README.md CHANGED
@@ -1,14 +1,37 @@
1
1
  # Wirecard SEPA
2
2
  [![Build Status](https://api.travis-ci.org/betterplace/wirecard_sepa.svg?branch=master)](http://travis-ci.org/betterplace/wirecard_sepa)
3
3
  [![Code Climate](https://codeclimate.com/repos/55494936e30ba04e91005d6e/badges/cd0d22df220babab1b66/gpa.svg)](https://codeclimate.com/repos/55494936e30ba04e91005d6e/feed)
4
+ [![Dependency Status](https://gemnasium.com/betterplace/wirecard_sepa.svg)](https://gemnasium.com/betterplace/wirecard_sepa)
4
5
 
5
- A WORK IN PROGRESS PROJECT
6
+ Implements the client for creating payments in the Wircard Elastic Engine gateway.
7
+ More info [here](doc/wirecard-payment-processing-api-1.13.pdf).
8
+
9
+ ## Usage
10
+ ```ruby
11
+ config = WirecardSepa::Config.new({
12
+ api_url: 'https://api-test.wirecard.com/engine/rest/paymentmethods/',
13
+ http_auth_username: '70000-APITEST-AP',
14
+ http_auth_password: 'xxxxxxxxx',
15
+ merchant_account_id: '4c901196-eff7-411e-82a3-5ef6b6860d64',
16
+ creditor_id: 'DE98ZZZ09999999999'
17
+ })
18
+ gateway = WirecardSepa::Gateway.new(config)
19
+ response = gateway.debit({
20
+ requested_amount: '12.12',
21
+ account_holder_first_name: 'John',
22
+ account_holder_last_name: 'Doe',
23
+ bank_account_iban: 'DE42512308000000060004',
24
+ bank_account_bic: 'WIREDEMMXXX',
25
+ mandate_id: '1235678',
26
+ mandate_signed_date: '2015-06-02'
27
+ })
28
+ response.success?
29
+ => true
30
+ ```
6
31
 
7
32
  ## TODOS
8
- - [ ] Error Handling
9
- - [ ] Maybe cache template files (are they loaded from disk each request?)
33
+ - [x] Simple error handling
10
34
  - [ ] Docs for usage in README.md
11
- - [ ] Check Recurring Request/Response
12
35
 
13
36
  ## Contributing
14
37
  1. Fork it ( https://github.com/betterplace/wirecard_sepa/fork )
@@ -7,6 +7,7 @@
7
7
  <first-name>{{ACCOUNT_HOLDER_FIRST_NAME}}</first-name>
8
8
  <last-name>{{ACCOUNT_HOLDER_LAST_NAME}}</last-name>
9
9
  </account-holder>
10
+ <order-number>{{ORDER_NUMBER}}</order-number>
10
11
  <payment-methods>
11
12
  <payment-method name="sepadirectdebit"/>
12
13
  </payment-methods>
@@ -7,6 +7,7 @@
7
7
  <first-name>{{ACCOUNT_HOLDER_FIRST_NAME}}</first-name>
8
8
  <last-name>{{ACCOUNT_HOLDER_LAST_NAME}}</last-name>
9
9
  </account-holder>
10
+ <order-number>{{ORDER_NUMBER}}</order-number>
10
11
  <payment-methods>
11
12
  <payment-method name="sepadirectdebit" />
12
13
  </payment-methods>
@@ -17,7 +17,7 @@ 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 )
20
+ bank_account_bic mandate_id mandate_signed_date creditor_id order_number )
21
21
  end
22
22
  end
23
23
  end
@@ -17,7 +17,7 @@ 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 )
20
+ bank_account_bic mandate_id mandate_signed_date creditor_id order_number )
21
21
  end
22
22
  end
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module WirecardSepa
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -4,6 +4,7 @@ describe WirecardSepa::DirectDebit::Request do
4
4
  subject { described_class.new(params) }
5
5
  let(:params) do
6
6
  {
7
+ order_number: 666,
7
8
  merchant_account_id: 'eefc804c-f9d3-43a8-bd15-a1c92de10000',
8
9
  request_id: '7f55aacb-3e15-4185-b80f-1e0ad5b51d6c',
9
10
  requested_amount: '10.01',
@@ -34,7 +35,6 @@ describe WirecardSepa::DirectDebit::Request do
34
35
  it 'builds a valid request' do
35
36
  xsd = Nokogiri::XML::Schema(read_support_file('payment.xsd'))
36
37
  doc = Nokogiri::XML(subject.to_xml)
37
-
38
38
  errors = xsd.validate(doc)
39
39
  expect(errors).to be_empty
40
40
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  # TODOs
4
- # [] Record response from wirecard w/ VCR
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
7
  let(:debit_params) do
@@ -13,6 +13,7 @@ describe WirecardSepa::Gateway do
13
13
  bank_account_bic: 'WIREDEMMXXX',
14
14
  mandate_id: '1235678',
15
15
  mandate_signed_date: '2013-09-24',
16
+ order_number: 666,
16
17
  }
17
18
  end
18
19
  let(:recurring_init_params) do
@@ -24,38 +25,48 @@ describe WirecardSepa::Gateway do
24
25
  bank_account_bic: 'WIREDEMMXXX',
25
26
  mandate_id: '2356789',
26
27
  mandate_signed_date: '2013-08-11',
28
+ order_number: 666,
27
29
  }
28
30
  end
31
+ THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30
29
32
 
30
33
  describe '#debit(params)' do
31
34
  it 'posts the correct XML' do
32
- # TODO: Record response from wirecard
33
- response = gateway.debit(debit_params)
34
- expect(response).to be_success
35
- expect(response.params).to_not be_empty
36
- expect(response.transaction_id).to_not be_empty
35
+ VCR.use_cassette 'gateway.debit', re_record_interval: THIRTY_DAYS_IN_SECONDS do
36
+ response = gateway.debit(debit_params)
37
+ expect(response).to be_success
38
+ expect(response.params).to_not be_empty
39
+ expect(response.transaction_id).to_not be_empty
40
+ end
37
41
  end
38
42
  end
39
43
 
40
44
  describe '#recurring_init(params)' do
41
45
  it 'posts the correct XML' do
42
- # TODO: Record response from wirecard
43
- response = gateway.recurring_init(recurring_init_params)
44
- expect(response).to be_success
45
- expect(response.params).to_not be_empty
46
- expect(response.transaction_id).to_not be_empty
46
+ VCR.use_cassette 'gateway.recurring_init', re_record_interval: THIRTY_DAYS_IN_SECONDS do
47
+ response = gateway.recurring_init(recurring_init_params)
48
+ expect(response).to be_success
49
+ expect(response.params).to_not be_empty
50
+ expect(response.transaction_id).to_not be_empty
51
+ end
47
52
  end
48
53
  end
49
54
 
50
55
  describe '#recurring_process(params)' do
51
- let(:init_response) { gateway.recurring_init(recurring_init_params) }
52
- let(:parent_transaction_id) { init_response.transaction_id }
56
+ let(:parent_transaction_id) do
57
+ VCR.use_cassette 'gateway.recurring_process/init', re_record_interval: THIRTY_DAYS_IN_SECONDS do
58
+ init_response = gateway.recurring_init(recurring_init_params)
59
+ init_response.transaction_id
60
+ end
61
+ end
53
62
 
54
63
  it 'posts the correct XML' do
55
- response = gateway.recurring_process({ parent_transaction_id: parent_transaction_id })
56
- expect(response).to be_success
57
- expect(response.params).to_not be_empty
58
- expect(response.transaction_id).to_not be_empty
64
+ VCR.use_cassette 'gateway.recurring_process', re_record_interval: THIRTY_DAYS_IN_SECONDS do
65
+ response = gateway.recurring_process({ parent_transaction_id: parent_transaction_id })
66
+ expect(response).to be_success
67
+ expect(response.params).to_not be_empty
68
+ expect(response.transaction_id).to_not be_empty
69
+ end
59
70
  end
60
71
  end
61
72
  end
@@ -14,6 +14,7 @@ describe WirecardSepa::Recurring::FirstRequest do
14
14
  mandate_id: '12345678',
15
15
  mandate_signed_date: '2013-12-19',
16
16
  creditor_id: 'DE98ZZZ09999999999',
17
+ order_number: 666,
17
18
  }
18
19
  end
19
20
 
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'simplecov'
2
2
  require 'byebug'
3
+ require 'vcr'
3
4
 
4
5
  # FIXME
5
6
  # SimpleCov.adapters.define 'gem' do
@@ -22,4 +23,9 @@ def sandbox_gateway_config
22
23
  })
23
24
  end
24
25
 
26
+ VCR.configure do |config|
27
+ config.cassette_library_dir = "spec/support/fixtures/vcr"
28
+ config.hook_into :typhoeus
29
+ end
30
+
25
31
  require 'wirecard_sepa'
@@ -15,5 +15,6 @@
15
15
  <signed-date>2013-09-24</signed-date>
16
16
  </mandate>
17
17
  <creditor-id>DE98ZZZ09999999999</creditor-id>
18
+ <order-number>666</order-number>
18
19
  </payment>
19
20
 
@@ -7,6 +7,7 @@
7
7
  <first-name>John</first-name>
8
8
  <last-name>Doe</last-name>
9
9
  </account-holder>
10
+ <order-number>666</order-number>
10
11
  <payment-methods>
11
12
  <payment-method name="sepadirectdebit"/>
12
13
  </payment-methods>
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-test.wirecard.com/engine/rest/paymentmethods/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |+
9
+ <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
+ <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
+ <request-id>1b9084cb-ca19-45e1-9802-0036e2344bb9</request-id>
12
+ <transaction-type>pending-debit</transaction-type>
13
+ <requested-amount currency="EUR">12.12</requested-amount>
14
+ <account-holder>
15
+ <first-name>John</first-name>
16
+ <last-name>Doe</last-name>
17
+ </account-holder>
18
+ <payment-methods>
19
+ <payment-method name="sepadirectdebit"/>
20
+ </payment-methods>
21
+ <bank-account>
22
+ <iban>DE42512308000000060004</iban>
23
+ <bic>WIREDEMMXXX</bic>
24
+ </bank-account>
25
+ <mandate>
26
+ <mandate-id>1235678</mandate-id>
27
+ <signed-date>2013-09-24</signed-date>
28
+ </mandate>
29
+ <creditor-id>DE00000000000000000000</creditor-id>
30
+ <order-number>666</order-number>
31
+ </payment>
32
+
33
+ headers:
34
+ User-Agent:
35
+ - Typhoeus - https://github.com/typhoeus/typhoeus
36
+ Content-Type:
37
+ - application/xml
38
+ response:
39
+ status:
40
+ code: 201
41
+ message: Created
42
+ headers:
43
+ Date:
44
+ - Tue, 02 Jun 2015 13:20:59 GMT
45
+ Content-Type:
46
+ - application/xml;charset=UTF-8
47
+ Content-Language:
48
+ - en-US
49
+ Content-Length:
50
+ - '1182'
51
+ Connection:
52
+ - close
53
+ body:
54
+ 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
56
+ 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>
59
+ http_version: '1.1'
60
+ adapter_metadata:
61
+ effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
62
+ recorded_at: Tue, 02 Jun 2015 13:20:59 GMT
63
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-test.wirecard.com/engine/rest/paymentmethods/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |+
9
+ <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
+ <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
+ <request-id>4d760d12-0226-46e8-bc2c-7e6878e46914</request-id>
12
+ <transaction-type>debit</transaction-type>
13
+ <requested-amount currency="EUR">15.00</requested-amount>
14
+ <account-holder>
15
+ <first-name>Bob</first-name>
16
+ <last-name>Hawk</last-name>
17
+ </account-holder>
18
+ <payment-methods>
19
+ <payment-method name="sepadirectdebit" />
20
+ </payment-methods>
21
+ <bank-account>
22
+ <iban>DE42512308000000060004</iban>
23
+ <bic>WIREDEMMXXX</bic>
24
+ </bank-account>
25
+ <mandate>
26
+ <mandate-id>2356789</mandate-id>
27
+ <signed-date>2013-08-11</signed-date>
28
+ </mandate>
29
+ <creditor-id>DE00000000000000000000</creditor-id>
30
+ <order-number>666</order-number>
31
+ <periodic>
32
+ <periodic-type>recurring</periodic-type>
33
+ <sequence-type>first</sequence-type>
34
+ </periodic>
35
+ </payment>
36
+
37
+ headers:
38
+ User-Agent:
39
+ - Typhoeus - https://github.com/typhoeus/typhoeus
40
+ Content-Type:
41
+ - application/xml
42
+ response:
43
+ status:
44
+ code: 201
45
+ message: Created
46
+ headers:
47
+ Date:
48
+ - Tue, 02 Jun 2015 13:44:59 GMT
49
+ Content-Type:
50
+ - application/xml;charset=UTF-8
51
+ Content-Language:
52
+ - en-US
53
+ Content-Length:
54
+ - '1271'
55
+ Connection:
56
+ - close
57
+ body:
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
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>
63
+ http_version: '1.1'
64
+ adapter_metadata:
65
+ effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
66
+ recorded_at: Tue, 02 Jun 2015 13:44:59 GMT
67
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,67 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-test.wirecard.com/engine/rest/paymentmethods/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |+
9
+ <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
+ <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
+ <request-id>2b0b2952-c6bb-4736-b26e-7984ae90e2dc</request-id>
12
+ <transaction-type>debit</transaction-type>
13
+ <requested-amount currency="EUR">15.00</requested-amount>
14
+ <account-holder>
15
+ <first-name>Bob</first-name>
16
+ <last-name>Hawk</last-name>
17
+ </account-holder>
18
+ <payment-methods>
19
+ <payment-method name="sepadirectdebit" />
20
+ </payment-methods>
21
+ <bank-account>
22
+ <iban>DE42512308000000060004</iban>
23
+ <bic>WIREDEMMXXX</bic>
24
+ </bank-account>
25
+ <mandate>
26
+ <mandate-id>2356789</mandate-id>
27
+ <signed-date>2013-08-11</signed-date>
28
+ </mandate>
29
+ <creditor-id>DE00000000000000000000</creditor-id>
30
+ <order-number>666</order-number>
31
+ <periodic>
32
+ <periodic-type>recurring</periodic-type>
33
+ <sequence-type>first</sequence-type>
34
+ </periodic>
35
+ </payment>
36
+
37
+ headers:
38
+ User-Agent:
39
+ - Typhoeus - https://github.com/typhoeus/typhoeus
40
+ Content-Type:
41
+ - application/xml
42
+ response:
43
+ status:
44
+ code: 201
45
+ message: Created
46
+ headers:
47
+ Date:
48
+ - Tue, 02 Jun 2015 13:25:14 GMT
49
+ Content-Type:
50
+ - application/xml;charset=UTF-8
51
+ Content-Language:
52
+ - en-US
53
+ Content-Length:
54
+ - '1271'
55
+ Connection:
56
+ - close
57
+ body:
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
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>
63
+ http_version: '1.1'
64
+ adapter_metadata:
65
+ effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
66
+ recorded_at: Tue, 02 Jun 2015 13:25:14 GMT
67
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-test.wirecard.com/engine/rest/paymentmethods/
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <payment xmlns="http://www.elastic-payments.com/schema/payment">
10
+ <merchant-account-id>4c901196-eff7-411e-82a3-5ef6b6860d64</merchant-account-id>
11
+ <request-id>04a1bc43-843c-437c-9db1-4c6d4d3e34cf</request-id>
12
+ <transaction-type>debit</transaction-type>
13
+ <parent-transaction-id>cd77460a-092a-11e5-a7b4-005056a96a54</parent-transaction-id>
14
+ <payment-methods>
15
+ <payment-method name="sepadirectdebit" />
16
+ </payment-methods>
17
+ <periodic>
18
+ <periodic-type>recurring</periodic-type>
19
+ <sequence-type>recurring</sequence-type>
20
+ </periodic>
21
+ </payment>
22
+ headers:
23
+ User-Agent:
24
+ - Typhoeus - https://github.com/typhoeus/typhoeus
25
+ Content-Type:
26
+ - application/xml
27
+ response:
28
+ status:
29
+ code: 201
30
+ message: Created
31
+ headers:
32
+ Date:
33
+ - Tue, 02 Jun 2015 13:27:19 GMT
34
+ Content-Type:
35
+ - application/xml;charset=UTF-8
36
+ Content-Language:
37
+ - en-US
38
+ Content-Length:
39
+ - '1378'
40
+ Connection:
41
+ - close
42
+ body:
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
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>
48
+ http_version: '1.1'
49
+ adapter_metadata:
50
+ effective_url: https://api-test.wirecard.com/engine/rest/paymentmethods/
51
+ recorded_at: Tue, 02 Jun 2015 13:27:19 GMT
52
+ recorded_with: VCR 2.9.3
@@ -19,6 +19,7 @@
19
19
  <signed-date>2013-12-19</signed-date>
20
20
  </mandate>
21
21
  <creditor-id>DE98ZZZ09999999999</creditor-id>
22
+ <order-number>666</order-number>
22
23
  <periodic>
23
24
  <periodic-type>recurring</periodic-type>
24
25
  <sequence-type>recurring</sequence-type>
@@ -7,6 +7,7 @@
7
7
  <first-name>John</first-name>
8
8
  <last-name>Doe</last-name>
9
9
  </account-holder>
10
+ <order-number>666</order-number>
10
11
  <payment-methods>
11
12
  <payment-method name="sepadirectdebit" />
12
13
  </payment-methods>
@@ -25,5 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "rake", "~> 10.4"
26
26
  spec.add_development_dependency "rspec"
27
27
  spec.add_development_dependency "byebug"
28
+ spec.add_development_dependency "vcr", "~> 2.9"
28
29
  spec.add_development_dependency "simplecov"
29
30
  end
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.3
4
+ version: 0.0.4
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-02 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: vcr
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.9'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.9'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: simplecov
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -123,6 +137,7 @@ files:
123
137
  - LICENSE
124
138
  - README.md
125
139
  - Rakefile
140
+ - doc/wirecard-payment-processing-api-1.13.pdf
126
141
  - lib/templates/wirecard_sepa/direct_debit/request.xml
127
142
  - lib/templates/wirecard_sepa/recurring/first_request.xml
128
143
  - lib/templates/wirecard_sepa/recurring/recurring_request.xml
@@ -153,6 +168,10 @@ files:
153
168
  - spec/support/direct_debit/failure/response.xml
154
169
  - spec/support/direct_debit/success/request.xml
155
170
  - spec/support/direct_debit/success/response.xml
171
+ - spec/support/fixtures/vcr/gateway_debit.yml
172
+ - spec/support/fixtures/vcr/gateway_recurring_init.yml
173
+ - spec/support/fixtures/vcr/gateway_recurring_process.yml
174
+ - spec/support/fixtures/vcr/gateway_recurring_process/init.yml
156
175
  - spec/support/payment.xsd
157
176
  - spec/support/recurring/failure/recurring_request.xml
158
177
  - spec/support/recurring/failure/recurring_response.xml
@@ -200,6 +219,10 @@ test_files:
200
219
  - spec/support/direct_debit/failure/response.xml
201
220
  - spec/support/direct_debit/success/request.xml
202
221
  - spec/support/direct_debit/success/response.xml
222
+ - spec/support/fixtures/vcr/gateway_debit.yml
223
+ - spec/support/fixtures/vcr/gateway_recurring_init.yml
224
+ - spec/support/fixtures/vcr/gateway_recurring_process.yml
225
+ - spec/support/fixtures/vcr/gateway_recurring_process/init.yml
203
226
  - spec/support/payment.xsd
204
227
  - spec/support/recurring/failure/recurring_request.xml
205
228
  - spec/support/recurring/failure/recurring_response.xml