コード例 #1
0
 public function HandleNotifyUrl($eShopId, $status, $ip, $rawPostStream = 'php://input')
 {
     $shop_id = static::DecryptShopId($eShopId);
     $notification = new SofortLibNotification();
     $success = $notification->getNotification(file_get_contents($rawPostStream));
     if ($success === false) {
         throw new SofortLibNotificationException($notification);
     }
     $transaction = $notification->getTransactionId();
     $time = $notification->getTime();
     App::uses('SofortComNotification', 'SofortCom.Model');
     $SofortComNotification = new SofortComNotification();
     $SofortComNotification->Add($transaction, $status, $time, $ip);
     $transactionData = new SofortLibTransactionData($this->Config['configkey']);
     $transactionData->addTransaction($transaction);
     $transactionData->sendRequest();
     $transactionData->setNumber(1);
     call_user_func_array(array($this->Controller, $this->Config['notifyCallback']), array($shop_id, $status, $transaction, $time, $transactionData));
 }
コード例 #2
0
 /**
  * @dataProvider setNumberProvider
  */
 public function testSetNumber($provided)
 {
     $SofortLibTransactionData = new SofortLibTransactionData(self::$configkey);
     $SofortLibTransactionData->setNumber($provided[0], $provided[1]);
     $received = $SofortLibTransactionData->getParameters();
     $this->assertEquals($provided, array($received['number'], $received['page']));
 }