public function getPayUrl(array $bill, $successUrl)
    {
        // Preset required fields.
        $bill = array_replace(
            ['payUrl' => null],
            $bill
        );

        $payUrl = parse_url((string) $bill['payUrl']);
        if (true === array_key_exists('query', $payUrl)) {
            parse_str($payUrl['query'], $query);
            $query['successUrl'] = $successUrl;
        } else {
            $query = ['successUrl' => $successUrl];
        }

        $payUrl['query'] = http_build_query($query, '', '&', PHP_QUERY_RFC3986);

        return $this->buildUrl($payUrl);

    }
public function getPayUrl(array $bill, $successUrl)
    {
        // Preset required fields.
        $bill = array_replace(
            ['payUrl' => null],
            $bill
        );

        $payUrl = parse_url((string) $bill['payUrl']);
        if (true === array_key_exists('query', $payUrl)) {
            parse_str($payUrl['query'], $query);
            $query['successUrl'] = $successUrl;
        } else {
            $query = ['successUrl' => $successUrl];
        }

        $payUrl['query'] = http_build_query($query, '', '&', PHP_QUERY_RFC3986);

        return $this->buildUrl($payUrl);

    }
public function getPayUrl ( array $ bill , $ successUrl ) { // Preset required fields. $ bill = array_replace ( [ 'payUrl' => null ] , $ bill ) ; $ payUrl = parse_url ( ( string ) $ bill [ 'payUrl' ] ) ; if ( true === array_key_exists ( 'query' , $ payUrl ) ) { parse_str ( $ payUrl [ 'query' ] , $ query ) ; $ query [ 'successUrl' ] = $ successUrl ; } else { $ query = [ 'successUrl' => $ successUrl ] ; } $ payUrl [ 'query' ] = http_build_query ( $ query , '' , '&' , PHP_QUERY_RFC3986 ) ; return $ this -> buildUrl ( $ payUrl ) ; }
Get pay URL witch success URL param.

@param array  $bill       The bill data:
+ payUrl {string} Payment URL.
@param string $successUrl The success URL.

@return string
Get pay URL witch success URL param .