-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out some specific events from the firehose events trigger so th…
…ey can be defined better and easier to use. payer-created payer-updated realtime-payment scheduled-process
- Loading branch information
Showing
9 changed files
with
263 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
id: "pyr_XXXXXXXXXXXXXX", | ||
firstName: "John", | ||
lastName: "Smith", | ||
emailAddress: "[email protected]", | ||
mobileNumber: null, | ||
streetAddress: null, | ||
suburb: null, | ||
postcode: null, | ||
state: null, | ||
country: null, | ||
companyName: null, | ||
metadata: "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const { BASE_URL } = require('../constants'); | ||
const samplePayer = require('../samples/sample_issue'); | ||
|
||
const perform = (z, bundle) => { | ||
const options = { | ||
url: `${BASE_URL}/${bundle.authData.environment}/events`, | ||
method: 'GET', | ||
headers: { }, | ||
params: { | ||
page: bundle.meta.page + 1, | ||
eventType: 'payer-created', | ||
}, | ||
}; | ||
|
||
return z.request(options).then((response) => { | ||
response.throwForStatus(); | ||
const results = response.data; | ||
return results.data; | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
operation: { | ||
perform: perform, | ||
canPaginate: true, | ||
inputFields: [], | ||
sample: { | ||
id: 'evt_XXXXXXXXXXXXXX', | ||
type: 'payer-created', | ||
eventDate: '2024-01-01T01:01:00Z', | ||
metadata: { payerName: "John Smith" }, | ||
data: { | ||
payer: samplePayer | ||
} | ||
}, | ||
outputFields: [ | ||
{ key: 'id', type: 'string' }, | ||
{ key: 'type', type: 'string' }, | ||
{ key: 'eventDate', type: 'datetime' }, | ||
{ key: 'metadata', dict: true }, | ||
{ key: 'data__payer__id', type: 'string' }, | ||
{ key: 'data__payer__firstName', type: 'string' }, | ||
{ key: 'data__payer__lastName', type: 'string' }, | ||
{ key: 'data__payer__emailAddress', type: 'string' }, | ||
{ key: 'data__payer__companyName', type: 'string' } | ||
], | ||
}, | ||
key: 'evt_payer_created', | ||
noun: 'Event', | ||
display: { | ||
label: 'Payer Created Event', | ||
description: 'Triggers when a Payer is created.' | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
const { BASE_URL } = require('../constants'); | ||
const samplePayer = require('../samples/sample_issue'); | ||
|
||
const perform = (z, bundle) => { | ||
const options = { | ||
url: `${BASE_URL}/${bundle.authData.environment}/events`, | ||
method: 'GET', | ||
headers: { }, | ||
params: { | ||
page: bundle.meta.page + 1, | ||
eventType: 'payer-updated', | ||
}, | ||
}; | ||
|
||
return z.request(options).then((response) => { | ||
response.throwForStatus(); | ||
const results = response.data; | ||
return results.data; | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
operation: { | ||
perform: perform, | ||
canPaginate: true, | ||
inputFields: [], | ||
sample: { | ||
id: 'evt_XXXXXXXXXXXXXX', | ||
type: 'payer-updated', | ||
eventDate: '2024-01-01T01:01:00Z', | ||
metadata: { payerName: "John Smith" }, | ||
data: { | ||
payer: samplePayer | ||
} | ||
}, | ||
outputFields: [ | ||
{ key: 'id', type: 'string' }, | ||
{ key: 'type', type: 'string' }, | ||
{ key: 'eventDate', type: 'datetime' }, | ||
{ key: 'metadata', dict: true }, | ||
{ key: 'data__payer__id', type: 'string' }, | ||
{ key: 'data__payer__firstName', type: 'string' }, | ||
{ key: 'data__payer__lastName', type: 'string' }, | ||
{ key: 'data__payer__emailAddress', type: 'string' }, | ||
{ key: 'data__payer__companyName', type: 'string' } | ||
], | ||
}, | ||
key: 'evt_payer_updated', | ||
noun: 'Event', | ||
display: { | ||
label: 'Payer Updated Event', | ||
description: 'Triggers when a Payer is updated.' | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const { BASE_URL } = require('../constants'); | ||
const { PaymentSample, eventSinglePaymentOutputFields } = require('../samples/sample_payment'); | ||
|
||
const perform = (z, bundle) => { | ||
const options = { | ||
url: `${BASE_URL}/${bundle.authData.environment}/events`, | ||
method: 'GET', | ||
headers: { }, | ||
params: { | ||
page: bundle.meta.page + 1, | ||
eventType: 'realtime-payment', | ||
}, | ||
}; | ||
|
||
return z.request(options).then((response) => { | ||
response.throwForStatus(); | ||
const results = response.data; | ||
return results.data; | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
operation: { | ||
perform: perform, | ||
canPaginate: true, | ||
inputFields: [], | ||
sample: { | ||
id: 'evt_XXXXXXXXXXXXXX', | ||
type: 'realtime-payment', | ||
eventDate: '2024-01-01T01:01:00Z', | ||
metadata: { | ||
status: "approved", | ||
amount: 1000 | ||
}, | ||
data: { | ||
payment: PaymentSample | ||
} | ||
}, | ||
outputFields: eventSinglePaymentOutputFields(), | ||
}, | ||
key: 'evt_realtime_payment', | ||
noun: 'Event', | ||
display: { | ||
label: 'Realtime Payment Event', | ||
description: 'Triggers when a realtime Payment occurs.' | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const { BASE_URL } = require('../constants'); | ||
const { paymentSample, eventProcessedPaymentsOutputFields } = require('../samples/sample_payment'); | ||
|
||
const perform = (z, bundle) => { | ||
const options = { | ||
url: `${BASE_URL}/${bundle.authData.environment}/events`, | ||
method: 'GET', | ||
headers: { }, | ||
params: { | ||
page: bundle.meta.page + 1, | ||
eventType: 'scheduled-process', | ||
}, | ||
}; | ||
|
||
return z.request(options).then((response) => { | ||
response.throwForStatus(); | ||
const results = response.data; | ||
return results.data; | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
operation: { | ||
perform: perform, | ||
canPaginate: true, | ||
inputFields: [], | ||
sample: { | ||
id: 'evt_XXXXXXXXXXXXXX', | ||
type: 'scheduled-process', | ||
eventDate: '2024-01-01T01:01:00Z', | ||
metadata: { | ||
status: "approved", | ||
amount: 1000 | ||
}, | ||
data: { | ||
payments: [ | ||
paymentSample | ||
] | ||
} | ||
}, | ||
outputFields: eventProcessedPaymentsOutputFields, | ||
}, | ||
key: 'evt_scheduled_process', | ||
noun: 'Event', | ||
display: { | ||
label: 'Scheduled Process Event', | ||
description: 'Triggers when a Scheduled Payments are processed.' | ||
}, | ||
}; |