Module: SolidusStripe::LogEntries
- Extended by:
- ActiveSupport::Concern, LogEntries
- Included in:
- Gateway, LogEntries
- Defined in:
- app/models/concerns/solidus_stripe/log_entries.rb
Instance Method Summary collapse
-
#build_payment_log(success:, message:, response_code: nil, data: nil) ⇒ return type
Builds an ActiveMerchant::Billing::Response.
- #payment_log(payment, **options) ⇒ Object
Instance Method Details
#build_payment_log(success:, message:, response_code: nil, data: nil) ⇒ return type
Builds an ActiveMerchant::Billing::Response
15 16 17 18 19 20 21 22 |
# File 'app/models/concerns/solidus_stripe/log_entries.rb', line 15 def build_payment_log(success:, message:, response_code: nil, data: nil) ActiveMerchant::Billing::Response.new( success, , { 'data' => data.to_json }, { authorization: response_code }, ) end |
#payment_log(payment, **options) ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/models/concerns/solidus_stripe/log_entries.rb', line 24 def payment_log(payment, **) payment.log_entries.create!(details: YAML.safe_dump( build_payment_log(**), permitted_classes: Spree::LogEntry.permitted_classes, aliases: Spree::Config.log_entry_allow_aliases, )) end |