twoctwop 0.1.3
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.
- checksums.yaml +7 -0
- data/.gitignore +54 -0
- data/.rspec +3 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +2 -0
- data/lib/twoctwop/config.rb +36 -0
- data/lib/twoctwop/request.rb +71 -0
- data/lib/twoctwop/response.rb +24 -0
- data/lib/twoctwop/version.rb +3 -0
- data/lib/twoctwop.rb +13 -0
- data/spec/fixtures/built_request_no_token.txt +1 -0
- data/spec/fixtures/built_request_with_card.txt +1 -0
- data/spec/fixtures/certificate/demo2.crt +30 -0
- data/spec/fixtures/certificate/demo2.pem +96 -0
- data/spec/fixtures/response_body.txt +1 -0
- data/spec/lib/twoctwop/request_spec.rb +26 -0
- data/spec/lib/twoctwop/response_spec.rb +17 -0
- data/spec/spec_helper.rb +40 -0
- data/spec/support/data_context.rb +53 -0
- data/twoctwop.gemspec +31 -0
- metadata +188 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f54b3fd1c319d2e64cde3ddf6bc2793130a7f804
|
4
|
+
data.tar.gz: 0648fdbe96d4569f7d3fd7e70691f051f7205af8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6fbc289b9c13311335561f4b0df32abc9984c5433b7673b682642418e0af34e79a75efe6972d99c083b1149f5e9f62c457dd3e9126820c6eb1682a73749d7810
|
7
|
+
data.tar.gz: d2d5311c8de561655f7f961499910d1d3378100af86a160471ce6ab15252c596dfd80b51b16751bf9b9018015dcb7282e6c2bae698260e752919d245f443f1e2
|
data/.gitignore
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
/.config
|
24
|
+
/coverage/
|
25
|
+
/InstalledFiles
|
26
|
+
/pkg/
|
27
|
+
/spec/reports/
|
28
|
+
/test/tmp/
|
29
|
+
/test/version_tmp/
|
30
|
+
/tmp/
|
31
|
+
|
32
|
+
## Specific to RubyMotion:
|
33
|
+
.dat*
|
34
|
+
.repl_history
|
35
|
+
build/
|
36
|
+
.DS_Store
|
37
|
+
## Documentation cache and generated files:
|
38
|
+
/.yardoc/
|
39
|
+
/_yardoc/
|
40
|
+
/doc/
|
41
|
+
/rdoc/
|
42
|
+
|
43
|
+
## Environment normalisation:
|
44
|
+
/.bundle/
|
45
|
+
/lib/bundler/man/
|
46
|
+
|
47
|
+
# for a library or gem, you might want to ignore these files since the code is
|
48
|
+
# intended to run in multiple environments; otherwise, check them in:
|
49
|
+
Gemfile.lock
|
50
|
+
.ruby-version
|
51
|
+
.ruby-gemset
|
52
|
+
|
53
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
54
|
+
.rvmrc
|
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Codemy.net
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Zack Siri
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# 2c2p
|
2
|
+
|
3
|
+
[ ](https://codeship.io/projects/34256)
|
4
|
+
|
5
|
+
2c2p: A ruby wrapper for the 2c2p payment gateway
|
6
|
+
|
7
|
+
This gem supports NON 3DS payment, enabling a seamless customer experience.
|
8
|
+
Feel free to fork, edit, and add to this gem, and please help us open source
|
9
|
+
more projects like this in order to help combat the horrific monster that is
|
10
|
+
digital payments in Thailand. We can do it if we work together!
|
11
|
+
|
12
|
+
### Contributors
|
13
|
+
|
14
|
+
This gem was made possible by:
|
15
|
+
|
16
|
+
+ [MOXY](http://www.moxyst.com)
|
17
|
+
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
Add this line to your application's Gemfile:
|
22
|
+
|
23
|
+
gem 'twoctwop'
|
24
|
+
|
25
|
+
And then execute:
|
26
|
+
|
27
|
+
$ bundle
|
28
|
+
|
29
|
+
Or install it yourself as:
|
30
|
+
|
31
|
+
$ gem install twoctwop
|
32
|
+
|
33
|
+
## Usage
|
34
|
+
|
35
|
+
First we need to create a request object
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
request_hash = {
|
39
|
+
uniqueTransactionCode: 'M0001', # invoice number
|
40
|
+
desc: 'Polo Shirt', # order description
|
41
|
+
amt: '000040000000', # must have 12 digits
|
42
|
+
currencyCode: 764, # 764 for thai baht (based on http://en.wikipedia.org/wiki/ISO_4217)
|
43
|
+
panBank: 'Siam Commercial Bank', # Issuing Bank Name
|
44
|
+
panCountry: 'TH', # Issuing Bank Country
|
45
|
+
cardholderName: 'Zack Siri', # Card holder name
|
46
|
+
encCardData: 'iamencrypteddata' # Encrypted card data from payment form
|
47
|
+
}
|
48
|
+
|
49
|
+
request = Twoctwop::Request.new(data: request_hash)
|
50
|
+
response = request.make_non_3ds_payment! # this will make the request and return a response
|
51
|
+
```
|
52
|
+
|
53
|
+
To Save the card into 2c2p you just need to add the token
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
request = Twoctwop::Request.new(data: request_hash, token: 'blah')
|
57
|
+
```
|
58
|
+
|
59
|
+
This will save the token and you can make payments using tokens instead of the card information. You can generate any token you want from your application as long as you can reference it again when you need to pass it into the `Twoctwop::Request` object.
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
1. Fork it ( https://github.com/[my-github-username]/twoctwop/fork )
|
64
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
65
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
66
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
67
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module Twoctwop
|
2
|
+
# change the config in an initializer like so
|
3
|
+
|
4
|
+
# Twoctwop::Config.merchant_id = '111'
|
5
|
+
# Twoctwop::Config.secret_key = '12345678'
|
6
|
+
|
7
|
+
# Or use the block
|
8
|
+
|
9
|
+
# Twoctwop::Config.configure do |config|
|
10
|
+
# config.merchant_id = '111'
|
11
|
+
# config.secret_key = '12345678'
|
12
|
+
# config.private_key = 'private key goes here'
|
13
|
+
# config.certificate = 'certifiate goes here'
|
14
|
+
# config.passphrase = 'if private key has passphrase'
|
15
|
+
# end
|
16
|
+
|
17
|
+
module Config
|
18
|
+
extend self
|
19
|
+
|
20
|
+
attr_accessor :merchant_id, :secret_key, :private_key, :certificate, :passphrase
|
21
|
+
|
22
|
+
def configure
|
23
|
+
yield self
|
24
|
+
end
|
25
|
+
|
26
|
+
def env
|
27
|
+
@env ||= if defined? Rails
|
28
|
+
Rails.env
|
29
|
+
elsif ENV['RACK_ENV']
|
30
|
+
ENV['RACK_ENV']
|
31
|
+
else
|
32
|
+
'development'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'base64'
|
2
|
+
require 'openssl'
|
3
|
+
require 'rest-client'
|
4
|
+
require 'builder'
|
5
|
+
require 'hashie'
|
6
|
+
|
7
|
+
module Twoctwop
|
8
|
+
class Request
|
9
|
+
|
10
|
+
attr_accessor :data, :env, :digest, :token
|
11
|
+
|
12
|
+
ENDPOINT = {
|
13
|
+
test: 'http://demo2.2c2p.com/2C2PFrontEnd/SecurePayment/Payment.aspx',
|
14
|
+
live: ''
|
15
|
+
}
|
16
|
+
|
17
|
+
def initialize(data: {}, token: nil)
|
18
|
+
raise "Merchant ID is nil" if Twoctwop::Config.merchant_id.nil?
|
19
|
+
raise "Secret key is nil" if Twoctwop::Config.secret_key.nil?
|
20
|
+
|
21
|
+
@token = token
|
22
|
+
@digest = OpenSSL::Digest.new('sha1')
|
23
|
+
|
24
|
+
@data = data
|
25
|
+
@env = Twoctwop::Config.env == 'production' ? :live : :test
|
26
|
+
end
|
27
|
+
|
28
|
+
def endpoint
|
29
|
+
ENDPOINT[env]
|
30
|
+
end
|
31
|
+
|
32
|
+
def payload
|
33
|
+
Base64.strict_encode64(build_request)
|
34
|
+
end
|
35
|
+
|
36
|
+
def make_non_3ds_payment!
|
37
|
+
body = RestClient.post endpoint, :paymentRequest => payload
|
38
|
+
Response.new(body).decrypt_body
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def build_request
|
44
|
+
final_hash = build_final_hash
|
45
|
+
|
46
|
+
Builder::XmlMarkup.new.PaymentRequest do |p|
|
47
|
+
final_hash.keys.each do |k|
|
48
|
+
p.tag!(k, final_hash[k])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def build_final_hash
|
54
|
+
data.merge({
|
55
|
+
version: '8.0',
|
56
|
+
merchantID: Twoctwop::Config.merchant_id,
|
57
|
+
hashValue: calculate_hash_data_digest,
|
58
|
+
}).merge(store_card_token)
|
59
|
+
end
|
60
|
+
|
61
|
+
def store_card_token
|
62
|
+
token ? { storeCard: 'Y', storeCardUniqueID: token } : {}
|
63
|
+
end
|
64
|
+
|
65
|
+
def calculate_hash_data_digest
|
66
|
+
hash_data = [Twoctwop::Config.merchant_id, data[:uniqueTransactionCode], data[:amt]].join
|
67
|
+
OpenSSL::HMAC.hexdigest(digest, Twoctwop::Config.secret_key, hash_data)
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
require 'active_support/core_ext'
|
3
|
+
|
4
|
+
module Twoctwop
|
5
|
+
|
6
|
+
class Response
|
7
|
+
|
8
|
+
attr_accessor :certificate, :private_key, :body
|
9
|
+
|
10
|
+
def initialize(body)
|
11
|
+
raise "No private key defined" if Twoctwop::Config.private_key.nil?
|
12
|
+
raise "No certificate defined" if Twoctwop::Config.certificate.nil?
|
13
|
+
|
14
|
+
@certificate = OpenSSL::X509::Certificate.new(Twoctwop::Config.certificate)
|
15
|
+
@private_key = OpenSSL::PKey::RSA.new(Twoctwop::Config.private_key, Twoctwop::Config.passphrase)
|
16
|
+
|
17
|
+
@body = OpenSSL::PKCS7.new(Base64.strict_decode64(body))
|
18
|
+
end
|
19
|
+
|
20
|
+
def decrypt_body
|
21
|
+
Hashie::Mash.new(Hash.from_xml(body.decrypt(private_key, certificate))['PaymentResponse'])
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/twoctwop.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<PaymentRequest><uniqueTransactionCode>M1000</uniqueTransactionCode><desc>Polo Shirt</desc><amt>000000040000</amt><currencyCode>702</currencyCode><panBank>Siam Commercial Bank</panBank><panCountry>SG</panCountry><cardHolderName>John Doe</cardHolderName><encCardData>00acjp+7erduPfJ6Wvrhp0L27fXGaue2/MPK/MUZtjnXRzrfCUpvG1c6ALQkogrYhqYVUDs5TGPoadv4nRwb2k5I/N/euS0srxJA0ikI9oC4xlM0NdLzdERgOzJrcsVR+QpVljjH7/lZ+PIMxwVR0X1vw3HRFxDuMiRARS3bxmmug8k=U2FsdGVkX1+HhQz45KZR33KzurxLl7VfYLofayanY+BfnBJJcgOHhK0rjNXqw5Se</encCardData><version>8.0</version><merchantID>JT01</merchantID><hashValue>12c6523edaf49ae7d3189f98fc88709acc0bc173</hashValue></PaymentRequest>
|
@@ -0,0 +1 @@
|
|
1
|
+
<PaymentRequest><uniqueTransactionCode>M1000</uniqueTransactionCode><desc>Polo Shirt</desc><amt>000000040000</amt><currencyCode>702</currencyCode><panBank>Siam Commercial Bank</panBank><panCountry>SG</panCountry><cardHolderName>John Doe</cardHolderName><encCardData>00acjp+7erduPfJ6Wvrhp0L27fXGaue2/MPK/MUZtjnXRzrfCUpvG1c6ALQkogrYhqYVUDs5TGPoadv4nRwb2k5I/N/euS0srxJA0ikI9oC4xlM0NdLzdERgOzJrcsVR+QpVljjH7/lZ+PIMxwVR0X1vw3HRFxDuMiRARS3bxmmug8k=U2FsdGVkX1+HhQz45KZR33KzurxLl7VfYLofayanY+BfnBJJcgOHhK0rjNXqw5Se</encCardData><version>8.0</version><merchantID>JT01</merchantID><hashValue>12c6523edaf49ae7d3189f98fc88709acc0bc173</hashValue><storeCard>Y</storeCard><storeCardUniqueID>blah</storeCardUniqueID></PaymentRequest>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIFJzCCBA+gAwIBAgIKHoPmwQAAAAAADDANBgkqhkiG9w0BAQUFADAWMRQwEgYD
|
3
|
+
VQQDEwtTaW5hcHRJUSBDQTAeFw0xMTA4MTkwMzA2MDFaFw0xNjA4MTkwMzE2MDFa
|
4
|
+
MHgxCzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlTaW5nYXBvcmUxEjAQBgNVBAcTCVNp
|
5
|
+
bmdhcG9yZTEWMBQGA1UEChMNMkM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wgbIGCCsGAQUFBwEBBIGlMIGiME8GCCsGAQUFBzAChkNodHRwOi8vdzJrM3N0
|
21
|
+
dzEwMzNvMTFnL0NlcnRFbnJvbGwvVzJLM1NUVzEwMzNPMTFHX1NpbmFwdElRJTIw
|
22
|
+
Q0EuY3J0ME8GCCsGAQUFBzAChkNmaWxlOi8vXFxXMkszU1RXMTAzM08xMUdcQ2Vy
|
23
|
+
dEVucm9sbFxXMkszU1RXMTAzM08xMUdfU2luYXB0SVEgQ0EuY3J0MA0GCSqGSIb3
|
24
|
+
DQEBBQUAA4IBAQAKrBRCdb/6eGrw5iK+VJ+YDTS1X+6p3ios0lTHO0OnHoSLa3q6
|
25
|
+
mSSCdGMIQQiizBkFXU+NgqpGPs8Ef3OUA3Y4NfH9q7f3jiAt/Us+KCTkmVnnHCA7
|
26
|
+
z+/Teo3irXFgY32RgDe8AwbENPZkkQpG99YuzntIScX9nReJU5k4oGBwV+RJReb3
|
27
|
+
lk0NCLRX9NIg5oDYrhrnoqnOVguGRulVv8/l3zcE1G+FHrA9suixvAs+KDgyTIaS
|
28
|
+
AwkGxB7OQomWYE/YQMbQSgzwoJ9axbclJOLvzSoigEdMy/kApMGu2KuPVYxfD9qz
|
29
|
+
ZcwraxkBhlV1WYGe0lK7QwwCRddSyLVRmx/r
|
30
|
+
-----END CERTIFICATE-----
|
@@ -0,0 +1,96 @@
|
|
1
|
+
Bag Attributes
|
2
|
+
Microsoft Local Key set: <No Values>
|
3
|
+
localKeyID: 01 00 00 00
|
4
|
+
friendlyName: le-cc4a0822-a18f-4444-97cc-ed5396ab5ade
|
5
|
+
Microsoft CSP Name: Microsoft RSA SChannel Cryptographic Provider
|
6
|
+
Key Attributes
|
7
|
+
X509v3 Key Usage: 10
|
8
|
+
-----BEGIN RSA PRIVATE KEY-----
|
9
|
+
Proc-Type: 4,ENCRYPTED
|
10
|
+
DEK-Info: DES-EDE3-CBC,3A2DD8162BC67378
|
11
|
+
|
12
|
+
7LhwgYP6nwfsiehFR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
|
27
|
+
kp382GUGStNu1nC0dWuzD4H0bAsi8dqvRRMfh/EPEnfouBGypm9v0tnCwsFtfBim
|
28
|
+
6s0oMyX0pqg1k9PkuOexXPcvqy0fxYcRy4oqVDSd/y3R3z02TnZQHnZimIabOPFY
|
29
|
+
tjoG4IegGAZPZ9pT12nTMyoQGfvydScbs6yrsrMXf51ywzBwxmIX40TznIx5HRRk
|
30
|
+
mZmCkXGB2IlHCmaQijMAzoszToFF1w1HIwC+ZJ2EtHgNbv9Z62EQyywGG0zK19u4
|
31
|
+
4+9TiyTUuvJLxsxjCuzdY82rX53x+kwvK1Fyat5iZgFM8oSP2h9X01v4YeedaPrw
|
32
|
+
lWj4zcz8U2dpE9DNSfjukLpGMu1EAVX/spVEAMK41Ydm+XvC7A4F8lvvT3U1RDZe
|
33
|
+
HPPRf+1ZlMsY+h3VrK3NsIjyrxJV3rPGydnNr+U4ZmPP9uf2Jse5DbZQU49JQ2s8
|
34
|
+
U3MREO51GlLhMpvNQCNJvUEAXQBo4WFTGGdZisP6MoCyEP8gbFIp/f4E2G4OVYoE
|
35
|
+
vhb1x51vE6YSph/TmI/X0q755iJzH06uwSiPbE17+90NAvXhphzltJL2x4LQHmcn
|
36
|
+
dG2HP0n/xIDmsee2hN60a72QHsPwQqImdVJFn9ITILXlgZMGVDW2LQ==
|
37
|
+
-----END RSA PRIVATE KEY-----
|
38
|
+
Bag Attributes
|
39
|
+
localKeyID: 01 00 00 00
|
40
|
+
friendlyName: demo2.2c2p.com
|
41
|
+
subject=/C=SG/ST=Singapore/L=Singapore/O=2C2P Pte Ltd./OU=2C2P IT/CN=demo2.2c2p.com
|
42
|
+
issuer=/CN=SinaptIQ CA
|
43
|
+
-----BEGIN CERTIFICATE-----
|
44
|
+
MIIFJzCCBA+gAwIBAgIKHoPmwQAAAAAADDANBgkqhkiG9w0BAQUFADAWMRQwEgYD
|
45
|
+
VQQDEwtTaW5hcHRJUSBDQTAeFw0xMTA4MTkwMzA2MDFaFw0xNjA4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3Jk8SyK5W/xgi6ornmgbN2h/ckLa77dNOyyILQR84RqJAovfppu3sHgPImhjnIG01oA8binTNy5aSsnqR5MQEV2KerxFqDCkMlWi4dnH8MbiWpN1I/I9xsvHCiNxyMEwt2g9OqzvKpPxOB48uzYAHToB9klXuf3QvZc0l22bhrKkXvpjsE08zTr4mwaZsefd0Jq43lHuCkSEwdrif0deBNqHfeL82CVG7oQAzhPpnTey/pCZcjyFJDkw2sUl65lW2iZKS1FWWP3Ye1lwz4SU6bx2S09PSXnJxiXETX2yMb8gnPm5jc1hin5e2dqDbZeX74oRTk3U427RAh8XjsKhc7NkEK2MpKDclXdlcCBl9wNEOzxua3PI5TTzbfxQA08YKaGc+xbBXn3tBLtJCCCyIhjn1fjKMWVREuUOwpjfXNdPb63iNtQ1ByoeLu5SUc8y3tc1kFGCyC1Tws3k4fcZGWvXkV2d7miRs2d5SywWQgoPVJml78KCZBTCFfxaNZaqzhLFq+yOUELNQfRPvHUbHVoGf4cebXHyJiPArdMpbTcTtdHQ==
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Twoctwop
|
4
|
+
describe Request do
|
5
|
+
include_context "data"
|
6
|
+
|
7
|
+
let(:built_request_no_token) { File.read(File.join(Twoctwop.root, 'spec', 'fixtures', 'built_request_no_token.txt')) }
|
8
|
+
let(:built_request_with_card) { File.read(File.join(Twoctwop.root, 'spec', 'fixtures', 'built_request_with_card.txt')) }
|
9
|
+
|
10
|
+
describe "#build_request" do
|
11
|
+
let(:request) { Twoctwop::Request.new(data: data) }
|
12
|
+
|
13
|
+
it "should merge data hash with essential data" do
|
14
|
+
expect(request.send(:build_request)).to eq built_request_no_token
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#build_request with token" do
|
19
|
+
let(:request) { Twoctwop::Request.new(data: data, token: 'blah') }
|
20
|
+
|
21
|
+
it "should merge data with token" do
|
22
|
+
expect(request.send(:build_request)).to eq built_request_with_card
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'pry'
|
3
|
+
|
4
|
+
module Twoctwop
|
5
|
+
describe Response do
|
6
|
+
include_context "data"
|
7
|
+
|
8
|
+
let(:response_body) { File.read(File.join(Twoctwop.root, 'spec', 'fixtures', 'response_body.txt')) }
|
9
|
+
|
10
|
+
describe "#decrypt_body" do
|
11
|
+
it "should decrypt the body into xml" do
|
12
|
+
response = Twoctwop::Response.new(response_body)
|
13
|
+
expect(response.decrypt_body).to eq Hashie::Mash.new(response_data)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
Bundler.setup
|
3
|
+
|
4
|
+
require 'twoctwop'
|
5
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
6
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
7
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
8
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
9
|
+
#
|
10
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
11
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
12
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
13
|
+
# individual file that may not need all of that loaded. Instead, make a
|
14
|
+
# separate helper file that requires this one and then use it only in the specs
|
15
|
+
# that actually need it.
|
16
|
+
#
|
17
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
18
|
+
# users commonly want.
|
19
|
+
#
|
20
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
21
|
+
|
22
|
+
Dir[File.join(Twoctwop.root, "spec/support/**/*.rb")].each { |f| require f }
|
23
|
+
|
24
|
+
|
25
|
+
RSpec.configure do |config|
|
26
|
+
config.add_setting :certificate_path
|
27
|
+
|
28
|
+
config.certificate_path = File.expand_path(Twoctwop.root + '/spec/fixtures/certificate')
|
29
|
+
|
30
|
+
|
31
|
+
config.before(:all) do
|
32
|
+
Twoctwop::Config.configure do |c|
|
33
|
+
c.merchant_id = 'JT01'
|
34
|
+
c.secret_key = '7jYcp4FxFdf0'
|
35
|
+
c.private_key = File.read(File.join(config.certificate_path, 'demo2.pem'))
|
36
|
+
c.certificate = File.read(File.join(config.certificate_path, 'demo2.crt'))
|
37
|
+
c.passphrase = '2c2p'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
shared_context "data" do
|
2
|
+
let(:data) do
|
3
|
+
{
|
4
|
+
uniqueTransactionCode: "M1000",
|
5
|
+
desc: "Polo Shirt",
|
6
|
+
amt: "000000040000",
|
7
|
+
currencyCode: 702,
|
8
|
+
panBank: "Siam Commercial Bank",
|
9
|
+
panCountry: "SG",
|
10
|
+
cardHolderName: "John Doe",
|
11
|
+
encCardData: "00acjp+7erduPfJ6Wvrhp0L27fXGaue2/MPK/MUZtjnXRzrfCUpvG1c6ALQkogrYhqYVUDs5TGPoadv4nRwb2k5I/N/euS0srxJA0ikI9oC4xlM0NdLzdERgOzJrcsVR+QpVljjH7/lZ+PIMxwVR0X1vw3HRFxDuMiRARS3bxmmug8k=U2FsdGVkX1+HhQz45KZR33KzurxLl7VfYLofayanY+BfnBJJcgOHhK0rjNXqw5Se"
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
let(:token_data) do
|
16
|
+
{
|
17
|
+
uniqueTransactionCode: "M1000",
|
18
|
+
desc: "Polo Shirt",
|
19
|
+
amt: "000000040000",
|
20
|
+
currencyCode: 702,
|
21
|
+
panBank: "Siam Commercial Bank",
|
22
|
+
panCountry: "SG",
|
23
|
+
cardHolderName: "John Doe",
|
24
|
+
encCardData: "00acjp+7erduPfJ6Wvrhp0L27fXGaue2/MPK/MUZtjnXRzrfCUpvG1c6ALQkogrYhqYVUDs5TGPoadv4nRwb2k5I/N/euS0srxJA0ikI9oC4xlM0NdLzdERgOzJrcsVR+QpVljjH7/lZ+PIMxwVR0X1vw3HRFxDuMiRARS3bxmmug8k=U2FsdGVkX1+HhQz45KZR33KzurxLl7VfYLofayanY+BfnBJJcgOHhK0rjNXqw5Se",
|
25
|
+
storeCardUniqueID: "blah" # card token goes here
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
let(:response_data) do
|
30
|
+
{
|
31
|
+
amt: "000000040000",
|
32
|
+
approvalCode: "747505",
|
33
|
+
dateTime: "060914155526",
|
34
|
+
eci: "07",
|
35
|
+
failReason: "Approved",
|
36
|
+
hashValue: "12C6523EDAF49AE7D3189F98FC88709ACC0BC173",
|
37
|
+
merchantID: "JT01",
|
38
|
+
pan: "411111XXXXXX1111",
|
39
|
+
refNumber: "0906110000041",
|
40
|
+
respCode: "00",
|
41
|
+
status: "A",
|
42
|
+
timeStamp: "060914155630",
|
43
|
+
tranRef: "M1000",
|
44
|
+
uniqueTransactionCode: "M1000",
|
45
|
+
userDefined1: nil,
|
46
|
+
userDefined2: nil,
|
47
|
+
userDefined3: nil,
|
48
|
+
userDefined4: nil,
|
49
|
+
userDefined5: nil,
|
50
|
+
version: "8.0"
|
51
|
+
}
|
52
|
+
end
|
53
|
+
end
|
data/twoctwop.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'twoctwop/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "twoctwop"
|
8
|
+
spec.version = Twoctwop::VERSION
|
9
|
+
spec.authors = ["Zack Siri"]
|
10
|
+
spec.email = ["zack@codemy.net"]
|
11
|
+
spec.summary = %q{Ruby wrapper for 2c2p}
|
12
|
+
spec.description = %q{This gem allows you to interface with 2c2p payment gateway}
|
13
|
+
spec.homepage = "http://www.ilovemoxy.com"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
|
22
|
+
spec.add_dependency "rest-client", "~> 1.7"
|
23
|
+
spec.add_dependency "hashie", "~> 3.3"
|
24
|
+
spec.add_dependency "builder", "~> 3.2"
|
25
|
+
spec.add_dependency "activesupport", "~> 4.1"
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.3"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: twoctwop
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Zack Siri
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: hashie
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: builder
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.1'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.6'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.6'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.3'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.10'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.10'
|
125
|
+
description: This gem allows you to interface with 2c2p payment gateway
|
126
|
+
email:
|
127
|
+
- zack@codemy.net
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- ".rspec"
|
134
|
+
- Gemfile
|
135
|
+
- LICENSE
|
136
|
+
- LICENSE.txt
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- lib/twoctwop.rb
|
140
|
+
- lib/twoctwop/config.rb
|
141
|
+
- lib/twoctwop/request.rb
|
142
|
+
- lib/twoctwop/response.rb
|
143
|
+
- lib/twoctwop/version.rb
|
144
|
+
- spec/fixtures/built_request_no_token.txt
|
145
|
+
- spec/fixtures/built_request_with_card.txt
|
146
|
+
- spec/fixtures/certificate/demo2.crt
|
147
|
+
- spec/fixtures/certificate/demo2.pem
|
148
|
+
- spec/fixtures/response_body.txt
|
149
|
+
- spec/lib/twoctwop/request_spec.rb
|
150
|
+
- spec/lib/twoctwop/response_spec.rb
|
151
|
+
- spec/spec_helper.rb
|
152
|
+
- spec/support/data_context.rb
|
153
|
+
- twoctwop.gemspec
|
154
|
+
homepage: http://www.ilovemoxy.com
|
155
|
+
licenses:
|
156
|
+
- MIT
|
157
|
+
metadata: {}
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options: []
|
160
|
+
require_paths:
|
161
|
+
- lib
|
162
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
requirements: []
|
173
|
+
rubyforge_project:
|
174
|
+
rubygems_version: 2.2.2
|
175
|
+
signing_key:
|
176
|
+
specification_version: 4
|
177
|
+
summary: Ruby wrapper for 2c2p
|
178
|
+
test_files:
|
179
|
+
- spec/fixtures/built_request_no_token.txt
|
180
|
+
- spec/fixtures/built_request_with_card.txt
|
181
|
+
- spec/fixtures/certificate/demo2.crt
|
182
|
+
- spec/fixtures/certificate/demo2.pem
|
183
|
+
- spec/fixtures/response_body.txt
|
184
|
+
- spec/lib/twoctwop/request_spec.rb
|
185
|
+
- spec/lib/twoctwop/response_spec.rb
|
186
|
+
- spec/spec_helper.rb
|
187
|
+
- spec/support/data_context.rb
|
188
|
+
has_rdoc:
|