YandexMoney\ExternalPayment::process PHP Method

process() public method

Requests an external payment.
See also: http://api.yandex.com/money/doc/dg/reference/request-external-payment.xml
See also: https://tech.yandex.ru/money/doc/dg/reference/request-external-payment-docpage/
public process ( array[] $payment_options ) : response
$payment_options array[] Key-value parameters collection
return response object
    public function process($payment_options)
    {
        $payment_options['instance_id'] = $this->instance_id;
        return self::sendRequest("/api/process-external-payment", $payment_options);
    }

Usage Example

コード例 #1
0
ファイル: PayService.php プロジェクト: mrsuh/fl-newspaper
 private function process(ExternalPayment $external_payment)
 {
     $process_options = array('request_id' => $this->request_id, 'instance_id' => $this->instance_id, 'ext_auth_success_uri' => $this->router->generate('subscribe_callback_success', [], Router::ABSOLUTE_URL), 'ext_auth_fail_uri' => $this->router->generate('subscribe_callback_fail', [], Router::ABSOLUTE_URL));
     $count = 0;
     do {
         $result = $external_payment->process($process_options);
         if ('in_progress' === $result->status) {
             sleep(1);
             $count++;
         }
     } while ('in_progress' === $result->status && $count < 10);
     if ('ext_auth_required' !== $result->status) {
         throw new \Exception();
     }
     return $result;
 }
All Usage Examples Of YandexMoney\ExternalPayment::process