Sha256: eecfab2b10ee987bef30e9114fdec95444c5facf079007c9e40fd8774602098e
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
module LedgerSync module Adaptors module Test module Payment module Operations class Find < Operation::Find class Contract < LedgerSync::Adaptors::Contract schema do required(:external_id).maybe(:string) optional(:account).hash(Types::Reference) optional(:amount).maybe(:integer) optional(:currency).maybe(:string) optional(:customer).hash(Types::Reference) optional(:deposit_account).hash(Types::Reference) optional(:exchange_rate).maybe(:float) required(:ledger_id).filled(:string) optional(:line_items).array(Types::Reference) optional(:memo).maybe(:string) optional(:reference_number).maybe(:string) optional(:transaction_date).maybe(:date?) end end private def operate return failure(nil) if resource.ledger_id.nil? response = adaptor.find( resource: 'payment', id: resource.ledger_id ) success( resource: Test::LedgerSerializer.new(resource: resource).deserialize(hash: response), response: response ) end end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ledger_sync-1.3.1 | lib/ledger_sync/adaptors/test/payment/operations/find.rb |