File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed
actions/export-transactions Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ import paystack from "../../paystack.app.mjs" ;
2+
3+ export default {
4+ key : "paystack-export-transactions" ,
5+ name : "Export Transactions" ,
6+ description : "Export transactions from Paystack. See the documentation (https://paystack.com/docs/api/transaction/#export)" ,
7+ version : "0.0.1" ,
8+ type : "action" ,
9+ props : {
10+ paystack,
11+ from : {
12+ propDefinition : [
13+ paystack ,
14+ "from" ,
15+ ] ,
16+ optional : true ,
17+ } ,
18+ to : {
19+ propDefinition : [
20+ paystack ,
21+ "to" ,
22+ ] ,
23+ optional : true ,
24+ } ,
25+ status : {
26+ propDefinition : [
27+ paystack ,
28+ "status" ,
29+ ] ,
30+ optional : true ,
31+ } ,
32+ } ,
33+ async run ( { $ } ) {
34+ const params = {
35+ from : this . from ,
36+ to : this . to ,
37+ status : this . status ,
38+ } ;
39+
40+ const response = this . paystack . exportTransactions ( {
41+ $,
42+ params,
43+ } ) ;
44+
45+ $ . export ( "$summary" , `Successfully requested transaction export` ) ;
46+ return response ;
47+ } ,
48+ } ;
Original file line number Diff line number Diff line change @@ -240,6 +240,12 @@ export default {
240240 ...args ,
241241 } ) ;
242242 } ,
243+ exportTransactions ( args = { } ) {
244+ return this . _makeRequest ( {
245+ path : "/transaction/export" ,
246+ ...args ,
247+ } ) ;
248+ } ,
243249 async * paginate ( {
244250 resourceFn, args, max,
245251 } ) {
You can’t perform that action at this time.
0 commit comments