pensio_api 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile.lock +1 -1
- data/lib/pensio_api/callback.rb +13 -6
- data/lib/pensio_api/chargeback_event.rb +25 -0
- data/lib/pensio_api/responses/base.rb +9 -5
- data/lib/pensio_api/responses/chargeback_callback.rb +6 -0
- data/lib/pensio_api/responses/reservation.rb +11 -7
- data/lib/pensio_api/responses/reservation_capture.rb +5 -2
- data/lib/pensio_api/responses/reservation_release.rb +10 -1
- data/lib/pensio_api/transaction.rb +21 -0
- data/lib/pensio_api.rb +2 -0
- data/pensio_api.gemspec +1 -1
- data/spec/lib/pensio_api/callback_spec.rb +8 -0
- data/spec/lib/pensio_api/chargeback_event_spec.rb +37 -0
- data/spec/lib/pensio_api/responses/chargeback_callback_spec.rb +9 -0
- data/spec/lib/pensio_api/responses/reservation_spec.rb +2 -1
- data/spec/lib/pensio_api/transaction_spec.rb +4 -0
- data/spec/support/fixtures/chargeback_callback.xml +92 -0
- data/spec/support/fixtures/reservation_of_fixed_amount.xml +136 -45
- metadata +23 -31
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8df2a4f55de1b2a15095fcb0eae66ec28a0556f2
|
4
|
+
data.tar.gz: 1e65cb234c4d22f00599fcc15821519322ebe2c6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 808300554a974100f949ec893f789cc36ca686c9e8b5d6a8afd36ea890e884847e5ff6837b86b4cdba5f8c3c3c91da8be81894f1f4053e259ece8105814f01db
|
7
|
+
data.tar.gz: 96af16fe19782e17c5f6be0cbc3ca625ac1faee1fb57036f956f2b7a3a5e32d95decde08fb09954fcc2ad1c8e6fe2209efea79073e874bb1a04cb5447b50e47e
|
data/Gemfile.lock
CHANGED
data/lib/pensio_api/callback.rb
CHANGED
@@ -3,16 +3,20 @@ module PensioAPI
|
|
3
3
|
FakeRequest = Struct.new(:headers, :body)
|
4
4
|
|
5
5
|
def self.parse_success(xml)
|
6
|
-
parse(xml,
|
6
|
+
parse(xml, :success)
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.parse_failure(xml)
|
10
|
-
parse(xml,
|
10
|
+
parse(xml, :failure)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.parse_chargeback(xml)
|
14
|
+
parse(xml, :chargeback)
|
11
15
|
end
|
12
16
|
|
13
17
|
private
|
14
18
|
|
15
|
-
def self.parse(xml,
|
19
|
+
def self.parse(xml, handler)
|
16
20
|
params = MultiXml.parse(xml)
|
17
21
|
|
18
22
|
request = FakeRequest.new(
|
@@ -20,11 +24,14 @@ module PensioAPI
|
|
20
24
|
params['APIResponse']['Body']
|
21
25
|
)
|
22
26
|
|
23
|
-
|
27
|
+
case handler
|
28
|
+
when :success
|
24
29
|
PensioAPI::Responses::SuccessCallback.new(request)
|
25
|
-
|
30
|
+
when :failure
|
26
31
|
PensioAPI::Responses::SubscriptionFailureCallback.new(request)
|
32
|
+
when :chargeback
|
33
|
+
PensioAPI::Responses::ChargebackCallback.new(request)
|
27
34
|
end
|
28
35
|
end
|
29
36
|
end
|
30
|
-
end
|
37
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module PensioAPI
|
2
|
+
class ChargebackEvent
|
3
|
+
attr_reader :type
|
4
|
+
attr_reader :reason_code
|
5
|
+
attr_reader :reason
|
6
|
+
attr_reader :amount
|
7
|
+
attr_reader :currency
|
8
|
+
attr_reader :acquirer_transaction_id
|
9
|
+
|
10
|
+
def initialize(chargeback_body)
|
11
|
+
@raw = chargeback_body
|
12
|
+
|
13
|
+
@type = @raw['Type']
|
14
|
+
@reason_code = @raw['ReasonCode'].to_i
|
15
|
+
@reason = @raw['Reason']
|
16
|
+
@amount = BigDecimal.new(@raw['Amount'])
|
17
|
+
@currency = @raw['Currency']
|
18
|
+
@acquirer_transaction_id = @raw['AcquirerTransactionId']
|
19
|
+
end
|
20
|
+
|
21
|
+
def created_at
|
22
|
+
@created_at ||= Time.parse(@raw['Date'])
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -9,24 +9,28 @@ module PensioAPI
|
|
9
9
|
@raw = request.body
|
10
10
|
@headers = request.headers
|
11
11
|
unless success?
|
12
|
-
raise PensioAPI::Errors::BadRequest.new(request) unless header_ok
|
13
|
-
raise PensioAPI::Errors::GatewayError.new(request) unless body_ok
|
12
|
+
raise PensioAPI::Errors::BadRequest.new(request) unless header_ok?
|
13
|
+
raise PensioAPI::Errors::GatewayError.new(request) unless body_ok? || chargeback?
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
def success?
|
18
|
-
header_ok && body_ok
|
18
|
+
header_ok? && (body_ok? || chargeback?)
|
19
19
|
end
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
def header_ok
|
23
|
+
def header_ok?
|
24
24
|
@headers['ErrorCode'].to_i == 0
|
25
25
|
end
|
26
26
|
|
27
|
-
def body_ok
|
27
|
+
def body_ok?
|
28
28
|
!@raw.has_key?('Result') || ['Success', 'OK', nil].include?(@raw['Result'])
|
29
29
|
end
|
30
|
+
|
31
|
+
def chargeback?
|
32
|
+
@raw['Result'] == 'ChargebackEvent'
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
32
36
|
end
|
@@ -1,15 +1,19 @@
|
|
1
1
|
module PensioAPI
|
2
2
|
module Responses
|
3
|
-
class Reservation <
|
4
|
-
attr_reader :transaction
|
3
|
+
class Reservation < Transaction
|
5
4
|
|
6
|
-
def
|
7
|
-
|
5
|
+
def each
|
6
|
+
[reservation, charge].each { |t| yield t }
|
7
|
+
end
|
8
|
+
|
9
|
+
def reservation
|
10
|
+
@transactions.first
|
11
|
+
end
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
)
|
13
|
+
def charge
|
14
|
+
@transactions.last
|
12
15
|
end
|
16
|
+
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
@@ -1,11 +1,14 @@
|
|
1
1
|
module PensioAPI
|
2
2
|
module Responses
|
3
|
-
class ReservationCapture <
|
4
|
-
attr_reader :capture_amount, :capture_currency
|
3
|
+
class ReservationCapture < Base
|
4
|
+
attr_reader :transaction, :capture_amount, :capture_currency
|
5
5
|
|
6
6
|
def initialize(request)
|
7
7
|
super(request)
|
8
8
|
|
9
|
+
@transaction = PensioAPI::Transaction.new(
|
10
|
+
transactions['Transaction']
|
11
|
+
)
|
9
12
|
@capture_amount = BigDecimal.new(@raw['CaptureAmount'])
|
10
13
|
@capture_currency = @raw['CaptureCurrency'].to_i
|
11
14
|
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
module PensioAPI
|
2
2
|
module Responses
|
3
|
-
class ReservationRelease <
|
3
|
+
class ReservationRelease < Base
|
4
|
+
attr_reader :transaction
|
5
|
+
|
6
|
+
def initialize(request)
|
7
|
+
super(request)
|
8
|
+
|
9
|
+
@transaction = PensioAPI::Transaction.new(
|
10
|
+
transactions['Transaction']
|
11
|
+
)
|
12
|
+
end
|
4
13
|
end
|
5
14
|
end
|
6
15
|
end
|
@@ -15,6 +15,7 @@ module PensioAPI
|
|
15
15
|
attr_reader :order_id
|
16
16
|
attr_reader :merchant_currency
|
17
17
|
attr_reader :card_holder_currency
|
18
|
+
attr_reader :chargeback_events
|
18
19
|
|
19
20
|
# constants for transaction statuses
|
20
21
|
STATUS_RECURRING_CONFIRMED = 'recurring_confirmed'
|
@@ -43,6 +44,8 @@ module PensioAPI
|
|
43
44
|
|
44
45
|
@merchant_currency = @raw['MerchantCurrency'].to_i
|
45
46
|
@card_holder_currency = @raw['CardHolderCurrency'].to_i
|
47
|
+
|
48
|
+
map_chargeback_events
|
46
49
|
end
|
47
50
|
|
48
51
|
def self.find(options={})
|
@@ -80,5 +83,23 @@ module PensioAPI
|
|
80
83
|
BillingAddress.new(@raw['CustomerInfo']['BillingAddress'])
|
81
84
|
end
|
82
85
|
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def map_chargeback_events
|
90
|
+
@chargeback_events = if raw_chargeback_events.is_a?(Array)
|
91
|
+
raw_chargeback_events.map { |c| PensioAPI::ChargebackEvent.new(c) }
|
92
|
+
else
|
93
|
+
[PensioAPI::ChargebackEvent.new(raw_chargeback_events)]
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def raw_chargeback_events
|
98
|
+
@raw_chargeback_events ||= if @raw['ChargebackEvents']
|
99
|
+
@raw['ChargebackEvents']['ChargebackEvent']
|
100
|
+
else
|
101
|
+
[]
|
102
|
+
end
|
103
|
+
end
|
83
104
|
end
|
84
105
|
end
|
data/lib/pensio_api.rb
CHANGED
@@ -8,6 +8,7 @@ require 'pensio_api/mixins/timestamps'
|
|
8
8
|
|
9
9
|
require 'pensio_api/billing_address'
|
10
10
|
require 'pensio_api/callback'
|
11
|
+
require 'pensio_api/chargeback_event'
|
11
12
|
require 'pensio_api/credentials'
|
12
13
|
require 'pensio_api/ecommerce'
|
13
14
|
require 'pensio_api/funding_list'
|
@@ -32,5 +33,6 @@ require 'pensio_api/responses/reservation'
|
|
32
33
|
require 'pensio_api/responses/reservation_capture'
|
33
34
|
require 'pensio_api/responses/reservation_release'
|
34
35
|
require 'pensio_api/responses/subscription_charge'
|
36
|
+
require 'pensio_api/responses/chargeback_callback'
|
35
37
|
require 'pensio_api/responses/success_callback'
|
36
38
|
require 'pensio_api/responses/subscription_failure_callback'
|
data/pensio_api.gemspec
CHANGED
@@ -17,5 +17,13 @@ describe PensioAPI::Callback do
|
|
17
17
|
expect(response.success?).to be_true
|
18
18
|
end
|
19
19
|
end
|
20
|
+
|
21
|
+
describe ".parse_chargeback" do
|
22
|
+
let(:response) { PensioAPI::Callback.parse_chargeback(file_fixture("chargeback_callback.xml")) }
|
23
|
+
it "should return a ChargebackCallback response" do
|
24
|
+
expect(response).to be_an_instance_of(PensioAPI::Responses::ChargebackCallback)
|
25
|
+
expect(response.success?).to be_true
|
26
|
+
end
|
27
|
+
end
|
20
28
|
end
|
21
29
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PensioAPI::ChargebackEvent do
|
4
|
+
let(:response) { PensioAPI::Callback.parse_chargeback(file_fixture("chargeback_callback.xml")) }
|
5
|
+
let(:transaction) { response.transactions.last }
|
6
|
+
let(:chargeback_event) { transaction.chargeback_events.last }
|
7
|
+
|
8
|
+
describe 'reader attributes' do
|
9
|
+
describe 'type' do
|
10
|
+
specify { expect(chargeback_event.type).to be_an_instance_of(String) }
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'reason_code' do
|
14
|
+
specify { expect(chargeback_event.reason_code).to be_an_instance_of(Fixnum) }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'reason' do
|
18
|
+
specify { expect(chargeback_event.reason).to be_an_instance_of(String) }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'amount' do
|
22
|
+
specify { expect(chargeback_event.amount).to be_an_instance_of(BigDecimal) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe 'currency' do
|
26
|
+
specify { expect(chargeback_event.currency).to be_an_instance_of(String) }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'acquirer_transaction_id' do
|
30
|
+
specify { expect(chargeback_event.acquirer_transaction_id).to be_an_instance_of(String) }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'created_at' do
|
35
|
+
specify { expect(chargeback_event.created_at).to be_an_instance_of(Time) }
|
36
|
+
end
|
37
|
+
end
|
@@ -10,6 +10,7 @@ describe PensioAPI::Responses::Reservation do
|
|
10
10
|
specify { expect(response).to be_an_instance_of(PensioAPI::Responses::Reservation) }
|
11
11
|
|
12
12
|
describe 'readable attributes' do
|
13
|
-
specify { expect(response.
|
13
|
+
specify { expect(response.charge).to be_an_instance_of(PensioAPI::Transaction) }
|
14
|
+
specify { expect(response.reservation).to be_an_instance_of(PensioAPI::Transaction) }
|
14
15
|
end
|
15
16
|
end
|
@@ -37,6 +37,10 @@ describe PensioAPI::Transaction do
|
|
37
37
|
describe '.card_holder_currency' do
|
38
38
|
specify { expect(transaction.card_holder_currency).to be_an_instance_of(Fixnum) }
|
39
39
|
end
|
40
|
+
|
41
|
+
describe '.chargeback_events' do
|
42
|
+
specify { expect(transaction.chargeback_events).to be_an_instance_of(Array) }
|
43
|
+
end
|
40
44
|
end
|
41
45
|
|
42
46
|
describe '.find' do
|
@@ -0,0 +1,92 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<APIResponse version="20130430">
|
3
|
+
<Header>
|
4
|
+
<Date>2014-05-22T11:05:16+02:00</Date>
|
5
|
+
<Path>settings/createReconciliationData</Path>
|
6
|
+
<ErrorCode>0</ErrorCode>
|
7
|
+
<ErrorMessage/>
|
8
|
+
</Header>
|
9
|
+
<Body>
|
10
|
+
<Result>ChargebackEvent</Result>
|
11
|
+
<Transactions>
|
12
|
+
<Transaction>
|
13
|
+
<TransactionId>1093191</TransactionId>
|
14
|
+
<AuthType>subscription_payment</AuthType>
|
15
|
+
<CardStatus>InvalidLuhn</CardStatus>
|
16
|
+
<CreditCardExpiry>
|
17
|
+
<Year>2025</Year>
|
18
|
+
<Month>11</Month>
|
19
|
+
</CreditCardExpiry>
|
20
|
+
<CreditCardToken>eba482b9ca1dac29a3964dca21d921c2f91b0d1b</CreditCardToken>
|
21
|
+
<CreditCardMaskedPan>415000******1967</CreditCardMaskedPan>
|
22
|
+
<ThreeDSecureResult>Not_Applicable</ThreeDSecureResult>
|
23
|
+
<CVVCheckResult>Not_Applicable</CVVCheckResult>
|
24
|
+
<BlacklistToken>e2e95ffb9979ff7fe0327ba8bd9b4390c2a08e55</BlacklistToken>
|
25
|
+
<ShopOrderId>test_order</ShopOrderId>
|
26
|
+
<Shop>Test Shop</Shop>
|
27
|
+
<Terminal>Test Terminal</Terminal>
|
28
|
+
<TransactionStatus>captured</TransactionStatus>
|
29
|
+
<MerchantCurrency>978</MerchantCurrency>
|
30
|
+
<CardHolderCurrency>978</CardHolderCurrency>
|
31
|
+
<ReservedAmount>100.20</ReservedAmount>
|
32
|
+
<CapturedAmount>100.20</CapturedAmount>
|
33
|
+
<RefundedAmount>0.00</RefundedAmount>
|
34
|
+
<RecurringDefaultAmount>0.00</RecurringDefaultAmount>
|
35
|
+
<CreatedDate>2014-05-22 11:04:39</CreatedDate>
|
36
|
+
<UpdatedDate>2014-05-22 11:04:40</UpdatedDate>
|
37
|
+
<PaymentNature>CreditCard</PaymentNature>
|
38
|
+
<PaymentSchemeName>Visa</PaymentSchemeName>
|
39
|
+
<PaymentNatureService name="SoapTestAcquirer">
|
40
|
+
<SupportsRefunds>true</SupportsRefunds>
|
41
|
+
<SupportsRelease>true</SupportsRelease>
|
42
|
+
<SupportsMultipleCaptures>true</SupportsMultipleCaptures>
|
43
|
+
<SupportsMultipleRefunds>true</SupportsMultipleRefunds>
|
44
|
+
</PaymentNatureService>
|
45
|
+
<AddressVerification>1</AddressVerification>
|
46
|
+
<AddressVerificationDescription>Invalid address verification response code</AddressVerificationDescription>
|
47
|
+
<ChargebackEvents>
|
48
|
+
<ChargebackEvent>
|
49
|
+
<Date>2014-05-22T00:00:00+02:00</Date>
|
50
|
+
<Type>Chargeback test case</Type>
|
51
|
+
<ReasonCode>30</ReasonCode>
|
52
|
+
<Reason>chargeback</Reason>
|
53
|
+
<Amount>100.20</Amount>
|
54
|
+
<Currency>EUR</Currency>
|
55
|
+
<AcquirerTransactionId>91816f59-0337-4ab7-8823-b56ee1fae848</AcquirerTransactionId>
|
56
|
+
<AdditionalInfo><additional_info><info_element><key>Type</key><value>Test</value></info_element></additional_info></AdditionalInfo>
|
57
|
+
</ChargebackEvent>
|
58
|
+
</ChargebackEvents>
|
59
|
+
<PaymentInfos/>
|
60
|
+
<CustomerInfo>
|
61
|
+
<UserAgent>Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0</UserAgent>
|
62
|
+
<IpAddress>46.208.161.11</IpAddress>
|
63
|
+
<Email/>
|
64
|
+
<Username/>
|
65
|
+
<CustomerPhone/>
|
66
|
+
<OrganisationNumber/>
|
67
|
+
<CountryOfOrigin>
|
68
|
+
<Country>LV</Country>
|
69
|
+
<Source>CardNumber</Source>
|
70
|
+
</CountryOfOrigin>
|
71
|
+
<BillingAddress>
|
72
|
+
<Firstname/>
|
73
|
+
<Lastname/>
|
74
|
+
<Address><![CDATA[11 Test Street]]></Address>
|
75
|
+
<City><![CDATA[Eberswalde]]></City>
|
76
|
+
<Region><![CDATA[Test]]></Region>
|
77
|
+
<Country><![CDATA[DE]]></Country>
|
78
|
+
<PostalCode><![CDATA[112233]]></PostalCode>
|
79
|
+
</BillingAddress>
|
80
|
+
</CustomerInfo>
|
81
|
+
<ReconciliationIdentifiers>
|
82
|
+
<ReconciliationIdentifier>
|
83
|
+
<Id>6c09caac-c6cc-a927-a4f3-f64d7a7102ab</Id>
|
84
|
+
<Amount currency="978">100.20</Amount>
|
85
|
+
<Type>captured</Type>
|
86
|
+
<Date>2014-05-22T11:04:40+02:00</Date>
|
87
|
+
</ReconciliationIdentifier>
|
88
|
+
</ReconciliationIdentifiers>
|
89
|
+
</Transaction>
|
90
|
+
</Transactions>
|
91
|
+
</Body>
|
92
|
+
</APIResponse>
|
@@ -1,46 +1,137 @@
|
|
1
1
|
<?xml version="1.0"?>
|
2
|
-
<APIResponse version="
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
2
|
+
<APIResponse version="20130430">
|
3
|
+
<Header>
|
4
|
+
<Date>2014-11-24T03:09:12+01:00</Date>
|
5
|
+
<Path>API/reservationOfFixedAmount</Path>
|
6
|
+
<ErrorCode>0</ErrorCode>
|
7
|
+
<ErrorMessage/>
|
8
|
+
</Header>
|
9
|
+
<Body>
|
10
|
+
<Result>Success</Result>
|
11
|
+
<Transactions>
|
12
|
+
<Transaction>
|
13
|
+
<TransactionId>1142651</TransactionId>
|
14
|
+
<AuthType>subscriptionAndCharge</AuthType>
|
15
|
+
<CardStatus>Valid</CardStatus>
|
16
|
+
<CreditCardExpiry>
|
17
|
+
<Year>2017</Year>
|
18
|
+
<Month>11</Month>
|
19
|
+
</CreditCardExpiry>
|
20
|
+
<CreditCardToken>1cd3d07cc81ce08d3f272bdb9f9c22960354178d</CreditCardToken>
|
21
|
+
<CreditCardMaskedPan>477571******6027</CreditCardMaskedPan>
|
22
|
+
<ThreeDSecureResult>Disabled</ThreeDSecureResult>
|
23
|
+
<CVVCheckResult>Not_Attempted</CVVCheckResult>
|
24
|
+
<BlacklistToken>a475e2908a6ab105708003dc14453ae60d32d8c5</BlacklistToken>
|
25
|
+
<ShopOrderId>82ab48de_usd-annual_956123_3a4742f998a6a81e0606217681bc41afcfcf9b48232550e517bbb037c5c3555c</ShopOrderId>
|
26
|
+
<Shop>ASmallWorld</Shop>
|
27
|
+
<Terminal>ASmallWorld CC Import USD</Terminal>
|
28
|
+
<TransactionStatus>recurring_confirmed</TransactionStatus>
|
29
|
+
<MerchantCurrency>840</MerchantCurrency>
|
30
|
+
<CardHolderCurrency>840</CardHolderCurrency>
|
31
|
+
<ReservedAmount>133.10</ReservedAmount>
|
32
|
+
<CapturedAmount>0.00</CapturedAmount>
|
33
|
+
<RefundedAmount>0.00</RefundedAmount>
|
34
|
+
<RecurringDefaultAmount>133.10</RecurringDefaultAmount>
|
35
|
+
<CreatedDate>2014-11-24 03:09:09</CreatedDate>
|
36
|
+
<UpdatedDate>2014-11-24 03:09:11</UpdatedDate>
|
37
|
+
<PaymentNature>CreditCard</PaymentNature>
|
38
|
+
<PaymentSchemeName>Visa</PaymentSchemeName>
|
39
|
+
<PaymentNatureService name="ValitorAcquirer">
|
40
|
+
<SupportsRefunds>true</SupportsRefunds>
|
41
|
+
<SupportsRelease>true</SupportsRelease>
|
42
|
+
<SupportsMultipleCaptures>true</SupportsMultipleCaptures>
|
43
|
+
<SupportsMultipleRefunds>true</SupportsMultipleRefunds>
|
44
|
+
</PaymentNatureService>
|
45
|
+
<ChargebackEvents/>
|
46
|
+
<PaymentInfos/>
|
47
|
+
<CustomerInfo>
|
48
|
+
<UserAgent/>
|
49
|
+
<IpAddress/>
|
50
|
+
<Email/>
|
51
|
+
<Username/>
|
52
|
+
<CustomerPhone/>
|
53
|
+
<OrganisationNumber/>
|
54
|
+
<CountryOfOrigin>
|
55
|
+
<Country>IT</Country>
|
56
|
+
<Source>CardNumber</Source>
|
57
|
+
</CountryOfOrigin>
|
58
|
+
<BillingAddress>
|
59
|
+
<Firstname/>
|
60
|
+
<Lastname/>
|
61
|
+
<Address/>
|
62
|
+
<City/>
|
63
|
+
<Region/>
|
64
|
+
<Country/>
|
65
|
+
<PostalCode/>
|
66
|
+
</BillingAddress>
|
67
|
+
</CustomerInfo>
|
68
|
+
<ReconciliationIdentifiers/>
|
69
|
+
</Transaction>
|
70
|
+
<Transaction>
|
71
|
+
<TransactionId>1142661</TransactionId>
|
72
|
+
<AuthType>subscription_payment</AuthType>
|
73
|
+
<CardStatus>Valid</CardStatus>
|
74
|
+
<CreditCardExpiry>
|
75
|
+
<Year>2017</Year>
|
76
|
+
<Month>11</Month>
|
77
|
+
</CreditCardExpiry>
|
78
|
+
<CreditCardToken>1cd3d07cc81ce08d3f272bdb9f9c22960354178d</CreditCardToken>
|
79
|
+
<CreditCardMaskedPan>477571******6027</CreditCardMaskedPan>
|
80
|
+
<ThreeDSecureResult>Not_Applicable</ThreeDSecureResult>
|
81
|
+
<CVVCheckResult>Not_Applicable</CVVCheckResult>
|
82
|
+
<BlacklistToken>a475e2908a6ab105708003dc14453ae60d32d8c5</BlacklistToken>
|
83
|
+
<ShopOrderId>82ab48de_usd-annual_956123_3a4742f998a6a81e0606217681bc41afcfcf9b48232550e517bbb037c5c3555c</ShopOrderId>
|
84
|
+
<Shop>ASmallWorld</Shop>
|
85
|
+
<Terminal>ASmallWorld CC Import USD</Terminal>
|
86
|
+
<TransactionStatus>captured</TransactionStatus>
|
87
|
+
<MerchantCurrency>840</MerchantCurrency>
|
88
|
+
<CardHolderCurrency>840</CardHolderCurrency>
|
89
|
+
<ReservedAmount>133.10</ReservedAmount>
|
90
|
+
<CapturedAmount>133.10</CapturedAmount>
|
91
|
+
<RefundedAmount>0.00</RefundedAmount>
|
92
|
+
<RecurringDefaultAmount>0.00</RecurringDefaultAmount>
|
93
|
+
<CreatedDate>2014-11-24 03:09:11</CreatedDate>
|
94
|
+
<UpdatedDate>2014-11-24 03:09:12</UpdatedDate>
|
95
|
+
<PaymentNature>CreditCard</PaymentNature>
|
96
|
+
<PaymentSchemeName>Visa</PaymentSchemeName>
|
97
|
+
<PaymentNatureService name="ValitorAcquirer">
|
98
|
+
<SupportsRefunds>true</SupportsRefunds>
|
99
|
+
<SupportsRelease>true</SupportsRelease>
|
100
|
+
<SupportsMultipleCaptures>true</SupportsMultipleCaptures>
|
101
|
+
<SupportsMultipleRefunds>true</SupportsMultipleRefunds>
|
102
|
+
</PaymentNatureService>
|
103
|
+
<ChargebackEvents/>
|
104
|
+
<PaymentInfos/>
|
105
|
+
<CustomerInfo>
|
106
|
+
<UserAgent/>
|
107
|
+
<IpAddress/>
|
108
|
+
<Email/>
|
109
|
+
<Username/>
|
110
|
+
<CustomerPhone/>
|
111
|
+
<OrganisationNumber/>
|
112
|
+
<CountryOfOrigin>
|
113
|
+
<Country>IT</Country>
|
114
|
+
<Source>CardNumber</Source>
|
115
|
+
</CountryOfOrigin>
|
116
|
+
<BillingAddress>
|
117
|
+
<Firstname/>
|
118
|
+
<Lastname/>
|
119
|
+
<Address/>
|
120
|
+
<City/>
|
121
|
+
<Region/>
|
122
|
+
<Country/>
|
123
|
+
<PostalCode/>
|
124
|
+
</BillingAddress>
|
125
|
+
</CustomerInfo>
|
126
|
+
<ReconciliationIdentifiers>
|
127
|
+
<ReconciliationIdentifier>
|
128
|
+
<Id>1146c933-7a74-440e-ae07-e281004c852f</Id>
|
129
|
+
<Amount currency="840">133.10</Amount>
|
130
|
+
<Type>captured</Type>
|
131
|
+
<Date>2014-11-24T03:09:12+01:00</Date>
|
132
|
+
</ReconciliationIdentifier>
|
133
|
+
</ReconciliationIdentifiers>
|
134
|
+
</Transaction>
|
135
|
+
</Transactions>
|
136
|
+
</Body>
|
137
|
+
</APIResponse>
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pensio_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Michael Sell
|
@@ -10,28 +9,25 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2014-
|
12
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rspec
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
|
-
- -
|
18
|
+
- - '>='
|
21
19
|
- !ruby/object:Gem::Version
|
22
20
|
version: '2.14'
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
|
-
- -
|
25
|
+
- - '>='
|
29
26
|
- !ruby/object:Gem::Version
|
30
27
|
version: '2.14'
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: webmock
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
32
|
- - ~>
|
37
33
|
- !ruby/object:Gem::Version
|
@@ -39,7 +35,6 @@ dependencies:
|
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
39
|
- - ~>
|
45
40
|
- !ruby/object:Gem::Version
|
@@ -47,7 +42,6 @@ dependencies:
|
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: guard
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
46
|
- - ~>
|
53
47
|
- !ruby/object:Gem::Version
|
@@ -55,7 +49,6 @@ dependencies:
|
|
55
49
|
type: :development
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
53
|
- - ~>
|
61
54
|
- !ruby/object:Gem::Version
|
@@ -63,7 +56,6 @@ dependencies:
|
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: guard-rspec
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
60
|
- - ~>
|
69
61
|
- !ruby/object:Gem::Version
|
@@ -71,7 +63,6 @@ dependencies:
|
|
71
63
|
type: :development
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
67
|
- - ~>
|
77
68
|
- !ruby/object:Gem::Version
|
@@ -79,49 +70,43 @@ dependencies:
|
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: httparty
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
|
-
- -
|
74
|
+
- - '>='
|
85
75
|
- !ruby/object:Gem::Version
|
86
76
|
version: 0.12.0
|
87
77
|
type: :runtime
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
|
-
- -
|
81
|
+
- - '>='
|
93
82
|
- !ruby/object:Gem::Version
|
94
83
|
version: 0.12.0
|
95
84
|
- !ruby/object:Gem::Dependency
|
96
85
|
name: activesupport
|
97
86
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
87
|
requirements:
|
100
|
-
- -
|
88
|
+
- - '>='
|
101
89
|
- !ruby/object:Gem::Version
|
102
90
|
version: '3.2'
|
103
91
|
type: :runtime
|
104
92
|
prerelease: false
|
105
93
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
94
|
requirements:
|
108
|
-
- -
|
95
|
+
- - '>='
|
109
96
|
- !ruby/object:Gem::Version
|
110
97
|
version: '3.2'
|
111
98
|
- !ruby/object:Gem::Dependency
|
112
99
|
name: multi_xml
|
113
100
|
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
101
|
requirements:
|
116
|
-
- -
|
102
|
+
- - '>='
|
117
103
|
- !ruby/object:Gem::Version
|
118
104
|
version: 0.5.2
|
119
105
|
type: :runtime
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
108
|
requirements:
|
124
|
-
- -
|
109
|
+
- - '>='
|
125
110
|
- !ruby/object:Gem::Version
|
126
111
|
version: 0.5.2
|
127
112
|
description:
|
@@ -139,6 +124,7 @@ files:
|
|
139
124
|
- lib/pensio_api.rb
|
140
125
|
- lib/pensio_api/billing_address.rb
|
141
126
|
- lib/pensio_api/callback.rb
|
127
|
+
- lib/pensio_api/chargeback_event.rb
|
142
128
|
- lib/pensio_api/credentials.rb
|
143
129
|
- lib/pensio_api/ecommerce.rb
|
144
130
|
- lib/pensio_api/errors/bad_request.rb
|
@@ -154,6 +140,7 @@ files:
|
|
154
140
|
- lib/pensio_api/request.rb
|
155
141
|
- lib/pensio_api/reservation.rb
|
156
142
|
- lib/pensio_api/responses/base.rb
|
143
|
+
- lib/pensio_api/responses/chargeback_callback.rb
|
157
144
|
- lib/pensio_api/responses/funding_list.rb
|
158
145
|
- lib/pensio_api/responses/gateway_url.rb
|
159
146
|
- lib/pensio_api/responses/refund.rb
|
@@ -171,6 +158,7 @@ files:
|
|
171
158
|
- pensio_api.gemspec
|
172
159
|
- spec/lib/pensio_api/billing_address_spec.rb
|
173
160
|
- spec/lib/pensio_api/callback_spec.rb
|
161
|
+
- spec/lib/pensio_api/chargeback_event_spec.rb
|
174
162
|
- spec/lib/pensio_api/ecommerce_spec.rb
|
175
163
|
- spec/lib/pensio_api/errors/bad_request_spec.rb
|
176
164
|
- spec/lib/pensio_api/errors/gateway_error_spec.rb
|
@@ -179,6 +167,7 @@ files:
|
|
179
167
|
- spec/lib/pensio_api/request_spec.rb
|
180
168
|
- spec/lib/pensio_api/reservation_spec.rb
|
181
169
|
- spec/lib/pensio_api/responses/base_spec.rb
|
170
|
+
- spec/lib/pensio_api/responses/chargeback_callback_spec.rb
|
182
171
|
- spec/lib/pensio_api/responses/funding_list_spec.rb
|
183
172
|
- spec/lib/pensio_api/responses/gateway_url_spec.rb
|
184
173
|
- spec/lib/pensio_api/responses/refund_spec.rb
|
@@ -197,6 +186,7 @@ files:
|
|
197
186
|
- spec/support/fixtures/bad_request_error.xml
|
198
187
|
- spec/support/fixtures/capture_reservation.xml
|
199
188
|
- spec/support/fixtures/charge_subscription.xml
|
189
|
+
- spec/support/fixtures/chargeback_callback.xml
|
200
190
|
- spec/support/fixtures/create_multi_payment_request.xml
|
201
191
|
- spec/support/fixtures/create_payment_request.xml
|
202
192
|
- spec/support/fixtures/failure_callback.xml
|
@@ -220,31 +210,31 @@ files:
|
|
220
210
|
homepage:
|
221
211
|
licenses:
|
222
212
|
- BSD-3-Clause
|
213
|
+
metadata: {}
|
223
214
|
post_install_message:
|
224
215
|
rdoc_options: []
|
225
216
|
require_paths:
|
226
217
|
- lib
|
227
218
|
required_ruby_version: !ruby/object:Gem::Requirement
|
228
|
-
none: false
|
229
219
|
requirements:
|
230
|
-
- -
|
220
|
+
- - '>='
|
231
221
|
- !ruby/object:Gem::Version
|
232
222
|
version: '0'
|
233
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
|
-
none: false
|
235
224
|
requirements:
|
236
|
-
- -
|
225
|
+
- - '>='
|
237
226
|
- !ruby/object:Gem::Version
|
238
227
|
version: '0'
|
239
228
|
requirements: []
|
240
229
|
rubyforge_project:
|
241
|
-
rubygems_version:
|
230
|
+
rubygems_version: 2.0.14
|
242
231
|
signing_key:
|
243
|
-
specification_version:
|
232
|
+
specification_version: 4
|
244
233
|
summary: Provides integration for the Pensio Merchant API
|
245
234
|
test_files:
|
246
235
|
- spec/lib/pensio_api/billing_address_spec.rb
|
247
236
|
- spec/lib/pensio_api/callback_spec.rb
|
237
|
+
- spec/lib/pensio_api/chargeback_event_spec.rb
|
248
238
|
- spec/lib/pensio_api/ecommerce_spec.rb
|
249
239
|
- spec/lib/pensio_api/errors/bad_request_spec.rb
|
250
240
|
- spec/lib/pensio_api/errors/gateway_error_spec.rb
|
@@ -253,6 +243,7 @@ test_files:
|
|
253
243
|
- spec/lib/pensio_api/request_spec.rb
|
254
244
|
- spec/lib/pensio_api/reservation_spec.rb
|
255
245
|
- spec/lib/pensio_api/responses/base_spec.rb
|
246
|
+
- spec/lib/pensio_api/responses/chargeback_callback_spec.rb
|
256
247
|
- spec/lib/pensio_api/responses/funding_list_spec.rb
|
257
248
|
- spec/lib/pensio_api/responses/gateway_url_spec.rb
|
258
249
|
- spec/lib/pensio_api/responses/refund_spec.rb
|
@@ -271,6 +262,7 @@ test_files:
|
|
271
262
|
- spec/support/fixtures/bad_request_error.xml
|
272
263
|
- spec/support/fixtures/capture_reservation.xml
|
273
264
|
- spec/support/fixtures/charge_subscription.xml
|
265
|
+
- spec/support/fixtures/chargeback_callback.xml
|
274
266
|
- spec/support/fixtures/create_multi_payment_request.xml
|
275
267
|
- spec/support/fixtures/create_payment_request.xml
|
276
268
|
- spec/support/fixtures/failure_callback.xml
|