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 = [ ["Date", created_at.to_s], ["Account Billed", "#{owner.name} (#{owner.email})"], ["Product", product], ["Amount", ActionController::Base.helpers.number_to_currency(amount / 100.0)], ["Charged to", charged_to] ] line_items << ["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 |