This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module PaymentProcessor | |
| module Response | |
| class ResponseStruct < Struct | |
| def self.build(args) | |
| return if args.blank? | |
| # this filters the fields from the response that we don't need or want. | |
| # but it also keeps the kwargs strict. | |
| new(args.slice(*members) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Event | |
| class Base < ActiveRecord::Base | |
| self.table_name = 'events' | |
| # Callbacks to enforce state transitions logic | |
| before_update :validate_status_transition | |
| enum status: { | |
| enqueued: 0, | |
| processing: 1, |
OlderNewer