Class: BloomRemit::CreateTxn
- Inherits:
-
Object
- Object
- BloomRemit::CreateTxn
- Includes:
- ActiveModel::Validations
- Defined in:
- app/services/bloom_remit/create_txn.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call(opts) ⇒ Object
24 25 26 27 28 |
# File 'app/services/bloom_remit/create_txn.rb', line 24 def self.call(opts) create_txn = self.new(opts) fail ArgumentError, create_txn.errors. if create_txn.invalid? create_txn.() end |
Instance Method Details
#call ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/services/bloom_remit/create_txn.rb', line 30 def call txn_params = attributes.slice(*%i[ amount account_name account_id target_slug external_id recipient_id ]).merge( sender_id: sender.id, sender_type: sender.class.base_class.name, owner_id: owner.id, owner_type: owner.class.base_class.name, ) ::BloomRemit::Txns::Operations::Create.(txn: txn_params) end |