Class: Instamojo::PaymentRequest

Inherits:
Object
  • Object
show all
Includes:
CommonObject
Defined in:
lib/client/payment_request.rb

Overview

"id" => "92e58bd771414d05a5e443b0a85f8b43",
"phone" => "+919999999999",
"email" => "[email protected]",
"buyer_name" => "John Doe",
"amount" => "2500",
"purpose" => "FIFA 16",
"status" => "Pending",
"send_sms" => true,
"send_email" => true,
"sms_status" => "Pending",
"email_status" => "Pending",
"shorturl" => nil,
"longurl" => "https://www.instamojo.com/@ashwini/92e58bd771414d05a5e443b0a85f8b43",
"redirect_url" => "http://www.example.com/redirect/",
"webhook" => "http://www.example.com/webhook/",
"created_at" => "2015-10-07T21:36:34.665Z",
"modified_at" => "2015-10-07T21:36:34.665Z",
"allow_repeated_payments" => false

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CommonObject

#assign_values, #construct_hash, included, #reload, #reload!, #to_h, #to_json

Constructor Details

#initialize(payment_request, client) ⇒ PaymentRequest

Returns a new instance of PaymentRequest.



34
35
36
37
# File 'lib/client/payment_request.rb', line 34

def initialize(payment_request, client)
  assign_values(payment_request)
  @client = client # Reference to client
end

Instance Attribute Details

#allow_repeated_paymentsObject

Returns the value of attribute allow_repeated_payments.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def allow_repeated_payments
  @allow_repeated_payments
end

#amountObject

Returns the value of attribute amount.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def amount
  @amount
end

#buyer_nameObject

Returns the value of attribute buyer_name.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def buyer_name
  @buyer_name
end

#created_atObject

Returns the value of attribute created_at.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def created_at
  @created_at
end

#emailObject

Returns the value of attribute email.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def email
  @email
end

#email_statusObject

Returns the value of attribute email_status.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def email_status
  @email_status
end

#idObject

Returns the value of attribute id.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def id
  @id
end

#longurlObject

Returns the value of attribute longurl.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def longurl
  @longurl
end

#modified_atObject

Returns the value of attribute modified_at.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def modified_at
  @modified_at
end

#originalObject (readonly)

Returns the value of attribute original.



30
31
32
# File 'lib/client/payment_request.rb', line 30

def original
  @original
end

#phoneObject

Returns the value of attribute phone.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def phone
  @phone
end

#purposeObject

Returns the value of attribute purpose.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def purpose
  @purpose
end

#redirect_urlObject

Returns the value of attribute redirect_url.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def redirect_url
  @redirect_url
end

#send_emailObject

Returns the value of attribute send_email.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def send_email
  @send_email
end

#send_smsObject

Returns the value of attribute send_sms.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def send_sms
  @send_sms
end

#shorturlObject

Returns the value of attribute shorturl.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def shorturl
  @shorturl
end

#sms_statusObject

Returns the value of attribute sms_status.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def sms_status
  @sms_status
end

#statusObject

Returns the value of attribute status.



27
28
29
# File 'lib/client/payment_request.rb', line 27

def status
  @status
end

#webhookObject

Returns the value of attribute webhook.



28
29
30
# File 'lib/client/payment_request.rb', line 28

def webhook
  @webhook
end

Instance Method Details

#to_sObject



39
40
41
42
# File 'lib/client/payment_request.rb', line 39

def to_s
  sprintf("Instamojo PaymentRequest(id: %s, purpose: %s, amount: %s, status: %s, shorturl: %s, longurl: %s)",
          id, purpose, amount, status, shorturl, longurl)
end