Example #1
0
 /**
  * @param Response $response
  * @return OrderInterface
  */
 public function bankReturn(Response $response)
 {
     $this->status = $response->isSuccessful() ? 'paid' : 'error';
     $this->save();
     // log bank return
     $log = new Payment(['user_id' => $this->user_id, 'order_id' => $this->id, 'bank_code' => $response->getAdapter()->adapterTag, 'amount' => $this->due_amount, 'status' => $this->status, 'data_dump' => $response->__toString(), 'created' => new Expression('NOW()')]);
     $log->save();
     return $this;
 }