mollie-payment 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ Gemfile.lock
4
4
  pkg/*
5
5
  .rbenv-gemsets
6
6
  .rbenv-version
7
+ .yardoc
data/README.md CHANGED
@@ -1,9 +1,11 @@
1
1
  Mollie Payment
2
2
  ========
3
3
 
4
- This repository is currently under [Readme Driven Development](http://tom.preston-werner.com/2010/08/23/readme-driven-development.html); an empty box with no implementation, only a documented interface.
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
- Documentation uses the [Tomdoc](http://tomdoc.org/) specification. The generated docs can be [found here](http://rubydoc.info/gems/mollie-payment/0.0.2/frames).
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
  ------------
@@ -1,5 +1,5 @@
1
1
  module Mollie
2
2
  class Ideal
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
data/lib/mollie/ideal.rb CHANGED
@@ -1,93 +1,89 @@
1
1
  module Mollie
2
2
  class Ideal
3
- # Public: Initialize Ideal
3
+ # Create a new Ideal object
4
4
  #
5
- # partner_id - String your Mollie partner id
6
- # options - Hash options:
7
- # :test - Boolean use testmode? (default: true)
8
- #
9
- # Examples
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
- # Public: All supported banks.
11
+ # All supported banks.
16
12
  #
17
- # Examples
13
+ # @visibility public
18
14
  #
19
- # Mollie::Ideal.banklist
15
+ # @example
16
+ # Mollie::Ideal.banks
20
17
  # # => [{:id => '0031', :name => 'ABN AMRO'}, ...]
21
18
  #
22
- # Returns an Array of Hash representing banks (keys: String id,
23
- # String name).
24
- def self.banklist;end
25
- def self.banks
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
- # Public: Request a transaction.
25
+ # Request a transaction.
35
26
  #
36
- # options - Hash options:
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.fetch(:amount => 1465, :bank_id => '0721',
51
- # :description => "Charlie Brown's Tree",
52
- # :report_url => 'http://example.org/report',
53
- # :return_url => 'http://example.org/return')
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
- # :transaction_id => '482d599bbcc7795727650330ad65fe9b',
56
- # :amount => 1465,
57
- # :currency => 'EUR',
58
- # :url => 'https://mijn.postbank.nl/...',
59
- # }
49
+ # # :transaction_id => '482d599bbcc7795727650330ad65fe9b',
50
+ # # :amount => 1465,
51
+ # # :currency => 'EUR',
52
+ # # :url => 'https://mijn.postbank.nl/...',
53
+ # # }
60
54
  #
61
- # Returns a Hash representing the transaction (keys: Fixnum amount,
62
- # String currency, String transaction_id, String url).
63
- def fetch(options);end
55
+ # @return [Hash] the transaction (see example)
56
+ def request_transaction(opts);end
64
57
 
65
- # Public: Verify the status of a transaction.
66
- #
67
- # options - Hash options:
68
- # :transaction_id - String id of the transaction
58
+ # Verify the status of a transaction.
69
59
  #
70
- # Examples
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.check(:transaction_id => '12345')
67
+ # mi.verify_transaction(:transaction_id => '482d599bbcc7795727650330ad65fe9b')
74
68
  # # => {
75
- # :transaction_id => '482d599bbcc7795727650330ad65fe9b',
76
- # :amount => 1465,
77
- # :currency => 'EUR',
78
- # :payed => true,
79
- # :consumer => {
80
- # :name => 'Hr J Janssen',
81
- # :account => 'P001234567',
82
- # :city => 'Amsterdam'
83
- # },
84
- # :message => 'This iDEAL-order has successfuly been payed for,
85
- # and this is the first time you check it.'
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
- # Returns A Hash representing the result of the transaction (see Examples).
90
- def check(options);end
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 "tomdoc"
22
- # s.add_development_dependency "nokogiri"
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.2
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-10-13 00:00:00.000000000Z
12
+ date: 2011-12-01 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: tomdoc
16
- requirement: &70290978503740 !ruby/object:Gem::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: *70290978503740
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: