Sha256: 98db7317a3a19d1cffaf1c0af48b1190e069506e3908faf8c9658a7c82eec8ca
Contents?: true
Size: 1010 Bytes
Versions: 2
Compression:
Stored size: 1010 Bytes
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) required(:ledger_id).filled(:string) optional(:amount).maybe(:integer) optional(:currency).maybe(:string) optional(:customer).maybe(Types::Reference) 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ledger_sync-1.1.3 | lib/ledger_sync/adaptors/test/payment/operations/find.rb |
ledger_sync-1.1.2 | lib/ledger_sync/adaptors/test/payment/operations/find.rb |