Class: ChargeBee::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/chargebee/result.rb

Direct Known Subclasses

Event::Content, HostedPage::Content

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Result

Returns a new instance of Result.



4
5
6
# File 'lib/chargebee/result.rb', line 4

def initialize(response)
  @response = response
end

Instance Method Details

#addon ⇒ Object



97
98
99
100
# File 'lib/chargebee/result.rb', line 97

def addon() 
    addon = get(:addon, Addon);
    return addon;
end

#address ⇒ Object



117
118
119
120
# File 'lib/chargebee/result.rb', line 117

def address() 
    address = get(:address, Address);
    return address;
end

#card ⇒ Object



31
32
33
34
# File 'lib/chargebee/result.rb', line 31

def card() 
    card = get(:card, Card);
    return card;
end

#comment ⇒ Object



128
129
130
131
# File 'lib/chargebee/result.rb', line 128

def comment() 
    comment = get(:comment, Comment);
    return comment;
end

#coupon ⇒ Object



102
103
104
105
# File 'lib/chargebee/result.rb', line 102

def coupon() 
    coupon = get(:coupon, Coupon);
    return coupon;
end

#coupon_code ⇒ Object



112
113
114
115
# File 'lib/chargebee/result.rb', line 112

def coupon_code() 
    coupon_code = get(:coupon_code, CouponCode);
    return coupon_code;
end

#coupon_set ⇒ Object



107
108
109
110
# File 'lib/chargebee/result.rb', line 107

def coupon_set() 
    coupon_set = get(:coupon_set, CouponSet);
    return coupon_set;
end

#credit_note ⇒ Object



47
48
49
50
51
# File 'lib/chargebee/result.rb', line 47

def credit_note() 
    credit_note = get(:credit_note, CreditNote,
    {:line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation});
    return credit_note;
end

#credit_notes ⇒ Object



166
167
168
169
170
# File 'lib/chargebee/result.rb', line 166

def credit_notes()
    credit_notes = get_list(:credit_notes, CreditNote,
    {:line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation});
    return credit_notes;
end

#customer ⇒ Object



14
15
16
17
18
# File 'lib/chargebee/result.rb', line 14

def customer() 
    customer = get(:customer, Customer,
    {:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance});
    return customer;
end

#download ⇒ Object



133
134
135
136
# File 'lib/chargebee/result.rb', line 133

def download() 
    download = get(:download, Download);
    return download;
end

#estimate ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/chargebee/result.rb', line 74

def estimate() 
    estimate = get(:estimate, Estimate, {},
    {:subscription_estimate => SubscriptionEstimate, :invoice_estimate => InvoiceEstimate, :invoice_estimates => InvoiceEstimate, :next_invoice_estimate => InvoiceEstimate, :credit_note_estimates => CreditNoteEstimate, :unbilled_charge_estimates => UnbilledCharge});
    estimate.init_dependant(@response[:estimate], :subscription_estimate,
    {:shipping_address => SubscriptionEstimate::ShippingAddress});
    estimate.init_dependant(@response[:estimate], :invoice_estimate,
    {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
    estimate.init_dependant(@response[:estimate], :next_invoice_estimate,
    {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
    estimate.init_dependant_list(@response[:estimate], :invoice_estimates,
    {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
    estimate.init_dependant_list(@response[:estimate], :credit_note_estimates,
    {:line_items => CreditNoteEstimate::LineItem, :discounts => CreditNoteEstimate::Discount, :taxes => CreditNoteEstimate::Tax, :line_item_taxes => CreditNoteEstimate::LineItemTax, :line_item_discounts => CreditNoteEstimate::LineItemDiscount});
    estimate.init_dependant_list(@response[:estimate], :unbilled_charge_estimates,
    {});
    return estimate;
end

#event ⇒ Object



122
123
124
125
126
# File 'lib/chargebee/result.rb', line 122

def event() 
    event = get(:event, Event,
    {:webhooks => Event::Webhook});
    return event;
end

#hosted_page ⇒ Object



69
70
71
72
# File 'lib/chargebee/result.rb', line 69

def hosted_page() 
    hosted_page = get(:hosted_page, HostedPage);
    return hosted_page;
end

#invoice ⇒ Object



41
42
43
44
45
# File 'lib/chargebee/result.rb', line 41

def invoice() 
    invoice = get(:invoice, Invoice,
    {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :line_item_discounts => Invoice::LineItemDiscount, :taxes => Invoice::Tax, :line_item_taxes => Invoice::LineItemTax, :linked_payments => Invoice::LinkedPayment, :applied_credits => Invoice::AppliedCredit, :adjustment_credit_notes => Invoice::AdjustmentCreditNote, :issued_credit_notes => Invoice::IssuedCreditNote, :linked_orders => Invoice::LinkedOrder, :notes => Invoice::Note, :shipping_address => Invoice::ShippingAddress, :billing_address => Invoice::BillingAddress});
    return invoice;
end

#invoices ⇒ Object



172
173
174
175
176
# File 'lib/chargebee/result.rb', line 172

def invoices()
    invoices = get_list(:invoices, Invoice,
    {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :line_item_discounts => Invoice::LineItemDiscount, :taxes => Invoice::Tax, :line_item_taxes => Invoice::LineItemTax, :linked_payments => Invoice::LinkedPayment, :applied_credits => Invoice::AppliedCredit, :adjustment_credit_notes => Invoice::AdjustmentCreditNote, :issued_credit_notes => Invoice::IssuedCreditNote, :linked_orders => Invoice::LinkedOrder, :notes => Invoice::Note, :shipping_address => Invoice::ShippingAddress, :billing_address => Invoice::BillingAddress});
    return invoices;
end

#order ⇒ Object



58
59
60
61
# File 'lib/chargebee/result.rb', line 58

def order() 
    order = get(:order, Order);
    return order;
end

#payment_source ⇒ Object



20
21
22
23
24
# File 'lib/chargebee/result.rb', line 20

def payment_source() 
    payment_source = get(:payment_source, PaymentSource,
    {:card => PaymentSource::Card, :bank_account => PaymentSource::BankAccount, :amazon_payment => PaymentSource::AmazonPayment, :paypal => PaymentSource::Paypal});
    return payment_source;
end

#plan ⇒ Object



92
93
94
95
# File 'lib/chargebee/result.rb', line 92

def plan() 
    plan = get(:plan, Plan);
    return plan;
end

#portal_session ⇒ Object



138
139
140
141
142
# File 'lib/chargebee/result.rb', line 138

def portal_session() 
    portal_session = get(:portal_session, PortalSession,
    {:linked_customers => PortalSession::LinkedCustomer});
    return portal_session;
end

#promotional_credit ⇒ Object



36
37
38
39
# File 'lib/chargebee/result.rb', line 36

def promotional_credit() 
    promotional_credit = get(:promotional_credit, PromotionalCredit);
    return promotional_credit;
end

#resource_migration ⇒ Object



149
150
151
152
# File 'lib/chargebee/result.rb', line 149

def resource_migration() 
    resource_migration = get(:resource_migration, ResourceMigration);
    return resource_migration;
end

#site_migration_detail ⇒ Object



144
145
146
147
# File 'lib/chargebee/result.rb', line 144

def site_migration_detail() 
    site_migration_detail = get(:site_migration_detail, SiteMigrationDetail);
    return site_migration_detail;
end

#subscription ⇒ Object



8
9
10
11
12
# File 'lib/chargebee/result.rb', line 8

def subscription() 
    subscription = get(:subscription, Subscription,
    {:addons => Subscription::Addon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo});
    return subscription;
end

#third_party_payment_method ⇒ Object



26
27
28
29
# File 'lib/chargebee/result.rb', line 26

def third_party_payment_method() 
    third_party_payment_method = get(:third_party_payment_method, ThirdPartyPaymentMethod);
    return third_party_payment_method;
end

#time_machine ⇒ Object



154
155
156
157
# File 'lib/chargebee/result.rb', line 154

def time_machine() 
    time_machine = get(:time_machine, TimeMachine);
    return time_machine;
end

#transaction ⇒ Object



63
64
65
66
67
# File 'lib/chargebee/result.rb', line 63

def transaction() 
    transaction = get(:transaction, Transaction,
    {:linked_invoices => Transaction::LinkedInvoice, :linked_credit_notes => Transaction::LinkedCreditNote, :linked_refunds => Transaction::LinkedRefund});
    return transaction;
end

#unbilled_charge ⇒ Object



53
54
55
56
# File 'lib/chargebee/result.rb', line 53

def unbilled_charge() 
    unbilled_charge = get(:unbilled_charge, UnbilledCharge);
    return unbilled_charge;
end

#unbilled_charges ⇒ Object



160
161
162
163
164
# File 'lib/chargebee/result.rb', line 160

def unbilled_charges()
    unbilled_charges = get_list(:unbilled_charges, UnbilledCharge,
    {});
    return unbilled_charges;
end