public static function getAuthorizationUri(array $scope, $redirect_uri, array $options = array())
    {
        // This does not use WePay::getDomain() because the user authentication
        // domain is different than the API call domain
        if (self::$production === null) {
            throw new RuntimeException('You must initialize the WePay SDK with WePay::useStaging() or WePay::useProduction()');
        }

        $domain = self::$production ? 'https://www.wepay.com' : 'https://stage.wepay.com';
        $uri = $domain . '/v2/oauth2/authorize?';
        $uri .= http_build_query(array(
            'client_id'    => self::$client_id,
            'redirect_uri' => $redirect_uri,
            'scope'        => implode(',', $scope),
            'state'        => empty($options['state'])        ? '' : $options['state'],
            'user_name'    => empty($options['user_name'])    ? '' : $options['user_name'],
            'user_email'   => empty($options['user_email'])   ? '' : $options['user_email'],
            'user_country' => empty($options['user_country']) ? '' : $options['user_country'],
        ), '', '&');

        return $uri;
    }
public static function getAuthorizationUri(array $scope, $redirect_uri, array $options = array())
    {
        // This does not use WePay::getDomain() because the user authentication
        // domain is different than the API call domain
        if (self::$production === null) {
            throw new RuntimeException('You must initialize the WePay SDK with WePay::useStaging() or WePay::useProduction()');
        }

        $domain = self::$production ? 'https://www.wepay.com' : 'https://stage.wepay.com';
        $uri = $domain . '/v2/oauth2/authorize?';
        $uri .= http_build_query(array(
            'client_id'    => self::$client_id,
            'redirect_uri' => $redirect_uri,
            'scope'        => implode(',', $scope),
            'state'        => empty($options['state'])        ? '' : $options['state'],
            'user_name'    => empty($options['user_name'])    ? '' : $options['user_name'],
            'user_email'   => empty($options['user_email'])   ? '' : $options['user_email'],
            'user_country' => empty($options['user_country']) ? '' : $options['user_country'],
        ), '', '&');

        return $uri;
    }
public static function getAuthorizationUri ( array $ scope , $ redirect_uri , array $ options = array ( ) ) { // This does not use WePay::getDomain() because the user authentication // domain is different than the API call domain if ( self :: $ production === null ) { throw new RuntimeException ( 'You must initialize the WePay SDK with WePay::useStaging() or WePay::useProduction()' ) ; } $ domain = self :: $ production ? 'https://www.wepay.com' : 'https://stage.wepay.com' ; $ uri = $ domain . '/v2/oauth2/authorize?' ; $ uri .= http_build_query ( array ( 'client_id' => self :: $ client_id , 'redirect_uri' => $ redirect_uri , 'scope' => implode ( ',' , $ scope ) , 'state' => empty ( $ options [ 'state' ] ) ? '' : $ options [ 'state' ] , 'user_name' => empty ( $ options [ 'user_name' ] ) ? '' : $ options [ 'user_name' ] , 'user_email' => empty ( $ options [ 'user_email' ] ) ? '' : $ options [ 'user_email' ] , 'user_country' => empty ( $ options [ 'user_country' ] ) ? '' : $ options [ 'user_country' ] , ) , '' , '&' ) ; return $ uri ; }
Generate URI used during oAuth authorization
Redirect your user to this URI where they can grant your application
permission to make API calls

@link https://www.wepay.com/developer/reference/oauth2

@param  array  $scope        List of scope fields for which your application wants access.
@param  string $redirect_uri Where user goes after logging in at WePay (domain must match application settings).
@param  array  $options      `user_name,user_email` which will be pre-filled on login form, state to be returned
in query string of redirect_uri. The default value is an empty array.
@return string URI to which you must redirect your user to grant access to your application
Generate URI used during oAuth authorization Redirect your user to this URI where they can grant your application permission to make API calls