Class: ChargeBee::Result
- Inherits:
-
Object
- Object
- ChargeBee::Result
- Defined in:
- lib/chargebee/result.rb
Direct Known Subclasses
Instance Method Summary collapse
- #addon ⇒ Object
- #address ⇒ Object
- #card ⇒ Object
- #comment ⇒ Object
- #contact ⇒ Object
- #contract_term ⇒ Object
- #coupon ⇒ Object
- #coupon_code ⇒ Object
- #coupon_set ⇒ Object
- #credit_note ⇒ Object
- #credit_notes ⇒ Object
- #customer ⇒ Object
- #download ⇒ Object
- #estimate ⇒ Object
- #event ⇒ Object
- #export ⇒ Object
- #gift ⇒ Object
- #hierarchies ⇒ Object
- #hierarchy ⇒ Object
- #hosted_page ⇒ Object
-
#initialize(response) ⇒ Result
constructor
A new instance of Result.
- #invoice ⇒ Object
- #invoices ⇒ Object
- #order ⇒ Object
- #payment_intent ⇒ Object
- #payment_source ⇒ Object
- #plan ⇒ Object
- #portal_session ⇒ Object
- #promotional_credit ⇒ Object
- #quote ⇒ Object
- #quote_line_group ⇒ Object
- #resource_migration ⇒ Object
- #site_migration_detail ⇒ Object
- #subscription ⇒ Object
- #third_party_payment_method ⇒ Object
- #time_machine ⇒ Object
- #to_s(*args) ⇒ Object
- #token ⇒ Object
- #transaction ⇒ Object
- #unbilled_charge ⇒ Object
- #unbilled_charges ⇒ Object
- #virtual_bank_account ⇒ Object
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
143 144 145 146 147 |
# File 'lib/chargebee/result.rb', line 143 def addon() addon = get(:addon, Addon, {:tiers => Addon::Tier}); return addon; end |
#address ⇒ Object
164 165 166 167 |
# File 'lib/chargebee/result.rb', line 164 def address() address = get(:address, Address); return address; end |
#card ⇒ Object
56 57 58 59 |
# File 'lib/chargebee/result.rb', line 56 def card() card = get(:card, Card); return card; end |
#comment ⇒ Object
175 176 177 178 |
# File 'lib/chargebee/result.rb', line 175 def comment() comment = get(:comment, Comment); return comment; end |
#contact ⇒ Object
30 31 32 33 |
# File 'lib/chargebee/result.rb', line 30 def contact() contact = get(:contact, Contact); return contact; end |
#contract_term ⇒ Object
14 15 16 17 |
# File 'lib/chargebee/result.rb', line 14 def contract_term() contract_term = get(:contract_term, ContractTerm); return contract_term; end |
#coupon ⇒ Object
149 150 151 152 |
# File 'lib/chargebee/result.rb', line 149 def coupon() coupon = get(:coupon, Coupon); return coupon; end |
#coupon_code ⇒ Object
159 160 161 162 |
# File 'lib/chargebee/result.rb', line 159 def coupon_code() coupon_code = get(:coupon_code, CouponCode); return coupon_code; end |
#coupon_set ⇒ Object
154 155 156 157 |
# File 'lib/chargebee/result.rb', line 154 def coupon_set() coupon_set = get(:coupon_set, CouponSet); return coupon_set; end |
#credit_note ⇒ Object
72 73 74 75 76 |
# File 'lib/chargebee/result.rb', line 72 def credit_note() credit_note = get(:credit_note, CreditNote, {:line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :line_item_tiers => CreditNote::LineItemTier, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation}); return credit_note; end |
#credit_notes ⇒ Object
225 226 227 228 229 |
# File 'lib/chargebee/result.rb', line 225 def credit_notes() credit_notes = get_list(:credit_notes, CreditNote, {:line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :line_item_tiers => CreditNote::LineItemTier, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation}); return credit_notes; end |
#customer ⇒ Object
19 20 21 22 23 |
# File 'lib/chargebee/result.rb', line 19 def customer() customer = get(:customer, Customer, {:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance, :relationship => Customer::Relationship}); return customer; end |
#download ⇒ Object
180 181 182 183 |
# File 'lib/chargebee/result.rb', line 180 def download() download = get(:download, Download); return download; end |
#estimate ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/chargebee/result.rb', line 107 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, :contract_term => SubscriptionEstimate::ContractTerm}); estimate.init_dependant(@response[:estimate], :invoice_estimate, {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_tiers => InvoiceEstimate::LineItemTier, :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_tiers => InvoiceEstimate::LineItemTier, :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_tiers => InvoiceEstimate::LineItemTier, :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, :line_item_tiers => CreditNoteEstimate::LineItemTier}); estimate.init_dependant_list(@response[:estimate], :unbilled_charge_estimates, {:tiers => UnbilledCharge::Tier}); return estimate; end |
#event ⇒ Object
169 170 171 172 173 |
# File 'lib/chargebee/result.rb', line 169 def event() event = get(:event, Event, {:webhooks => Event::Webhook}); return event; end |
#export ⇒ Object
206 207 208 209 210 |
# File 'lib/chargebee/result.rb', line 206 def export() export = get(:export, Export, {:download => Export::Download}); return export; end |
#gift ⇒ Object
90 91 92 93 94 |
# File 'lib/chargebee/result.rb', line 90 def gift() gift = get(:gift, Gift, {:gifter => Gift::Gifter, :gift_receiver => Gift::GiftReceiver, :gift_timelines => Gift::GiftTimeline}); return gift; end |
#hierarchies ⇒ Object
231 232 233 234 235 |
# File 'lib/chargebee/result.rb', line 231 def hierarchies() hierarchies = get_list(:hierarchies, Hierarchy, {}); return hierarchies; end |
#hierarchy ⇒ Object
25 26 27 28 |
# File 'lib/chargebee/result.rb', line 25 def hierarchy() hierarchy = get(:hierarchy, Hierarchy); return hierarchy; end |
#hosted_page ⇒ Object
102 103 104 105 |
# File 'lib/chargebee/result.rb', line 102 def hosted_page() hosted_page = get(:hosted_page, HostedPage); return hosted_page; end |
#invoice ⇒ Object
66 67 68 69 70 |
# File 'lib/chargebee/result.rb', line 66 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, :line_item_tiers => Invoice::LineItemTier, :linked_payments => Invoice::LinkedPayment, :dunning_attempts => Invoice::DunningAttempt, :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
237 238 239 240 241 |
# File 'lib/chargebee/result.rb', line 237 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, :line_item_tiers => Invoice::LineItemTier, :linked_payments => Invoice::LinkedPayment, :dunning_attempts => Invoice::DunningAttempt, :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
84 85 86 87 88 |
# File 'lib/chargebee/result.rb', line 84 def order() order = get(:order, Order, {:order_line_items => Order::OrderLineItem, :shipping_address => Order::ShippingAddress, :billing_address => Order::BillingAddress, :line_item_taxes => Order::LineItemTax, :line_item_discounts => Order::LineItemDiscount, :linked_credit_notes => Order::LinkedCreditNote}); return order; end |
#payment_intent ⇒ Object
212 213 214 215 216 |
# File 'lib/chargebee/result.rb', line 212 def payment_intent() payment_intent = get(:payment_intent, PaymentIntent, {:payment_attempt => PaymentIntent::PaymentAttempt}); return payment_intent; end |
#payment_source ⇒ Object
40 41 42 43 44 |
# File 'lib/chargebee/result.rb', line 40 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
137 138 139 140 141 |
# File 'lib/chargebee/result.rb', line 137 def plan() plan = get(:plan, Plan, {:tiers => Plan::Tier, :applicable_addons => Plan::ApplicableAddon, :attached_addons => Plan::AttachedAddon, :event_based_addons => Plan::EventBasedAddon}); return plan; end |
#portal_session ⇒ Object
185 186 187 188 189 |
# File 'lib/chargebee/result.rb', line 185 def portal_session() portal_session = get(:portal_session, PortalSession, {:linked_customers => PortalSession::LinkedCustomer}); return portal_session; end |
#promotional_credit ⇒ Object
61 62 63 64 |
# File 'lib/chargebee/result.rb', line 61 def promotional_credit() promotional_credit = get(:promotional_credit, PromotionalCredit); return promotional_credit; end |
#quote ⇒ Object
125 126 127 128 129 |
# File 'lib/chargebee/result.rb', line 125 def quote() quote = get(:quote, Quote, {:line_items => Quote::LineItem, :discounts => Quote::Discount, :line_item_discounts => Quote::LineItemDiscount, :taxes => Quote::Tax, :line_item_taxes => Quote::LineItemTax, :shipping_address => Quote::ShippingAddress, :billing_address => Quote::BillingAddress}); return quote; end |
#quote_line_group ⇒ Object
131 132 133 134 135 |
# File 'lib/chargebee/result.rb', line 131 def quote_line_group() quote_line_group = get(:quote_line_group, QuoteLineGroup, {:line_items => QuoteLineGroup::LineItem, :discounts => QuoteLineGroup::Discount, :line_item_discounts => QuoteLineGroup::LineItemDiscount, :taxes => QuoteLineGroup::Tax, :line_item_taxes => QuoteLineGroup::LineItemTax}); return quote_line_group; end |
#resource_migration ⇒ Object
196 197 198 199 |
# File 'lib/chargebee/result.rb', line 196 def resource_migration() resource_migration = get(:resource_migration, ResourceMigration); return resource_migration; end |
#site_migration_detail ⇒ Object
191 192 193 194 |
# File 'lib/chargebee/result.rb', line 191 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, :event_based_addons => Subscription::EventBasedAddon, :charged_event_based_addons => Subscription::ChargedEventBasedAddon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo, :contract_term => Subscription::ContractTerm}); return subscription; end |
#third_party_payment_method ⇒ Object
46 47 48 49 |
# File 'lib/chargebee/result.rb', line 46 def third_party_payment_method() third_party_payment_method = get(:third_party_payment_method, ThirdPartyPaymentMethod); return third_party_payment_method; end |
#time_machine ⇒ Object
201 202 203 204 |
# File 'lib/chargebee/result.rb', line 201 def time_machine() time_machine = get(:time_machine, TimeMachine); return time_machine; end |
#to_s(*args) ⇒ Object
243 244 245 |
# File 'lib/chargebee/result.rb', line 243 def to_s(*args) JSON.pretty_generate(@response) end |
#token ⇒ Object
35 36 37 38 |
# File 'lib/chargebee/result.rb', line 35 def token() token = get(:token, Token); return token; end |
#transaction ⇒ Object
96 97 98 99 100 |
# File 'lib/chargebee/result.rb', line 96 def transaction() transaction = get(:transaction, Transaction, {:linked_invoices => Transaction::LinkedInvoice, :linked_credit_notes => Transaction::LinkedCreditNote, :linked_refunds => Transaction::LinkedRefund, :linked_payments => Transaction::LinkedPayment}); return transaction; end |
#unbilled_charge ⇒ Object
78 79 80 81 82 |
# File 'lib/chargebee/result.rb', line 78 def unbilled_charge() unbilled_charge = get(:unbilled_charge, UnbilledCharge, {:tiers => UnbilledCharge::Tier}); return unbilled_charge; end |
#unbilled_charges ⇒ Object
219 220 221 222 223 |
# File 'lib/chargebee/result.rb', line 219 def unbilled_charges() unbilled_charges = get_list(:unbilled_charges, UnbilledCharge, {:tiers => UnbilledCharge::Tier}); return unbilled_charges; end |
#virtual_bank_account ⇒ Object
51 52 53 54 |
# File 'lib/chargebee/result.rb', line 51 def virtual_bank_account() virtual_bank_account = get(:virtual_bank_account, VirtualBankAccount); return virtual_bank_account; end |