Método
- Node.js
import { Malga } from 'malga'
const malga = new Malga({
apiKey: '8468a624-68c1-49a3-b9f1-a22455053a38',
clientId: 'ebb9c69c-4ad6-49fd-a565-a35cb4c967b3',
})
await malga.charges.refund(
'2f97378a-f174-4865-9d14-6ffc10fb34f0',
{ amount: 100 }
)
- Response
{
id: '2f97378a-f174-4865-9d14-6ffc10fb34f0',
clientId: 'ebb9c69c-4ad6-49fd-a565-a35cb4c967b3',
merchantId: '2ed73b94-175a-438d-ae73-d11902492b75',
description: null,
orderId: null,
providerReferenceKey: null,
createdAt: '2023-12-31T18:19:44.993Z',
amount: 0,
originalAmount: 100,
currency: 'BRL',
statementDescriptor: null,
capture: true,
isDispute: false,
status: 'voided',
paymentMethod: {
installments: 1,
paymentType: 'credit',
},
paymentSource: {
sourceType: 'card',
cardId: '5ee96a69-9ddf-4052-b454-f2421b547924',
},
transactionRequests: [
{
id: 'ff59d15e-5837-42c5-bc3c-d3988b0486c7',
createdAt: '2023-12-31T19:19:45.013Z',
updatedAt: '2023-12-31T19:19:45.044Z',
idempotencyKey: 'bd99414d-9fdc-4801-818e-7482085ab77e',
providerId: 'db46b9d6-daa1-4eae-ba90-15b6d3216a93',
providerType: 'SANDBOX',
transactionId: '12023934-42e4-4062-b4f3-f7218c694c15',
amount: 100,
authorizationCode: '123123',
authorizationNsu: '123123',
requestStatus: 'success',
requestType: 'void',
responseTs: '11ms',
providerAuthorization: {
networkAuthorizationCode: '123123',
networkResponseCode: '123123',
}
},
{
id: '25de917a-f977-4054-bed3-e94ed377896a',
createdAt: '2023-12-31T18:19:45.013Z',
updatedAt: '2023-12-31T18:19:45.044Z',
idempotencyKey: '86fde739-7506-48f6-a070-9eca62054415',
providerId: 'db46b9d6-daa1-4eae-ba90-15b6d3216a93',
providerType: 'SANDBOX',
transactionId: '12023934-42e4-4062-b4f3-f7218c694c15',
amount: 100,
authorizationCode: '123123',
authorizationNsu: '123123',
requestStatus: 'success',
requestType: 'authorization',
responseTs: '11ms',
providerAuthorization: {
networkAuthorizationCode: '123123',
networkResponseCode: '123123',
}
}
],
appInfo: null
}
Parâmetros
Lista de todos os parâmetros suportados pelo método.uuid
required
ID da cobrança