예제 #1
0
 /**
  * @inheritDoc
  */
 public function addSpecialDataToOrder(array $data = [])
 {
     $data['pos_id'] = $this->dataGetter->getPosId();
     $data['pos_auth_key'] = $this->dataGetter->getPosAuthKey();
     $data['client_ip'] = $this->dataGetter->getClientIp();
     $data['ts'] = $this->dataGetter->getTs();
     $data['sig'] = $this->dataGetter->getSigForOrderCreate($data);
     return $data;
 }
예제 #2
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;
 }
예제 #3
0
 public function testTs()
 {
     $ts = 12345678;
     $this->dateTime->expects($this->once())->method('timestamp')->willReturn($ts);
     $this->assertEquals($ts, $this->model->getTs());
 }