gp_webpay 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -4
- data/lib/gp_webpay/config.rb +2 -0
- data/lib/gp_webpay/payment.rb +1 -1
- data/lib/gp_webpay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66f08654173a78510ff2a06bd98a034b49ec4c83
|
4
|
+
data.tar.gz: 0b88f8af914d24caf3109774aa87b8f017c62b80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 329179521d2a27b1afbc761e31f40d6f8ccc96cb5b00957b775709d2f98f38a946ef64f42bd4ec6f7565c89a11903d53d629bc6f16d65e7d9692f99e0ec7d41d
|
7
|
+
data.tar.gz: 3b6b3af161ea17838901475e57a4708bede0da2c18abbc0b753afc40b6707373a3f8b57d93790eb817b44d9616bacc15137235cc162ff2245a628eeb21407680
|
data/README.md
CHANGED
@@ -26,9 +26,9 @@ config/initializers/gp_webpay.rb
|
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
GpWebpay.configure do |config|
|
29
|
-
config.merchant_number
|
30
|
-
config.
|
31
|
-
config.
|
29
|
+
config.merchant_number = ##########
|
30
|
+
config.merchant_pem_path = 'my_cert.pem'
|
31
|
+
config.merchant_password = 'password'
|
32
32
|
end
|
33
33
|
```
|
34
34
|
|
@@ -58,7 +58,18 @@ class OrdersController
|
|
58
58
|
def create
|
59
59
|
...
|
60
60
|
payment = Payment.create
|
61
|
-
redirect_to payment.pay_url(redirect_url: 'http://
|
61
|
+
redirect_to payment.pay_url(redirect_url: 'http://example.com/orders/callback')
|
62
|
+
end
|
63
|
+
|
64
|
+
def callback
|
65
|
+
...
|
66
|
+
payment = Payment.find(params['ORDERNUMBER'])
|
67
|
+
if payment.success?(params)
|
68
|
+
# Payment success
|
69
|
+
else
|
70
|
+
# Payment failed
|
71
|
+
# params['PRCODE'], params['SRCODE']
|
72
|
+
end
|
62
73
|
end
|
63
74
|
end
|
64
75
|
```
|
data/lib/gp_webpay/config.rb
CHANGED
@@ -18,6 +18,7 @@ module GpWebpay
|
|
18
18
|
class Configuration #:nodoc:
|
19
19
|
include ActiveSupport::Configurable
|
20
20
|
config_accessor :merchant_number
|
21
|
+
config_accessor :merchant_pem
|
21
22
|
config_accessor :merchant_pem_path
|
22
23
|
config_accessor :merchant_password
|
23
24
|
config_accessor :gpe_pem_path
|
@@ -54,6 +55,7 @@ module GpWebpay
|
|
54
55
|
# this is ugly. why can't we pass the default value to config_accessor...?
|
55
56
|
configure do |config|
|
56
57
|
config.merchant_number = nil
|
58
|
+
config.merchant_pem = nil
|
57
59
|
config.merchant_pem_path = nil
|
58
60
|
config.merchant_password = nil
|
59
61
|
config.environment = defined?(Rails) && Rails.env || 'test'
|
data/lib/gp_webpay/payment.rb
CHANGED
data/lib/gp_webpay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gp_webpay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Magnusek
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|