paytm-merchant 0.1.2 → 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 +4 -4
- data/README.md +1 -1
- data/lib/{paytm/merchant/generators → generators}/paytm_setup_generator.rb +1 -1
- data/lib/paytm/merchant.rb +15 -29
- data/lib/paytm/merchant/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: a5dc04189ff55f3ba21011dc3fcad44333aaf5c6
|
|
4
|
+
data.tar.gz: f57806c3333d525337f773e6a2906fd21bc0fd0c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c8a6de3b585236a17cfe6e0dc9fca5d029d439c799dbaf3d2828429c69643d547fcfc309bc91713bc57cec13d412582f23bba1893e3ec63d5d4217d38396005
|
|
7
|
+
data.tar.gz: 3cd259c6e206fc7d100486559cd304d60d8b9c9528cdfcc855624251f1dad9aba53aa8b2daa1ea687d8ff5f987e819445f4e791db8fedcdec00d09badfe2ff54
|
data/README.md
CHANGED
|
@@ -24,7 +24,7 @@ To setup, first initialize the library with credentials.
|
|
|
24
24
|
|
|
25
25
|
```ruby
|
|
26
26
|
Paytm.config do |paytm|
|
|
27
|
-
# paytm.
|
|
27
|
+
# paytm.api_base_uri = 'Some Base URI' # Default is staging api URI fpr paytm
|
|
28
28
|
paytm.merchant_guid = 'Paytm Merchant Guid'
|
|
29
29
|
paytm.aes_key = 'Paytm AES Key'
|
|
30
30
|
paytm.sales_wallet_id = 'Paytm Sales Wallet Id'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
InitializerContent = "# Paytm initializer to setup with configurations
|
|
2
2
|
Paytm.config do |paytm|
|
|
3
|
-
# paytm.
|
|
3
|
+
# paytm.api_base_uri = 'Some Base URI' # Default is staging api URI fpr paytm
|
|
4
4
|
paytm.merchant_guid = 'Paytm Merchant Guid'
|
|
5
5
|
paytm.aes_key = 'Paytm AES Key'
|
|
6
6
|
paytm.sales_wallet_id = 'Paytm Sales Wallet Id'
|
data/lib/paytm/merchant.rb
CHANGED
|
@@ -4,15 +4,12 @@ require 'httparty'
|
|
|
4
4
|
|
|
5
5
|
module PayTM
|
|
6
6
|
module Merchant
|
|
7
|
-
include EncryptionNewPG
|
|
8
|
-
include HTTParty
|
|
9
|
-
extend EncryptionNewPG
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
def self.included(base)
|
|
9
|
+
base.send :include, HTTParty
|
|
10
|
+
base.extend EncryptionNewPG
|
|
11
|
+
base.extend ClassMethods
|
|
12
|
+
end
|
|
16
13
|
|
|
17
14
|
# Constants
|
|
18
15
|
Staging_Base_Uri = 'http://trust-uat.paytm.in'
|
|
@@ -25,20 +22,9 @@ module PayTM
|
|
|
25
22
|
attr_accessor :amount, :recipient, :phone, :email, :metadata
|
|
26
23
|
|
|
27
24
|
# Class Methods
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@@base_uri = value
|
|
32
|
-
end
|
|
33
|
-
def merchant_guid=(value)
|
|
34
|
-
@@merchant_guid = value
|
|
35
|
-
end
|
|
36
|
-
def aes_key=(value)
|
|
37
|
-
@@aes_key = value
|
|
38
|
-
end
|
|
39
|
-
def sales_wallet_id=(value)
|
|
40
|
-
@@sales_wallet_id = value
|
|
41
|
-
end
|
|
25
|
+
module ClassMethods
|
|
26
|
+
# Class attr_accessors
|
|
27
|
+
attr_accessor :api_base_uri, :merchant_guid, :aes_key, :sales_wallet_id
|
|
42
28
|
|
|
43
29
|
def config(&block)
|
|
44
30
|
instance_eval(&block)
|
|
@@ -47,7 +33,7 @@ module PayTM
|
|
|
47
33
|
|
|
48
34
|
# Base URI for HTTParty requests
|
|
49
35
|
def set_httparty_base_uri
|
|
50
|
-
base_uri(
|
|
36
|
+
base_uri(api_base_uri || PayTM::Merchant::Staging_Base_Uri)
|
|
51
37
|
end
|
|
52
38
|
|
|
53
39
|
def check_transaction_status_for(transaction_id, options = {})
|
|
@@ -106,7 +92,7 @@ module PayTM
|
|
|
106
92
|
requestType: request_type,
|
|
107
93
|
txnType: transaction_type,
|
|
108
94
|
txnId: transaction_id,
|
|
109
|
-
merchantGuid:
|
|
95
|
+
merchantGuid: self.class.merchant_guid
|
|
110
96
|
},
|
|
111
97
|
platformName: 'PayTM',
|
|
112
98
|
operationType: 'CHECK_TXN_STATUS'
|
|
@@ -121,10 +107,10 @@ module PayTM
|
|
|
121
107
|
{
|
|
122
108
|
request: {
|
|
123
109
|
requestType: options[:request_type],
|
|
124
|
-
merchantGuid:
|
|
125
|
-
merchantOrderId: options[:merchant_order_id] || "#{ @phone }-#{ Time.
|
|
110
|
+
merchantGuid: self.class.merchant_guid,
|
|
111
|
+
merchantOrderId: options[:merchant_order_id] || "#{ @phone }-#{ Time.now.to_i }",
|
|
126
112
|
salesWalletName: options[:sales_wallet_name],
|
|
127
|
-
salesWalletGuid:
|
|
113
|
+
salesWalletGuid: self.class.sales_wallet_id,
|
|
128
114
|
payeeEmailId: @email,
|
|
129
115
|
payeePhoneNumber: @phone,
|
|
130
116
|
payeeSsoId: options[:payee_sso_id] || '',
|
|
@@ -143,8 +129,8 @@ module PayTM
|
|
|
143
129
|
{
|
|
144
130
|
'Content-Type' => 'application/json',
|
|
145
131
|
'Accept' => 'application/json',
|
|
146
|
-
'mid' =>
|
|
147
|
-
'checksumhash' => generate_hash(
|
|
132
|
+
'mid' => self.class.merchant_guid,
|
|
133
|
+
'checksumhash' => generate_hash(self.class.aes_key, request_body)
|
|
148
134
|
}
|
|
149
135
|
end
|
|
150
136
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paytm-merchant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sachin
|
|
@@ -53,9 +53,9 @@ files:
|
|
|
53
53
|
- Rakefile
|
|
54
54
|
- bin/console
|
|
55
55
|
- bin/setup
|
|
56
|
+
- lib/generators/paytm_setup_generator.rb
|
|
56
57
|
- lib/paytm/merchant.rb
|
|
57
58
|
- lib/paytm/merchant/encryption_new_p_g.rb
|
|
58
|
-
- lib/paytm/merchant/generators/paytm_setup_generator.rb
|
|
59
59
|
- lib/paytm/merchant/version.rb
|
|
60
60
|
- paytm-merchant.gemspec
|
|
61
61
|
homepage: https://github.com/schnmudgal/paytm-merchant.git
|