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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80149a64f6e6f8def71896e3314735e80c38c9a850caee2cc30360b497266420
4
- data.tar.gz: eee5d9091f11003014440d9f6f987f500be0d8df8bd8969ee9a09833d8b77884
3
+ metadata.gz: 8219c2ba3d9415f5294b79da9845e9914241a077be0500a68b2753b63a9e8431
4
+ data.tar.gz: 3051095f7085a9939241a57c91ada338bf7a312389d84c549ca77e1afbe556e1
5
5
  SHA512:
6
- metadata.gz: c026289276458498347a32399665d3b457403114ca1766ca960b2d9760a13995c462ebe3399a4919816c33e26a1605a0844c70cd583e2b3a1863823a8ce382ab
7
- data.tar.gz: 18aa4a03f91632c0287011e536a74376113c477fa315e56d57407a043648e13c42af7b47010027a6772a04ad12b8463c2a3eff62ee185e9a6f94bb35fc6e7d57
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
@@ -1,5 +1,6 @@
1
1
  module Mollie
2
2
  class Method < Base
3
+ APPLEPAY = 'applepay'.freeze
3
4
  BANCONTACT = 'bancontact'.freeze
4
5
  BANKTRANSFER = 'banktransfer'.freeze
5
6
  BELFIUS = 'belfius'.freeze
@@ -1,3 +1,3 @@
1
1
  module Mollie
2
- VERSION = '4.2.0'.freeze
2
+ VERSION = '4.3.0'.freeze
3
3
  end
@@ -118,10 +118,31 @@ module Mollie
118
118
  }
119
119
  ), headers: {})
120
120
 
121
- payment = Customer::Subscription.get('sub_rVKGtNd6s3', customer_id: 'cst_8wmqcHMN4U')
122
- customer = payment.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.2.0
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-01 00:00:00.000000000 Z
11
+ date: 2019-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake