qatingg 1.0.1
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/lib/qatingg.rb +51 -0
- metadata +57 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9f6973d7d8148d5dbecca1930fd00c003707618237c5b5674cd27172e815ecc2
|
4
|
+
data.tar.gz: 0d3072ab9e5aff1fca1471a110542b2b8be7cf62094804efe38b56cb388df298
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5f7c071d55d86500bdfff09c71460292e86fc24077d031e27148b563d5397e31b3ecd73f4915c9c03db5f339c407eb7bbd16a9034c7052d5150df306fef9ec9f
|
7
|
+
data.tar.gz: c915fb82c6c3ddde7014a0cdc998da16471928e4b00173a4638d123d904d6049d75468a7d45a5afc0fb76120b936e5f9154731cc554211cc14d28b354361a063
|
data/lib/qatingg.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# @!scope
|
2
|
+
require 'rubygems'
|
3
|
+
require 'tingg_encryption'
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
module TinggAdapter
|
7
|
+
# @!scope
|
8
|
+
class Encryption
|
9
|
+
def initialize(iv_key, secret_key, **args)
|
10
|
+
@iv_key = iv_key
|
11
|
+
@secret_key = secret_key
|
12
|
+
@domain = args[:domain]
|
13
|
+
@access_key = args[:access_key]
|
14
|
+
@url = args[:url]
|
15
|
+
@path = args[:path]
|
16
|
+
end
|
17
|
+
|
18
|
+
def encryption(**args)
|
19
|
+
@checkout_type = args[:checkout_type]
|
20
|
+
|
21
|
+
payload = { merchantTransactionID: args[:transaction_id],
|
22
|
+
accountNumber: args[:account_number],
|
23
|
+
customerFirstName: args[:customer_first_name],
|
24
|
+
customerLastName: args[:customer_last_name],
|
25
|
+
MSISDN: args[:msisdn],
|
26
|
+
customerEmail: args[:customer_email],
|
27
|
+
requestAmount: args[:amount],
|
28
|
+
currencyCode: args[:currency_code],
|
29
|
+
serviceCode: args[:service_code],
|
30
|
+
dueDate: args[:due_date],
|
31
|
+
requestDescription: args[:description],
|
32
|
+
countryCode: args[:country_code],
|
33
|
+
paymentWebhookUrl: args[:callback_url],
|
34
|
+
payerClientCode: args[:payer_client_code],
|
35
|
+
languageCode: args[:language_code],
|
36
|
+
successRedirectUrl: '',
|
37
|
+
failRedirectUrl: '' }
|
38
|
+
|
39
|
+
cypher = TinggEncryption::Encryption.new(@iv_key, @secret_key)
|
40
|
+
encrypted_params = cypher.encryption(payload.to_s)
|
41
|
+
@url + @path + @checkout_type +
|
42
|
+
"?params=#{encrypted_params}" \
|
43
|
+
"&accessKey=#{@access_key}"
|
44
|
+
# puts checkout_page.to_s
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
|
metadata
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: qatingg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- "@Samson Mwangi"
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-01-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tingg_encryption
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: The best encryption class
|
28
|
+
email: samson.mwangi@cellulant.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- lib/qatingg.rb
|
34
|
+
homepage: https://tingg.com
|
35
|
+
licenses:
|
36
|
+
- MIT
|
37
|
+
metadata: {}
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
requirements: []
|
53
|
+
rubygems_version: 3.0.6
|
54
|
+
signing_key:
|
55
|
+
specification_version: 4
|
56
|
+
summary: Welcome to Tingg
|
57
|
+
test_files: []
|