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
23 24 25 26 27 |
# File 'app/services/bloom_remit/create_txn.rb', line 23 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
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/services/bloom_remit/create_txn.rb', line 29 def call ::BloomRemit::Txns::Operations::Create.(txn: { sender_id: sender.id, sender_type: sender.class.base_class.name, amount: amount, account_name: account_name, account_id: account_id, target_slug: target_slug, owner_id: owner.id, owner_type: owner.class.base_class.name, external_id: external_id, }) end |