mollie-api-ruby 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/Mollie/API/Client.rb +4 -1
- data/lib/Mollie/API/Client/Version.rb +1 -1
- data/lib/Mollie/API/Object/Mandate.rb +22 -0
- data/lib/Mollie/API/Object/Payment.rb +9 -0
- data/lib/Mollie/API/Resource/Customers/Mandates.rb +27 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3ecdf3376a303c38df328578303fbc2810775c2
|
4
|
+
data.tar.gz: f9375c2ecf013eb5ab37d65121cc38aab8ed044a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e155061352f2d3e087772cc17245592a01b746a9ef096ea1bbf8647570672b3a5681b0d5c16bebce32d0c602820c874e3ac893d1dad5552fc579da8bc49a9b73
|
7
|
+
data.tar.gz: 8f2bd46c46f28ab71b554a5111ce90e0d202b6d8c05427a55da3d61efcd64dc2ddd2e9f9b3cdb721938e73d9264b13ed4019a83e47fa240f1bb22124fd32a455
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
![Mollie](https://www.mollie.com/files/Mollie-Logo-Style-Small.png)
|
2
|
+
|
3
|
+
### Changelog
|
4
|
+
|
5
|
+
All notable changes to this project will be documented in this file.
|
6
|
+
|
7
|
+
|
8
|
+
#### v1.3.0 - 2016-04-14
|
9
|
+
- Added Mandates API.
|
10
|
+
- Added `recurringType` and `mandateId` to Payments API.
|
11
|
+
|
12
|
+
#### v1.2.2 - 2016-03-21
|
13
|
+
- The members `customers` and `customers_payments` weren't made public within `attr_reader` ([#21](https://github.com/mollie/mollie-api-ruby/pull/21)).
|
14
|
+
- Updated the bundled CA's cacert.pem file to date `Jan 20, 2016`.
|
data/lib/Mollie/API/Client.rb
CHANGED
@@ -6,6 +6,7 @@ require "rest_client"
|
|
6
6
|
"Resource/Base",
|
7
7
|
"Resource/Customers",
|
8
8
|
"Resource/Customers/Payments",
|
9
|
+
"Resource/Customers/Mandates",
|
9
10
|
"Resource/Payments",
|
10
11
|
"Resource/Payments/Refunds",
|
11
12
|
"Resource/Issuers",
|
@@ -13,6 +14,7 @@ require "rest_client"
|
|
13
14
|
"Object/Base",
|
14
15
|
"Object/List",
|
15
16
|
"Object/Customer",
|
17
|
+
"Object/Mandate",
|
16
18
|
"Object/Payment",
|
17
19
|
"Object/Payment/Refund",
|
18
20
|
"Object/Issuer",
|
@@ -24,7 +26,7 @@ module Mollie
|
|
24
26
|
API_ENDPOINT = "https://api.mollie.nl"
|
25
27
|
API_VERSION = "v1"
|
26
28
|
|
27
|
-
attr_reader :payments, :issuers, :methods, :payments_refunds, :customers, :customers_payments
|
29
|
+
attr_reader :payments, :issuers, :methods, :payments_refunds, :customers, :customers_payments, :customers_mandates
|
28
30
|
|
29
31
|
def initialize
|
30
32
|
@payments = Mollie::API::Resource::Payments.new self
|
@@ -33,6 +35,7 @@ module Mollie
|
|
33
35
|
@payments_refunds = Mollie::API::Resource::Payments::Refunds.new self
|
34
36
|
@customers = Mollie::API::Resource::Customers.new self
|
35
37
|
@customers_payments = Mollie::API::Resource::Customers::Payments.new self
|
38
|
+
@customers_mandates = Mollie::API::Resource::Customers::Mandates.new self
|
36
39
|
|
37
40
|
@api_endpoint = API_ENDPOINT
|
38
41
|
@api_key = ""
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Mollie
|
2
|
+
module API
|
3
|
+
module Object
|
4
|
+
class Mandate < Base
|
5
|
+
STATUS_VALID = "valid"
|
6
|
+
STATUS_INVALID = "invalid"
|
7
|
+
|
8
|
+
attr_accessor :resource,
|
9
|
+
:id,
|
10
|
+
:status,
|
11
|
+
:method,
|
12
|
+
:customerId,
|
13
|
+
:details,
|
14
|
+
:createdDatetime
|
15
|
+
|
16
|
+
def valid?
|
17
|
+
@status == STATUS_VALID
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -7,6 +7,11 @@ module Mollie
|
|
7
7
|
STATUS_EXPIRED = "expired"
|
8
8
|
STATUS_PAID = "paid"
|
9
9
|
STATUS_PAIDOUT = "paidout"
|
10
|
+
STATUS_FAILED = "failed"
|
11
|
+
|
12
|
+
RECURRINGTYPE_NONE = nil
|
13
|
+
RECURRINGTYPE_FIRST = "first"
|
14
|
+
RECURRINGTYPE_RECURRING = "recurring"
|
10
15
|
|
11
16
|
attr_accessor :id,
|
12
17
|
:status,
|
@@ -18,6 +23,10 @@ module Mollie
|
|
18
23
|
:paidDatetime,
|
19
24
|
:expiredDatetime,
|
20
25
|
:cancelledDatetime,
|
26
|
+
:customerId,
|
27
|
+
:recurringType,
|
28
|
+
:mandateId,
|
29
|
+
:settlementId,
|
21
30
|
:metadata,
|
22
31
|
:details,
|
23
32
|
:links
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'open-uri'
|
2
|
+
|
3
|
+
module Mollie
|
4
|
+
module API
|
5
|
+
module Resource
|
6
|
+
class Customers
|
7
|
+
class Mandates < Base
|
8
|
+
@customer_id = nil
|
9
|
+
|
10
|
+
def getResourceObject
|
11
|
+
Mollie::API::Object::Mandate
|
12
|
+
end
|
13
|
+
|
14
|
+
def getResourceName
|
15
|
+
customer_id = URI::encode(@customer_id)
|
16
|
+
"customers/#{customer_id}/mandates"
|
17
|
+
end
|
18
|
+
|
19
|
+
def with(customer)
|
20
|
+
@customer_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.3.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-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -49,6 +49,7 @@ extensions: []
|
|
49
49
|
extra_rdoc_files: []
|
50
50
|
files:
|
51
51
|
- .gitignore
|
52
|
+
- CHANGELOG.md
|
52
53
|
- Gemfile
|
53
54
|
- LICENSE
|
54
55
|
- README.mdown
|
@@ -68,11 +69,13 @@ files:
|
|
68
69
|
- lib/Mollie/API/Object/Customer.rb
|
69
70
|
- lib/Mollie/API/Object/Issuer.rb
|
70
71
|
- lib/Mollie/API/Object/List.rb
|
72
|
+
- lib/Mollie/API/Object/Mandate.rb
|
71
73
|
- lib/Mollie/API/Object/Method.rb
|
72
74
|
- lib/Mollie/API/Object/Payment.rb
|
73
75
|
- lib/Mollie/API/Object/Payment/Refund.rb
|
74
76
|
- lib/Mollie/API/Resource/Base.rb
|
75
77
|
- lib/Mollie/API/Resource/Customers.rb
|
78
|
+
- lib/Mollie/API/Resource/Customers/Mandates.rb
|
76
79
|
- lib/Mollie/API/Resource/Customers/Payments.rb
|
77
80
|
- lib/Mollie/API/Resource/Issuers.rb
|
78
81
|
- lib/Mollie/API/Resource/Methods.rb
|