You are on page 1of 2

const transactionSchema = Joi.object().

keys({

transaction_id: Joi.string().required().uuidv4().description('The unique


identifier of the transaction'),

third_party_transaction_id: Joi.string().required().description('The local


entity unique identifier of transaction (coelsa id_debin)'),

datetime_transaction: Joi.string().isoDate().required().description(''),

terminal_code: Joi.string().description('The terminal code used in the


transaction. (dynamic only)'),

qr_code: Joi.object().required().keys({
qr_code_id: Joi.string().required().uuidv4().description('The unique
identifier of the qr_code created in PNMS'),
qr_code_emv: Joi.string().required().description('The qr code emv string
generated that started the instant payment'),
qr_code_type: Joi.string().required().description('The type of the qr_code
created, can be static or dynamic'),
}),

amount: Joi.object().required().keys({
merchant_discount_rate: Joi.number().positive().required().description('The
merchant discount rate applied to the transaction'),
merchant_discount_amount:
Joi.number().positive().required().description('The total amount discounted of the
transaction using the MDR'),
net_amount: Joi.number().positive().required().description('The net value
of the transaction after the discount of the MDR amount'),
gross_amount: Joi.number().positive().required().description('The gross
value of the transaction (total value)'),
currency_code: Joi.string().required().description('The currency code of
the transaction represented in ISO 4217 (BRL, USD, ARS...)'),
}),

customer: Joi.object().required().keys({
legal_document_number: Joi.string().required().description('The legal
document number of the customer paying the transaction'),
instant_payment_key: Joi.string().required().description('The instant
payment key of the customer paying the transaction (CVU of customer for
argentina)'),
}),

seller: Joi.object().required().keys({
seller_id: Joi.string().required().uuidv4().description('The unique
identifier of the seller'),
seller_code: Joi.string().required().max(15).description('The unique code
generate for the seller'),
}),

merchant: Joi.object().required().keys({
legal_document_number: Joi.string().required().description('The legal
document number of the seller receiving the payment'),
}),

account: Joi.object().required().keys({
instant_payment_key: Joi.string().required().description('The instant
payment key that identifies the seller in the payment system (CVU for merchant of
argentina)'),
}),

situation: Joi.object().required().keys({
status: Joi.string().required().values('created', 'authorized', 'rejected',
'acknowledge', 'reverted', 'settled', 'settled_failed').description('The current
status of the transaction'),
status_update_date: Joi.string().isoDate().required().description('The date
that the status changed the last time'),
}),

tenant: Joi.string().required().description('The tenant of the transaction'),


country: Joi.string().required().description('The country of the transaction'),

})

You might also like