Example #1
0
 /**
  * @inheritDoc
  */
 public function create($orderId = '', $description = '', $amount = null)
 {
     $realPayuplOrderId = $this->transactionResource->getExtOrderIdByPayuplOrderId($orderId);
     if ($realPayuplOrderId) {
         $posId = $this->orderDataGetter->getPosId();
         $ts = $this->orderDataGetter->getTs();
         $sig = $this->orderDataGetter->getSigForOrderRetrieve(['pos_id' => $posId, 'session_id' => $realPayuplOrderId, 'ts' => $ts]);
         $authData = ['posId' => $posId, 'sessionId' => $realPayuplOrderId, 'ts' => $ts, 'sig' => $sig];
         $getResult = $this->methodCaller->call('refundGet', [$authData]);
         if ($getResult) {
             $createResult = $this->methodCaller->call('refundAdd', [$authData, ['refundsHash' => $getResult->refsHash, 'amount' => $amount, 'desc' => $description, 'autoData' => true]]);
             if ($createResult < 0) {
                 $this->logger->error('Refund error ' . $createResult . ' for transaction ' . $orderId);
             }
             return $createResult === 0;
         }
     }
     return false;
 }
Example #2
0
 /**
  * @inheritDoc
  */
 public function getPaytypes()
 {
     return $this->methodCaller->call('getPaytypes');
 }