mollie-api-ruby 4.2.0 → 4.3.0
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.
- checksums.yaml +4 -4
- data/lib/mollie/customer/subscription.rb +15 -1
- data/lib/mollie/method.rb +1 -0
- data/lib/mollie/version.rb +1 -1
- data/test/mollie/customer/subscription_test.rb +23 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8219c2ba3d9415f5294b79da9845e9914241a077be0500a68b2753b63a9e8431
|
4
|
+
data.tar.gz: 3051095f7085a9939241a57c91ada338bf7a312389d84c549ca77e1afbe556e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c28a10d1571cbabec38d25bc8bd3e07ddecc2ebd8b5e95f111ba91c1c36fe8d1ed53a1dcbc992a9b52f6c69f4f26a57de947c3578d6accd2ecb1aa73796a558
|
7
|
+
data.tar.gz: 15ec0272da3d7233f8446a2d73e19c7820b07e84f3dc46455f4d8c38e521a854632a591274a45e871d1f55c09fed74ed6cc863eac4c1865c54548c96ff8da978
|
@@ -22,7 +22,11 @@ module Mollie
|
|
22
22
|
:mandate_id,
|
23
23
|
:canceled_at,
|
24
24
|
:webhook_url,
|
25
|
-
:metadata
|
25
|
+
:metadata,
|
26
|
+
:_links,
|
27
|
+
:application_fee
|
28
|
+
|
29
|
+
alias links _links
|
26
30
|
|
27
31
|
def active?
|
28
32
|
status == STATUS_ACTIVE
|
@@ -83,6 +87,16 @@ module Mollie
|
|
83
87
|
def metadata=(metadata)
|
84
88
|
@metadata = OpenStruct.new(metadata) if metadata.is_a?(Hash)
|
85
89
|
end
|
90
|
+
|
91
|
+
def application_fee=(application_fee)
|
92
|
+
amount = Amount.new(application_fee['amount'])
|
93
|
+
description = application_fee['description']
|
94
|
+
|
95
|
+
@application_fee = OpenStruct.new(
|
96
|
+
amount: amount,
|
97
|
+
description: description
|
98
|
+
)
|
99
|
+
end
|
86
100
|
end
|
87
101
|
end
|
88
102
|
end
|
data/lib/mollie/method.rb
CHANGED
data/lib/mollie/version.rb
CHANGED
@@ -118,10 +118,31 @@ module Mollie
|
|
118
118
|
}
|
119
119
|
), headers: {})
|
120
120
|
|
121
|
-
|
122
|
-
customer =
|
121
|
+
subscription = Customer::Subscription.get('sub_rVKGtNd6s3', customer_id: 'cst_8wmqcHMN4U')
|
122
|
+
customer = subscription.customer
|
123
123
|
assert_equal 'cst_8wmqcHMN4U', customer.id
|
124
124
|
end
|
125
|
+
|
126
|
+
def test_application_fee
|
127
|
+
stub_request(:get, 'https://api.mollie.com/v2/customers/cst_8wmqcHMN4U/subscriptions/sub_rVKGtNd6s3')
|
128
|
+
.to_return(status: 200, body: %(
|
129
|
+
{
|
130
|
+
"resource": "subscription",
|
131
|
+
"id": "sub_rVKGtNd6s3",
|
132
|
+
"application_fee": {
|
133
|
+
"amount": {
|
134
|
+
"value": "42.10",
|
135
|
+
"currency": "EUR"
|
136
|
+
},
|
137
|
+
"description": "Example application fee"
|
138
|
+
}
|
139
|
+
}
|
140
|
+
), headers: {})
|
141
|
+
|
142
|
+
subscription = Customer::Subscription.get('sub_rVKGtNd6s3', customer_id: 'cst_8wmqcHMN4U')
|
143
|
+
assert_equal 42.10, subscription.application_fee.amount.value
|
144
|
+
assert_equal'EUR', subscription.application_fee.amount.currency
|
145
|
+
end
|
125
146
|
end
|
126
147
|
end
|
127
148
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mollie-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mollie B.V.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|