mollie-api-ruby 1.3.0 → 1.4.0

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: d3ecdf3376a303c38df328578303fbc2810775c2
4
- data.tar.gz: f9375c2ecf013eb5ab37d65121cc38aab8ed044a
3
+ metadata.gz: 76802b11edfb963aaf04831f9a89df8c1dd199ef
4
+ data.tar.gz: 17967bc3837b5508da8ac6d201d35c1757f50e07
5
5
  SHA512:
6
- metadata.gz: e155061352f2d3e087772cc17245592a01b746a9ef096ea1bbf8647570672b3a5681b0d5c16bebce32d0c602820c874e3ac893d1dad5552fc579da8bc49a9b73
7
- data.tar.gz: 8f2bd46c46f28ab71b554a5111ce90e0d202b6d8c05427a55da3d61efcd64dc2ddd2e9f9b3cdb721938e73d9264b13ed4019a83e47fa240f1bb22124fd32a455
6
+ metadata.gz: 639230a40324be5713e4774b7f2b1443c353cfe1372031b05f7972efc1e74f86daa435c46df8b6cc7dba196a7a5c204f73e7fe13d8c99542d21d49dd541b1cb4
7
+ data.tar.gz: 8298f7e326c2a2af7f2856279d58b8f3ac4d2fa405e4f63fb1e82320ce90701c469035f7b83924ed7a46a84ca03e4b5f31045e198c871b17650a5be86015663b
data/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
 
7
7
 
8
+ #### v1.4.0 - 2016-06-16
9
+ - Added Subscriptions API.
10
+
8
11
  #### v1.3.0 - 2016-04-14
9
12
  - Added Mandates API.
10
13
  - Added `recurringType` and `mandateId` to Payments API.
@@ -7,6 +7,7 @@ require "rest_client"
7
7
  "Resource/Customers",
8
8
  "Resource/Customers/Payments",
9
9
  "Resource/Customers/Mandates",
10
+ "Resource/Customers/Subscriptions",
10
11
  "Resource/Payments",
11
12
  "Resource/Payments/Refunds",
12
13
  "Resource/Issuers",
@@ -15,6 +16,7 @@ require "rest_client"
15
16
  "Object/List",
16
17
  "Object/Customer",
17
18
  "Object/Mandate",
19
+ "Object/Subscription",
18
20
  "Object/Payment",
19
21
  "Object/Payment/Refund",
20
22
  "Object/Issuer",
@@ -26,16 +28,17 @@ module Mollie
26
28
  API_ENDPOINT = "https://api.mollie.nl"
27
29
  API_VERSION = "v1"
28
30
 
29
- attr_reader :payments, :issuers, :methods, :payments_refunds, :customers, :customers_payments, :customers_mandates
31
+ attr_reader :payments, :issuers, :methods, :payments_refunds, :customers, :customers_payments, :customers_mandates, :customers_subscriptions
30
32
 
31
33
  def initialize
32
- @payments = Mollie::API::Resource::Payments.new self
33
- @issuers = Mollie::API::Resource::Issuers.new self
34
- @methods = Mollie::API::Resource::Methods.new self
35
- @payments_refunds = Mollie::API::Resource::Payments::Refunds.new self
36
- @customers = Mollie::API::Resource::Customers.new self
37
- @customers_payments = Mollie::API::Resource::Customers::Payments.new self
38
- @customers_mandates = Mollie::API::Resource::Customers::Mandates.new self
34
+ @payments = Mollie::API::Resource::Payments.new self
35
+ @issuers = Mollie::API::Resource::Issuers.new self
36
+ @methods = Mollie::API::Resource::Methods.new self
37
+ @payments_refunds = Mollie::API::Resource::Payments::Refunds.new self
38
+ @customers = Mollie::API::Resource::Customers.new self
39
+ @customers_payments = Mollie::API::Resource::Customers::Payments.new self
40
+ @customers_mandates = Mollie::API::Resource::Customers::Mandates.new self
41
+ @customers_subscriptions = Mollie::API::Resource::Customers::Subscriptions.new self
39
42
 
40
43
  @api_endpoint = API_ENDPOINT
41
44
  @api_key = ""
@@ -1,7 +1,7 @@
1
1
  module Mollie
2
2
  module API
3
3
  class Client
4
- CLIENT_VERSION = "1.3.0"
4
+ CLIENT_VERSION = "1.4.0"
5
5
  end
6
6
  end
7
7
  end
@@ -26,6 +26,7 @@ module Mollie
26
26
  :customerId,
27
27
  :recurringType,
28
28
  :mandateId,
29
+ :subscriptionId,
29
30
  :settlementId,
30
31
  :metadata,
31
32
  :details,
@@ -0,0 +1,26 @@
1
+ module Mollie
2
+ module API
3
+ module Object
4
+ class Subscription < Base
5
+ STATUS_ACTIVE = "active"
6
+ STATUS_PENDING = "pending" # Waiting for a valid mandate.
7
+ STATUS_CANCELLED = "cancelled"
8
+ STATUS_SUSPENDED = "suspended" # Active, but mandate became invalid.
9
+ STATUS_COMPLETED = "completed"
10
+
11
+ attr_accessor :resource,
12
+ :id,
13
+ :customerId,
14
+ :mode,
15
+ :createdDatetime,
16
+ :status,
17
+ :amount,
18
+ :times,
19
+ :interval,
20
+ :description,
21
+ :method,
22
+ :cancelledDatetime
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
1
+ require 'open-uri'
2
+
3
+ module Mollie
4
+ module API
5
+ module Resource
6
+ class Customers
7
+ class Subscriptions < Base
8
+ @parent_id = nil
9
+
10
+ def getResourceObject
11
+ Mollie::API::Object::Subscription
12
+ end
13
+
14
+ def getResourceName
15
+ customer_id = URI::encode(@parent_id)
16
+ "customers/#{parent_id}/subscriptions"
17
+ end
18
+
19
+ def with(customer)
20
+ @parent_id = customer.id
21
+ self
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ 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: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Wong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-10 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -73,10 +73,12 @@ files:
73
73
  - lib/Mollie/API/Object/Method.rb
74
74
  - lib/Mollie/API/Object/Payment.rb
75
75
  - lib/Mollie/API/Object/Payment/Refund.rb
76
+ - lib/Mollie/API/Object/Subscription.rb
76
77
  - lib/Mollie/API/Resource/Base.rb
77
78
  - lib/Mollie/API/Resource/Customers.rb
78
79
  - lib/Mollie/API/Resource/Customers/Mandates.rb
79
80
  - lib/Mollie/API/Resource/Customers/Payments.rb
81
+ - lib/Mollie/API/Resource/Customers/Subscriptions.rb
80
82
  - lib/Mollie/API/Resource/Issuers.rb
81
83
  - lib/Mollie/API/Resource/Methods.rb
82
84
  - lib/Mollie/API/Resource/Payments.rb
@@ -103,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
105
  version: '0'
104
106
  requirements: []
105
107
  rubyforge_project:
106
- rubygems_version: 2.6.2
108
+ rubygems_version: 2.0.14.1
107
109
  signing_key:
108
110
  specification_version: 4
109
111
  summary: Official Mollie API Client for Ruby