Class: ForestAdminDatasourceMambuPayments::Collections::PaymentCapture

Inherits:
BaseCollection
  • Object
show all
Defined in:
lib/forest_admin_datasource_mambu_payments/collections/payment_capture.rb

Constant Summary collapse

ManyToOneSchema =
ForestAdminDatasourceToolkit::Schema::Relations::ManyToOneSchema
ENUM_TYPE =
%w[charge chargeback refund].freeze
ENUM_SOURCE =
%w[api reporting_file].freeze
ENUM_RECONCILIATION_STATUS =
%w[unreconciled reconciled partially_reconciled].freeze

Constants inherited from BaseCollection

BaseCollection::BOOL_OPS, BaseCollection::ColumnSchema, BaseCollection::DATE_OPS, BaseCollection::ForestException, BaseCollection::ID_OPS, BaseCollection::Leaf, BaseCollection::NUMBER_OPS, BaseCollection::Operators, BaseCollection::STRING_OPS

Instance Method Summary collapse

Methods inherited from BaseCollection

#aggregate, client_resource, #fetch_by_ids, #list

Constructor Details

#initialize(datasource) ⇒ PaymentCapture

Returns a new instance of PaymentCapture.



13
14
15
16
17
18
# File 'lib/forest_admin_datasource_mambu_payments/collections/payment_capture.rb', line 13

def initialize(datasource)
  super(datasource, 'MambuPaymentCapture')
  define_schema
  define_relations
  reconcile_filter_operators!
end

Instance Method Details

#serialize(record) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/forest_admin_datasource_mambu_payments/collections/payment_capture.rb', line 20

def serialize(record)
  a = attrs_of(record)
  {
    'id' => a['id'],
    'object' => a['object'],
    'idempotency_key' => a['idempotency_key'],
    'connected_account_id' => a['connected_account_id'],
    'type' => a['type'],
    'source' => a['source'],
    'amount' => a['amount'],
    'original_payment_amount' => a['original_payment_amount'],
    'currency' => a['currency'],
    'date' => a['date'],
    'value_date' => a['value_date'],
    'remittance_date' => a['remittance_date'],
    'remittance_reference' => a['remittance_reference'],
    'transaction_reference' => a['transaction_reference'],
    'authorization_id' => a['authorization_id'],
    'payment_reference' => a['payment_reference'],
    'network' => a['network'],
    'merchant_id' => a['merchant_id'],
    'fee_amount' => a['fee_amount'],
    'fee_amount_currency' => a['fee_amount_currency'],
    'net_amount' => a['net_amount'],
    'net_amount_currency' => a['net_amount_currency'],
    'reconciliation_status' => a['reconciliation_status'],
    'reconciled_amount' => a['reconciled_amount'],
    'cbs_data' => a['cbs_data'],
    'lending' => a['lending'],
    'metadata' => a['metadata'],
    'canceled_at' => a['canceled_at'],
    'updated_at' => a['updated_at'],
    'created_at' => a['created_at']
  }
end