Module: StripeInvoice::TaxReportHelper
- Defined in:
- app/helpers/stripe_invoice/tax_report_helper.rb
Instance Method Summary collapse
- #format_billing_address(owner) ⇒ Object
-
#format_stripe_currency(obj, attr_sym = :amount) ⇒ Object
takes a Stripe JSON hash and an attribute name and returns a nicely formatted string for that currency.
Instance Method Details
#format_billing_address(owner) ⇒ Object
11 12 13 14 |
# File 'app/helpers/stripe_invoice/tax_report_helper.rb', line 11 def format_billing_address(owner) raise "You need to implement #billing_address on your subscription owner class" unless owner.respond_to? :billing_address owner.billing_address end |
#format_stripe_currency(obj, attr_sym = :amount) ⇒ Object
takes a Stripe JSON hash and an attribute name and returns a nicely formatted string for that currency
6 7 8 |
# File 'app/helpers/stripe_invoice/tax_report_helper.rb', line 6 def format_stripe_currency(obj, attr_sym = :amount) number_to_currency(obj[attr_sym].to_f / 100, unit: "#{obj[:currency].upcase} ") end |