przelewy24 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cc6328dca5bb47f41668f42efd91c7abb6e06341
4
+ data.tar.gz: 5b7b5fe48b5dfe02027fa1c551efc87dbd64f22c
5
+ SHA512:
6
+ metadata.gz: 1a4396d63eb025733666f3483507acad0b05f233f9ffff28066029fe180f5ea98827daf210b0c3379a0f999346837bfb0c5bb284e37eb32761f2aea3affe1751
7
+ data.tar.gz: 25a87f74a73c7297949a8230be239c810ca71edcdf9fe1c73989d9d410abe936ddd03982ca5f24e11c4a6310d4ca197538fabcbe1f46baabe0d8a7fb23da5e46
@@ -0,0 +1,58 @@
1
+ module Przelewy24
2
+ module Recurring
3
+ class Client
4
+ def initialize(login, password, mode = :sandbox)
5
+ @login = login
6
+ @password = password
7
+
8
+ if mode == :production
9
+ @wsdl = 'https://secure.przelewy24.pl/external/wsdl/charge_card_service.php?wsdl'
10
+ elsif mode == :sandbox
11
+ @wsdl = 'https://sandbox2.przelewy24.pl/external/wsdl/charge_card_service.php?wsdl'
12
+ else
13
+ raise InvalidGatewayUrl
14
+ end
15
+ end
16
+
17
+ def test_access
18
+ response = client.call(:test_access, message: {
19
+ login: @login,
20
+ pass: @password
21
+ })
22
+
23
+ response[:test_access_response][:return]
24
+ end
25
+
26
+ def get_transaction_reference(order_id)
27
+ response = client.call(:get_transaction_reference, message: {
28
+ login: @login,
29
+ pass: @password,
30
+ orderId: order_id
31
+ })
32
+
33
+ Response.new(response.body[:get_transaction_reference_response][:return])
34
+ end
35
+
36
+ def charge_card(data = {})
37
+ response = client.call(:charge_card, message: {
38
+ login: @login,
39
+ pass: @password,
40
+ refId: data[:ref_id],
41
+ amount: data[:amount],
42
+ currency: data[:currency],
43
+ sessionId: data[:session_id],
44
+ client: data[:client],
45
+ description: data[:description]
46
+ })
47
+
48
+ Response.new(response.body[:charge_card_response][:return])
49
+ end
50
+
51
+ private
52
+
53
+ def client
54
+ @client ||= Savon::Client.new(wsdl: @wsdl)
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,22 @@
1
+ module Przelewy24
2
+ module Recurring
3
+ class Response
4
+ def initialize(savon_response)
5
+ @result = savon_response[:result]
6
+ @error = savon_response[:error]
7
+ end
8
+
9
+ def success?
10
+ @error[:error_code] == '0'
11
+ end
12
+
13
+ def result
14
+ @result
15
+ end
16
+
17
+ def error
18
+ @error
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Przelewy24
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  end
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: przelewy24
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
5
- prerelease:
4
+ version: 0.1.9
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michał Młoźniak
9
8
  autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2015-06-16 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.8'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.8'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '10.0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '10.0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: savon
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: '2.0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: '2.0'
62
55
  description: Integration with Przelewy24 payment gateway.
@@ -66,9 +59,9 @@ executables: []
66
59
  extensions: []
67
60
  extra_rdoc_files: []
68
61
  files:
69
- - .gitignore
70
- - .rspec
71
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - ".travis.yml"
72
65
  - CODE_OF_CONDUCT.md
73
66
  - Gemfile
74
67
  - LICENSE.txt
@@ -82,6 +75,8 @@ files:
82
75
  - lib/przelewy24/ekspres/response.rb
83
76
  - lib/przelewy24/invalid_attributes.rb
84
77
  - lib/przelewy24/invalid_gateway_url.rb
78
+ - lib/przelewy24/recurring/client.rb
79
+ - lib/przelewy24/recurring/response.rb
85
80
  - lib/przelewy24/response.rb
86
81
  - lib/przelewy24/transaction.rb
87
82
  - lib/przelewy24/version.rb
@@ -89,26 +84,25 @@ files:
89
84
  homepage: https://github.com/visualitypl/przelewy24
90
85
  licenses:
91
86
  - MIT
87
+ metadata: {}
92
88
  post_install_message:
93
89
  rdoc_options: []
94
90
  require_paths:
95
91
  - lib
96
92
  required_ruby_version: !ruby/object:Gem::Requirement
97
- none: false
98
93
  requirements:
99
- - - ! '>='
94
+ - - ">="
100
95
  - !ruby/object:Gem::Version
101
96
  version: '0'
102
97
  required_rubygems_version: !ruby/object:Gem::Requirement
103
- none: false
104
98
  requirements:
105
- - - ! '>='
99
+ - - ">="
106
100
  - !ruby/object:Gem::Version
107
101
  version: '0'
108
102
  requirements: []
109
103
  rubyforge_project:
110
- rubygems_version: 1.8.23
104
+ rubygems_version: 2.2.2
111
105
  signing_key:
112
- specification_version: 3
106
+ specification_version: 4
113
107
  summary: Integration with Przelewy24 payment gateway.
114
108
  test_files: []