Class: C2eCore::Drops::CreditsRefundRequestDrop
- Includes:
- ActionView::Helpers::NumberHelper
- Defined in:
- /build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb
Instance Method Summary collapse
-
#account_holder ⇒ String?
-
The name of the account holder used in the request.
-
-
#account_number ⇒ String
-
The account number used in the request.
-
-
#amount ⇒ Float
-
The refund request amount, e.g.
-
-
#currency ⇒ CurrencyDrop
-
The currency of the request amount as a drop object.
-
-
#formatted_amount ⇒ String
-
The refund request amount formatted in its currency, e.g.
-
-
#initialize(refund_request) ⇒ CreditsRefundRequestDrop
constructor
A new instance of CreditsRefundRequestDrop.
-
#requested_at ⇒ DateTime
-
The date and time when the request was made.
-
-
#unsubscribe_url ⇒ String
-
URL to the consents management app.
-
-
#wallet ⇒ CreditsWalletDrop
-
The request wallet as a drop object.
-
Constructor Details
#initialize(refund_request) ⇒ CreditsRefundRequestDrop
Returns a new instance of CreditsRefundRequestDrop.
8 9 10 11 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 8 def initialize(refund_request) super() @refund_request = refund_request end |
Instance Method Details
#account_holder ⇒ String?
Returns - The name of the account holder used in the request.
44 45 46 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 44 def account_holder @refund_request.account_holder end |
#account_number ⇒ String
Returns - The account number used in the request. It can be in a national format for the Czech Republic (e.g. "19-2000145399/0800"
) or in an IBAN format (e.g. CZ6508000000192000145399
).
39 40 41 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 39 def account_number @refund_request.account_number end |
#amount ⇒ Float
Returns - The refund request amount, e.g. 123.45
.
14 15 16 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 14 def amount @refund_request.amount end |
#currency ⇒ CurrencyDrop
Returns - The currency of the request amount as a drop object.
24 25 26 27 28 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 24 def currency stored_value __method__ do CurrencyDrop.new(@refund_request.currency) end end |
#formatted_amount ⇒ String
Returns - The refund request amount formatted in its currency, e.g. "123,45 Kč"
.
19 20 21 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 19 def formatted_amount number_to_currency(amount, unit: @refund_request.currency.to_s) end |
#requested_at ⇒ DateTime
Returns - The date and time when the request was made.
49 50 51 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 49 def requested_at @refund_request.requested_at end |
#unsubscribe_url ⇒ String
Returns - URL to the consents management app.
54 55 56 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 54 def unsubscribe_url Rails.application.config.[:customer_unsubscribe_url] end |
#wallet ⇒ CreditsWalletDrop
Returns - The request wallet as a drop object.
31 32 33 34 35 |
# File '/build/app/mailers/c2e_core/drops/credits_refund_request_drop.rb', line 31 def wallet stored_value __method__ do CreditsWalletDrop.new(@refund_request.wallet) end end |