class Instamojo::Payment
{
"payment_id" => "MOJO3815000F72853519", "quantity" => 1, "status" => "Credit", "link_slug" => "demo-product", "link_title" => "Demo product", "buyer_name" => "", "buyer_phone" => "", "buyer_email" => "nalinc007@gmail.com", "currency" => "Free", "unit_price" => "0.00", "amount" => "0.00", "fees" => "0", "shipping_address" => nil, "shipping_city" => nil, "shipping_state" => nil, "shipping_zip" => nil, "shipping_country" => nil, "discount_code" => nil, "discount_amount_off" => nil, "variants" => [], "custom_fields" => {}, "affiliate_id" => nil, "affiliate_commission" => nil, "created_at" => "2013-08-15T13:16:24.629Z"
}
Attributes
affiliate_commission[RW]
affiliate_id[RW]
amount[RW]
buyer_email[RW]
buyer_name[RW]
buyer_phone[RW]
created_at[RW]
currency[RW]
custom_fields[RW]
discount_amount_off[RW]
discount_code[RW]
fees[RW]
link_slug[RW]
link_title[RW]
original[R]
payment_id[RW]
quantity[RW]
shipping_address[RW]
shipping_city[RW]
shipping_country[RW]
shipping_state[RW]
shipping_zip[RW]
status[RW]
unit_price[RW]
variants[RW]
Public Class Methods
new(payment, client)
click to toggle source
# File lib/client/payment.rb, line 41 def initialize(payment, client) assign_values(payment) @client = client # Reference to client end
Public Instance Methods
process_refund(hash = {}, &block)
click to toggle source
Process refund for this payment payment.process_refund(type: 'QFL', body: 'Customer is not satisfied')
# File lib/client/payment.rb, line 48 def process_refund(hash = {}, &block) hash[:payment_id] = self.payment_id @client.create_refund(hash, &block) end
Also aliased as: create_refund
to_s()
click to toggle source
# File lib/client/payment.rb, line 53 def to_s sprintf("Instamojo Payment(payment_id: %s, quantity: %s, amount: %s, status: %s, link_slug: %s, buyer_name: %s)", payment_id, quantity, amount, status, link_slug, buyer_name) end