testgem_eghl 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/testgem_eghl.rb +46 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e73872eabd3d6a9e909b7b6cfa90da83824cceb
4
- data.tar.gz: 9b8685a1c608e7e8208259d50afa3cbcf5d35c51
3
+ metadata.gz: 972ad6a34f64cff4383153bb58b5f5e6a36c733b
4
+ data.tar.gz: b1e578608f4eec01ccac1245bdee8fde4d37c766
5
5
  SHA512:
6
- metadata.gz: 1c00e2a731729d291cb748e498b795f03de25b78746be84c25cd6fd514424af03063f2cae0afb3ee049f51bb0375bc7f56ae6bbdb7c7fd287791e1cd21b561de
7
- data.tar.gz: 7f7164c4f61866d5f2decaf956d2b3e997f931d8b9ab0813dc0bfda961df5b63d7d2c3ad7e80713fe2f116eda228af7fd160bdfe882e7723e04184feb5ef2d5d
6
+ metadata.gz: f26a2e29bc2be92b804c1ee1c801bd40e137e96239ee04192c491b8b638cfd3c9f220af09d33849821ac4bd7e8504bf9d47fa5c94198368a01c6a752c180d67b
7
+ data.tar.gz: 48b5a3b899c1e684f9ef70bac820df577650e90b28dbe0812bbac3ba9f4ad1d258dd2c47a5316f71bfbedb025695c0f720055ce5b8860d56cadcb449c4a04576
data/lib/testgem_eghl.rb CHANGED
@@ -1,5 +1,49 @@
1
1
  module Testgem_eghl
2
- def self.hi
3
- puts "Hello world!"
2
+
3
+ require 'digest'
4
+
5
+ def self.payment_request
6
+
7
+ @Random = rand(1000..9999999)
8
+
9
+ @Password = "sit12345"
10
+ @ServiceID = "SIT"
11
+ @PaymentID = "RoR" + "SIT" + "-" + (@Random).to_s
12
+ @MerchantReturnURL = "http://arifall.my/eGHL/success_page.php"
13
+ @MerchantApprovalURL = ""
14
+ @MerchantUnApprovalURL = ""
15
+ @MerchantCallBackURL = "http://arifall.my/eGHL/mp_callback.php"
16
+ @Amount = "1.00"
17
+ @CurrencyCode = "MYR"
18
+ @CustIP = "113.210.6.150"
19
+ @PageTimeout = "900"
20
+ @CardNo = ""
21
+ @Token = ""
22
+
23
+ if @CardNo != ""
24
+ @Concat = @Password+@ServiceID+@PaymentID+@MerchantReturnURL+@Amount+@CurrencyCode+@CustIP+@PageTimeout+@CardNo #all mandatory fields + cardno
25
+ end
26
+
27
+ if @Token != ""
28
+ @Concat = @Password+@ServiceID+@PaymentID+@MerchantReturnURL+@Amount+@CurrencyCode+@CustIP+@PageTimeout+@Token #all mandatory fields + token
29
+ end
30
+
31
+ if @MerchantApprovalURL != ""
32
+ @Concat = @Password+@ServiceID+@PaymentID+@MerchantReturnURL+@MerchantApprovalURL+@Amount+@CurrencyCode+@CustIP+@PageTimeout #all mandatory fields + merchantapprovalurl
33
+ end
34
+
35
+ if @MerchantUnApprovalURL != ""
36
+ @Concat = @Password+@ServiceID+@PaymentID+@MerchantReturnURL+@MerchantUnApprovalURL+@Amount+@CurrencyCode+@CustIP+@PageTimeout #all mandatory fields + merchantunapprovalurl
37
+ end
38
+
39
+ if @MerchantCallBackURL != ""
40
+ @Concat = @Password+@ServiceID+@PaymentID+@MerchantReturnURL+@MerchantCallBackURL+@Amount+@CurrencyCode+@CustIP+@PageTimeout #all mandatory fields + merchantcallbackurl
41
+ end
42
+
43
+ @Hashvalue = Digest::SHA256.hexdigest @Concat
44
+
45
+ puts "payment request hash value is : "+@Hashvalue
46
+
4
47
  end
48
+
5
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testgem_eghl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anas Yusuf
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A simple hello world gem
13
+ description: eghl gem for payment request hashing
14
14
  email: anasyusuf1@yahoo.com
15
15
  executables: []
16
16
  extensions: []