/**
  * Show payment details to customer when PDT is received.
  */
 public function actionPdt()
 {
     $pdt = new PPPdtAction($this, "pdt");
     // Just invoking a success event, processing done by IPN listener
     $pdt->onRequest = array($this, "pdtRequest");
     // Notify user about successfull payment
     $pdt->onSuccess = array($this, "pdtSuccess");
     // Notify user about failed payment
     $pdt->onFailure = array($this, "pdtFailure");
     $pdt->run();
 }
Пример #2
0
 /**
  * Show payment details to customer when PDT is received.
  */
 public function actionPdt()
 {
     $pdt = new PPPdtAction($this, "pdt");
     // Just invoking a success event, processing done by IPN listener
     $pdt->onRequest = function ($event) {
         $event->sender->onSuccess($event);
     };
     // Notify user about successfull payment
     $pdt->onSuccess = function ($event) {
         $str = "Success<br />";
         foreach ($event->details as $k => $v) {
             $str .= "{$k} => {$v}<br />";
         }
         $event->sender->controller->renderText($str);
     };
     // Notify user about failed payment
     $pdt->onFailure = function ($event) {
         $event->sender->controller->renderText("Failure");
     };
     $pdt->run();
 }