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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76802b11edfb963aaf04831f9a89df8c1dd199ef
|
4
|
+
data.tar.gz: 17967bc3837b5508da8ac6d201d35c1757f50e07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 639230a40324be5713e4774b7f2b1443c353cfe1372031b05f7972efc1e74f86daa435c46df8b6cc7dba196a7a5c204f73e7fe13d8c99542d21d49dd541b1cb4
|
7
|
+
data.tar.gz: 8298f7e326c2a2af7f2856279d58b8f3ac4d2fa405e4f63fb1e82320ce90701c469035f7b83924ed7a46a84ca03e4b5f31045e198c871b17650a5be86015663b
|
data/CHANGELOG.md
CHANGED
data/lib/Mollie/API/Client.rb
CHANGED
@@ -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
|
33
|
-
@issuers
|
34
|
-
@methods
|
35
|
-
@payments_refunds
|
36
|
-
@customers
|
37
|
-
@customers_payments
|
38
|
-
@customers_mandates
|
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 = ""
|
@@ -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.
|
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-
|
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.
|
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
|