mollie-payment 0.0.2 → 0.1.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.
- data/.gitignore +1 -0
- data/README.md +4 -2
- data/lib/mollie/ideal/version.rb +1 -1
- data/lib/mollie/ideal.rb +66 -70
- data/mollie-ideal.gemspec +2 -3
- metadata +17 -5
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
Mollie Payment
|
2
2
|
========
|
3
3
|
|
4
|
-
This repository is currently under [
|
4
|
+
This repository is currently a work in progress and under [Documentation Driven Development](http://thinkingphp.org/spliceit/docs/0.1_alpha/pages/ddd_info.html).
|
5
5
|
|
6
|
-
|
6
|
+
On the one hand to get familiar with documenting and [YARD](http://yardoc.org/). On the other hand to create an opiniated Ruby-wrapper for the Mollie [iDEAL API](https://www.mollie.nl/beheer/betaaldiensten/documentatie/ideal/).
|
7
|
+
|
8
|
+
The generated docs can be [found here](http://rubydoc.info/gems/mollie-payment/0.0.2/frames).
|
7
9
|
|
8
10
|
Develop
|
9
11
|
------------
|
data/lib/mollie/ideal/version.rb
CHANGED
data/lib/mollie/ideal.rb
CHANGED
@@ -1,93 +1,89 @@
|
|
1
1
|
module Mollie
|
2
2
|
class Ideal
|
3
|
-
#
|
3
|
+
# Create a new Ideal object
|
4
4
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
10
|
-
#
|
11
|
-
# mi = Mollie::Ideal.new('123456', :test => false)
|
12
|
-
#
|
13
|
-
def initialize(partner_id, options={:test => true});end
|
5
|
+
# @param [String] partner_id your Mollie partner id
|
6
|
+
# @param [Hash] options
|
7
|
+
# @option options [Boolean] :production (false) whether or not to operate
|
8
|
+
# in production-mode
|
9
|
+
def initialize(partner_id, options={:production => false});end
|
14
10
|
|
15
|
-
#
|
11
|
+
# All supported banks.
|
16
12
|
#
|
17
|
-
#
|
13
|
+
# @visibility public
|
18
14
|
#
|
19
|
-
#
|
15
|
+
# @example
|
16
|
+
# Mollie::Ideal.banks
|
20
17
|
# # => [{:id => '0031', :name => 'ABN AMRO'}, ...]
|
21
18
|
#
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
banklist
|
27
|
-
end
|
28
|
-
|
29
|
-
def banklist
|
30
|
-
self.class.banklist
|
19
|
+
# @return [Array<Hash{Symbol => String}>] the list of banks.
|
20
|
+
def self.banks;end
|
21
|
+
class << self
|
22
|
+
alias :banklist :banks
|
31
23
|
end
|
32
|
-
alias :banks :banklist
|
33
24
|
|
34
|
-
#
|
25
|
+
# Request a transaction.
|
35
26
|
#
|
36
|
-
#
|
37
|
-
# :amount - Fixnum the amount *in cents*
|
38
|
-
# :bank_id - String id of the bank
|
39
|
-
# :description - String description of the transaction (max. 30
|
40
|
-
# characters)
|
41
|
-
# :report_url - String url where the result of the transaction
|
42
|
-
# is sent
|
43
|
-
# :return_url - String url where the visitor is sent
|
44
|
-
# :profile_key - String profile this transaction should be linked
|
45
|
-
# to (default: nil)
|
46
|
-
#
|
47
|
-
# Examples
|
27
|
+
# @visibility public
|
48
28
|
#
|
29
|
+
# @param [Hash] opts
|
30
|
+
# @option opts [Fixnum] :amount the amount in cents.
|
31
|
+
# @option opts [String] :bank_id the id of the bank (see {banks}).
|
32
|
+
# @option opts [String] :description description of the transaction
|
33
|
+
# (max. 30 characters).
|
34
|
+
# @option opts [String] :report_url address where the result of the
|
35
|
+
# transaction is sent (POSTed?).
|
36
|
+
# @option opts [String] :return_url address where the visitor is sent.
|
37
|
+
# @option opts [String] :profile_key (nil) the profile this transaction
|
38
|
+
# should be linked to.
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
#
|
49
42
|
# mi = Mollie::Ideal.new('12345')
|
50
|
-
# mi.
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
43
|
+
# mi.request_transaction(:amount => 1465,
|
44
|
+
# :bank_id => '0721',
|
45
|
+
# :description => "Charlie Brown's Tree",
|
46
|
+
# :report_url => 'http://example.org/report',
|
47
|
+
# :return_url => 'http://example.org/return')
|
54
48
|
# # => {
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
49
|
+
# # :transaction_id => '482d599bbcc7795727650330ad65fe9b',
|
50
|
+
# # :amount => 1465,
|
51
|
+
# # :currency => 'EUR',
|
52
|
+
# # :url => 'https://mijn.postbank.nl/...',
|
53
|
+
# # }
|
60
54
|
#
|
61
|
-
#
|
62
|
-
|
63
|
-
def fetch(options);end
|
55
|
+
# @return [Hash] the transaction (see example)
|
56
|
+
def request_transaction(opts);end
|
64
57
|
|
65
|
-
#
|
66
|
-
#
|
67
|
-
# options - Hash options:
|
68
|
-
# :transaction_id - String id of the transaction
|
58
|
+
# Verify the status of a transaction.
|
69
59
|
#
|
70
|
-
#
|
60
|
+
# @visibility public
|
71
61
|
#
|
62
|
+
# @param [Hash] options
|
63
|
+
# @option options [String] :transaction_id the transaction to verify.
|
64
|
+
#
|
65
|
+
# @example
|
72
66
|
# mi = Mollie::Ideal.new('12345')
|
73
|
-
# mi.
|
67
|
+
# mi.verify_transaction(:transaction_id => '482d599bbcc7795727650330ad65fe9b')
|
74
68
|
# # => {
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
69
|
+
# # :transaction_id => '482d599bbcc7795727650330ad65fe9b',
|
70
|
+
# # :amount => 1465,
|
71
|
+
# # :currency => 'EUR',
|
72
|
+
# # :payed => true,
|
73
|
+
# # :consumer => {
|
74
|
+
# # :name => 'Hr J Janssen',
|
75
|
+
# # :account => 'P001234567',
|
76
|
+
# # :city => 'Amsterdam'
|
77
|
+
# # },
|
78
|
+
# # :message => 'This iDEAL-order has successfuly been payed for,
|
79
|
+
# # and this is the first time you check it.'
|
80
|
+
# # }
|
87
81
|
# TODO: docs mention 'status' instead of 'message'
|
88
|
-
#
|
89
|
-
#
|
90
|
-
|
91
|
-
|
82
|
+
#
|
83
|
+
# @note Once a transaction is payed, only the next time you verify the
|
84
|
+
# transaction will the value of 'payed' be 'true'.
|
85
|
+
# Else it will be 'false'.
|
86
|
+
# @return [Hash] the status of the transaction (see example)
|
87
|
+
def verify_transaction(options);end
|
92
88
|
end
|
93
89
|
end
|
data/mollie-ideal.gemspec
CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_development_dependency "
|
22
|
-
|
23
|
-
# s.add_runtime_dependency "rest-client"
|
21
|
+
s.add_development_dependency "yard"
|
22
|
+
s.add_development_dependency "rdiscount"
|
24
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mollie-payment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-12-01 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: yard
|
16
|
+
requirement: &70303083420680 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,18 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70303083420680
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rdiscount
|
27
|
+
requirement: &70303083420260 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70303083420260
|
25
36
|
description: WIP
|
26
37
|
email:
|
27
38
|
- gert@thinkcreate.nl
|
@@ -62,3 +73,4 @@ signing_key:
|
|
62
73
|
specification_version: 3
|
63
74
|
summary: WIP
|
64
75
|
test_files: []
|
76
|
+
has_rdoc:
|