Example #1
0
 /**
  * Extract Intent Id from post-sale orderId
  *
  * @param  Response                        $response
  * @return integer                         the intent Id
  * @throws CannotDetermineOrderIdException If post-sale orderId does not match expected format
  */
 protected function getIntentId(Response $response)
 {
     $orderId = $response->getOrderId();
     $prefix = $this->prefix;
     if (strpos($orderId, $prefix . '-') === 0) {
         return (int) str_replace($prefix . '-', '', $orderId);
     }
     throw new CannotDetermineOrderIdException();
 }