33namespace Jinas \BMLConsole \Commands ;
44
55use Jinas \BMLConsole \Helpers \BML ;
6- use Symfony \Component \Console \Output \OutputInterface ;
7- use Symfony \Component \Console \Input \InputInterface ;
86use Symfony \Component \Console \Helper \QuestionHelper ;
9- use Symfony \Component \Console \Question \Question ;
107use Symfony \Component \Console \Helper \Table ;
8+ use Symfony \Component \Console \Input \InputInterface ;
9+ use Symfony \Component \Console \Output \OutputInterface ;
10+ use Symfony \Component \Console \Question \Question ;
1111
1212class Transfer
1313{
@@ -42,12 +42,12 @@ public function handle(BML $bml, OutputInterface $output, InputInterface $input)
4242 }));
4343
4444 $ bml ->transfer ([
45- " transfertype " => " IAT " ,
46- " channel " => " mobile " ,
47- " debitAmount " => $ amount ,
48- " currency " => " MVR " ,
49- " creditAccount " => $ account ,
50- " debitAccount " => $ bml ->guid
45+ ' transfertype ' => ' IAT ' ,
46+ ' channel ' => ' mobile ' ,
47+ ' debitAmount ' => $ amount ,
48+ ' currency ' => ' MVR ' ,
49+ ' creditAccount ' => $ account ,
50+ ' debitAccount ' => $ bml ->guid ,
5151 ]);
5252
5353 $ otp = $ question ->ask ($ input , $ output , (new Question ("<question>What is the Verification Code?</question> \n" ))
@@ -64,34 +64,33 @@ public function handle(BML $bml, OutputInterface $output, InputInterface $input)
6464 }));
6565
6666 $ invoice = $ bml ->transfer ([
67- " transfertype " => " IAT " ,
68- " channel " => " mobile " ,
69- " debitAmount " => $ amount ,
70- " currency " => " MVR " ,
71- " creditAccount " => $ account ,
72- " debitAccount " => $ bml ->guid ,
73- " otp " => $ otp
67+ ' transfertype ' => ' IAT ' ,
68+ ' channel ' => ' mobile ' ,
69+ ' debitAmount ' => $ amount ,
70+ ' currency ' => ' MVR ' ,
71+ ' creditAccount ' => $ account ,
72+ ' debitAccount ' => $ bml ->guid ,
73+ ' otp ' => $ otp,
7474 ]);
7575
76- if (!$ invoice ["success " ])
77- {
78- throw new \Exception ("whoops!. something went wrong. Transaction cannot be completed " );
76+ if (!$ invoice ['success ' ]) {
77+ throw new \Exception ('whoops!. something went wrong. Transaction cannot be completed ' );
7978 }
8079
8180 $ table = new Table ($ output );
82- $ table ->setHeaderTitle (" Invoice " );
81+ $ table ->setHeaderTitle (' Invoice ' );
8382 $ table ->setHeaders (['Status ' , 'Message ' , 'Ref # ' , 'Date ' , 'From ' , 'To ' , 'Ammount ' , 'Remarks ' ]);
8483
85- $ row [] = [
86- " SUCCESS " ,
87- " Transfer transaction is successful " ,
88- $ invoice [" payload " ][ " reference " ],
89- $ invoice [" payload " ][ " timestamp " ],
90- $ invoice [" payload " ][ " from " ][ " name " ],
91- $ invoice [" payload " ][ " to " ][ " account " ],
92- $ invoice [" payload " ][ " debitamount " ],
93- ""
94- ];
84+ $ row [] = [
85+ ' SUCCESS ' ,
86+ ' Transfer transaction is successful ' ,
87+ $ invoice [' payload ' ][ ' reference ' ],
88+ $ invoice [' payload ' ][ ' timestamp ' ],
89+ $ invoice [' payload ' ][ ' from ' ][ ' name ' ],
90+ $ invoice [' payload ' ][ ' to ' ][ ' account ' ],
91+ $ invoice [' payload ' ][ ' debitamount ' ],
92+ '' ,
93+ ];
9594
9695 $ table ->setRows ($ row );
9796 $ table ->render ();
0 commit comments