@@ -14,9 +14,9 @@ class Intermex
1414 protected $ service_id ;
1515 protected $ operationMap = array (
1616 'create ' => 'altaEnvioT ' ,
17- 'modify ' => '' ,
18- 'update ' => '' ,
19- 'cancel ' => ''
17+ 'modify ' => 'processUpdate ' ,
18+ 'update ' => 'processUpdate ' ,
19+ 'cancel ' => 'anulaEnvio '
2020 );
2121
2222 public function __construct (ContainerInterface $ container )
@@ -472,9 +472,34 @@ public function confirmaCambio($iIdOrden=null)
472472 return $ arr ;
473473 }
474474
475+
475476 public function process ($ operation , $ args )
476477 {
477478 return call_user_func_array (array ($ this , $ this ->operationMap [$ operation ]), [$ args ]);
478479 }
479480
481+ /**
482+ * Used to map to specific update method according to
483+ * modified data
484+ *
485+ * @param Array $txn [fields must be('refNo','newData','reason for change')]
486+ * @return void
487+ */
488+ public function processUpdate ($ txn =null )
489+ {
490+ if (isset ($ txn ['receiver_first_name ' ]))
491+ {
492+ $ this ->cambiaBeneficiario ($ txn ['confirmation_number ' ],$ txn ['receiver_first_name ' ],$ txn ['reason ' ]);
493+ }
494+ if (isset ($ txn ['sender_first_name ' ]))
495+ {
496+ $ this ->cambiaRemitente ($ txn ['confirmation_number ' ],$ txn ['sender_first_name ' ],$ txn ['reason ' ]);
497+ }
498+ if (isset ($ txn ['sender_phone_mobile ' ]))
499+ {
500+ $ this ->cambiaTelBeneficiario ($ txn ['confirmation_number ' ],$ txn ['sender_phone_mobile ' ],$ txn ['reason ' ]);
501+ }
502+
503+ }
504+
480505}
0 commit comments