Author: Adam Piotrowski (adam@wellcommerce.org)
Inheritance: extends WellCommerce\Bundle\DoctrineBundle\Entity\EntityInterface, extends WellCommerce\Bundle\CoreBundle\Entity\TimestampableInterface, extends WellCommerce\Bundle\OrderBundle\Entity\OrderAwareInterface
 public function createPaymentStateHistory(PaymentInterface $payment) : PaymentStateHistoryInterface
 {
     /** @var PaymentStateHistoryInterface $paymentStateHistory */
     $paymentStateHistory = $this->initResource();
     $paymentStateHistory->setState($payment->getState());
     $paymentStateHistory->setPayment($payment);
     $paymentStateHistory->setComment($payment->getComment());
     $this->createResource($paymentStateHistory, false);
     return $paymentStateHistory;
 }
 public function notifyPayment(PaymentInterface $payment)
 {
     $payment->setState(PaymentInterface::PAYMENT_STATE_PENDING);
 }
 /**
  * {@inheritdoc}
  */
 public function getCancelUrl(PaymentInterface $payment) : string
 {
     return $this->getRouterHelper()->generateUrl('front.paypal.cancel', ['token' => $payment->getToken()]);
 }
 private function createRedirectUrls(PaymentInterface $payment) : RedirectUrls
 {
     $redirectUrls = new RedirectUrls();
     $redirectUrls->setReturnUrl($this->routerHelper->generateUrl('front.payment.confirm', ['token' => $payment->getToken()]));
     $redirectUrls->setCancelUrl($this->routerHelper->generateUrl('front.payment.cancel', ['token' => $payment->getToken()]));
     return $redirectUrls;
 }