Markette\Gopay\Service\PaymentService::payInline PHP 메소드

payInline() 공개 메소드

Executes payment via INLINE GoPay payment gate
public payInline ( Markette\Gopay\Entity\Payment $payment, string $channel, callable $callback ) : array
$payment Markette\Gopay\Entity\Payment
$channel string
$callback callable
리턴 array
    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;
    }

Usage Example

예제 #1
0
 /**
  * Creates and send payment request to GoPay
  *
  * @param int $id
  * @param string $channel
  */
 public function actionPayInline($id, $channel)
 {
     // same as above
     // here we communicate with Gopay Web Service (via soap)
     $response = $this->paymentService->payInline($payment, $channel, $storePaymentId);
     // redirect to Gopay Payment Gate
     $this->sendJson(['url' => $response['url'], 'signature' => $response['signature']]);
 }