Example #1
0
 /**
  * Executes payment via INLINE GoPay payment gate
  *
  * @param Payment $payment
  * @param string $channel
  * @param callable $callback
  * @return RedirectResponse
  * @throws InvalidArgumentException on undefined channel
  * @throws GopayFatalException on maldefined parameters
  * @throws GopayException on failed communication with WS
  */
 public function payInline(Payment $payment, $channel, $callback)
 {
     $paymentSessionId = $this->buildPayment($payment, $channel);
     $response = ["url" => GopayConfig::fullNewIntegrationURL() . '/' . $paymentSessionId, "signature" => $this->createSignature($paymentSessionId)];
     call_user_func_array($callback, [$paymentSessionId]);
     return $response;
 }
Example #2
0
 /**
  * Executes payment via INLINE GoPay payment gate
  *
  * @param  Payment
  * @param  string|null
  * @param  callback
  * @return RedirectResponse
  * @throws \InvalidArgumentException on undefined channel or provided ReturnedPayment
  * @throws GopayFatalException on maldefined parameters
  * @throws GopayException on failed communication with WS
  */
 public function payInline(Payment $payment, $channel, $callback)
 {
     $paymentSessionId = $this->createPaymentInternal($payment, $channel);
     $response = array("url" => GopayConfig::fullNewIntegrationURL() . '/' . $paymentSessionId, "signature" => $this->createSignature($paymentSessionId));
     Nette\Utils\Callback::invokeArgs($callback, array($paymentSessionId));
     return $response;
 }