kasikornbank 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/kasikornbank/response.rb +3 -0
- data/lib/kasikornbank/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: e9d8c9665a7b2e1714923778958d9e969f9aa3d3
|
4
|
+
data.tar.gz: a491fbc6e3bdb79d76f440bfa6edaddc420b67a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9cb2f53ca6f9c513eae1617f66216548b6f67c40d17adab2020ea3480c33b4637e7e74e53f9be6c221ce6d8e34730626e0c5461e26388e5051fb59614df0ed9
|
7
|
+
data.tar.gz: cfd3cc9c611af14315b7ae61b6821a07305ad390161511b32ef47e8bf98166339975d13a5b738798b48e66f270fd1624a9a6fb45b7dd5a9724c73071960b34e1
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ K-Payment Gateway (Kasikorn Bank Payment Gateway)
|
|
13
13
|
Add this line to your application's Gemfile:
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem 'kasikornbank', '~> 0.1.
|
16
|
+
gem 'kasikornbank', '~> 0.1.4'
|
17
17
|
```
|
18
18
|
|
19
19
|
And then execute:
|
@@ -71,7 +71,7 @@ kbank = Kasikornbank::Render.new({
|
|
71
71
|
`shop_id` = <**Optional**> Shop ID, for payment template, see documentation.
|
72
72
|
`payterm2` = <**Optional**> Number of month for installment.
|
73
73
|
|
74
|
-
> :exclamation: Unfortunately, Kasikorn Bank doesn't have a proper way to handle payment API. In this case `Kasikornbank::Render.new()` will generage auto submit form and return it with `
|
74
|
+
> :exclamation: Unfortunately, Kasikorn Bank doesn't have a proper way to handle payment API. In this case `Kasikornbank::Render.new()` will generage auto submit form and return it with `post` method. This form should be placed in `checkout#create` view file.
|
75
75
|
|
76
76
|
#### Example
|
77
77
|
|
@@ -133,7 +133,7 @@ def kbank_response
|
|
133
133
|
checkout = Checkout.find(kbank[:invoice])
|
134
134
|
end
|
135
135
|
```
|
136
|
-
|
136
|
+
_\# Response will be `{:respcode=>"00", :response=>"success", :invoice=>"21", :amount=>1.0, :auth_code=>"140580"}`_
|
137
137
|
> Controller name, routes, response url can be replaced with name you like.
|
138
138
|
|
139
139
|
## Development
|
@@ -10,17 +10,20 @@ module Kasikornbank
|
|
10
10
|
response = Hash.new
|
11
11
|
if @params[:PMGWRESP2]
|
12
12
|
str = @params[:PMGWRESP2]
|
13
|
+
response[:respcode] = str[97...99]
|
13
14
|
response[:response] = response_code(str[97...99])
|
14
15
|
response[:invoice] = remove_lead_zero(str[32...44])
|
15
16
|
response[:amount] = amount(str[85...97])
|
16
17
|
response[:auth_code] = nil
|
17
18
|
elsif @params[:HOSTRESP]
|
19
|
+
response[:respcode] = @params[:HOSTRESP]
|
18
20
|
response[:response] = response_code(@params[:HOSTRESP])
|
19
21
|
response[:invoice] = remove_lead_zero(@params[:RETURNINV])
|
20
22
|
response[:amount] = amount(@params[:AMOUNT])
|
21
23
|
response[:auth_code] = @params[:AUTHCODE]
|
22
24
|
elsif @params[:PMGWRESP]
|
23
25
|
str = @params[:PMGWRESP]
|
26
|
+
response[:respcode] = str[0...2]
|
24
27
|
response[:response] = response_code(str[0...2])
|
25
28
|
response[:invoice] = remove_lead_zero(str[56...68])
|
26
29
|
response[:amount] = amount(str[82...94])
|
data/lib/kasikornbank/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kasikornbank
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andre Antonov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|