Module: PayTM::Merchant
- Included in:
- Paytm
- Defined in:
- lib/paytm/merchant.rb,
lib/paytm/merchant/version.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- Staging_Base_Uri =
Constants
'https://trust-uat.paytm.in'
- End_Points =
{ salestouser: '/wallet-web/salesToUserCredit', checkstatus: '/wallet-web/checkStatus' }
- VERSION =
'0.2.1.1'
Instance Attribute Summary collapse
-
#amount ⇒ Object
Attr_accessors.
-
#email ⇒ Object
Attr_accessors.
-
#metadata ⇒ Object
Attr_accessors.
-
#phone ⇒ Object
Attr_accessors.
-
#recipient ⇒ Object
Attr_accessors.
Class Method Summary collapse
Instance Method Summary collapse
- #check_transaction_status_for(transaction_id, options = {}) ⇒ Object
-
#initialize(data = {}) ⇒ Object
Instance Methods.
- #transfer(options = {}) ⇒ Object
Instance Attribute Details
#amount ⇒ Object
Attr_accessors
22 23 24 |
# File 'lib/paytm/merchant.rb', line 22 def amount @amount end |
#email ⇒ Object
Attr_accessors
22 23 24 |
# File 'lib/paytm/merchant.rb', line 22 def email @email end |
#metadata ⇒ Object
Attr_accessors
22 23 24 |
# File 'lib/paytm/merchant.rb', line 22 def @metadata end |
#phone ⇒ Object
Attr_accessors
22 23 24 |
# File 'lib/paytm/merchant.rb', line 22 def phone @phone end |
#recipient ⇒ Object
Attr_accessors
22 23 24 |
# File 'lib/paytm/merchant.rb', line 22 def recipient @recipient end |
Class Method Details
.included(base) ⇒ Object
8 9 10 11 12 |
# File 'lib/paytm/merchant.rb', line 8 def self.included(base) base.send :include, HTTParty base.extend EncryptionNewPG base.extend ClassMethods end |
Instance Method Details
#check_transaction_status_for(transaction_id, options = {}) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/paytm/merchant.rb', line 66 def check_transaction_status_for(transaction_id, = {}) check_transaction_body = paytm_check_transation_status_body(transaction_id, ) @response = self.class.post( End_Points[:checkstatus], { body: check_transaction_body.to_json, headers: paytm_check_transation_status_header(check_transaction_body), verify: ([:verify] == false ? false : true) } ) end |
#initialize(data = {}) ⇒ Object
Instance Methods
46 47 48 49 50 51 |
# File 'lib/paytm/merchant.rb', line 46 def initialize(data = {}) @amount = data[:amount] @recipient = data[:recipient] @phone = data[:phone] @email = data[:email] end |
#transfer(options = {}) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/paytm/merchant.rb', line 53 def transfer( = {}) @amount = amount if [:amount] @response = self.class.post( End_Points[:salestouser], { body: paytm_request_body().to_json, headers: paytm_request_headers, verify: ([:verify] == false ? false : true) } ) end |