Module: Pay::Receipts
- Defined in:
- lib/pay/receipts.rb
Instance Method Summary collapse
- #filename ⇒ Object
- #line_items ⇒ Object
- #product ⇒ Object
-
#receipt ⇒ Object
Must return a file object.
- #receipt_pdf ⇒ Object
Instance Method Details
#filename ⇒ Object
3 4 5 |
# File 'lib/pay/receipts.rb', line 3 def filename "receipt-#{created_at.strftime("%Y-%m-%d")}.pdf" end |
#line_items ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/pay/receipts.rb', line 29 def line_items line_items = [ [I18n.t("receipt.date"), created_at.to_s], [I18n.t("receipt.account_billed"), "#{owner.name} (#{owner.email})"], [I18n.t("receipt.product"), product], [I18n.t("receipt.amount"), ActionController::Base.helpers.number_to_currency(amount / 100.0)], [I18n.t("receipt.charged_to"), charged_to] ] line_items << [I18n.t("receipt.additional_info"), owner.extra_billing_info] if owner.extra_billing_info? line_items end |
#product ⇒ Object
7 8 9 |
# File 'lib/pay/receipts.rb', line 7 def product Pay.application_name end |
#receipt ⇒ Object
Must return a file object
12 13 14 |
# File 'lib/pay/receipts.rb', line 12 def receipt receipt_pdf.render end |