require_once 'pw/utils/bootstrap.php'; include 'provider.php'; // Fetch the authorization URL from the provider; this returns the // urlAuthorize option and generates and applies any necessary parameters // (e.g. state). $authorizationUrl = $provider->getAuthorizationUrl(); // Get the state generated for you and store it to the session. $_SESSION['oauth2state'] = urlencode($provider->getState()); if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ipAddresses = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $ip = trim(end($ipAddresses)); } else { $ip = $_SERVER['REMOTE_ADDR']; } $locator = new GeoLocator(); $country = $locator->locate($ip); /* Pulls list of payment system options available for this country via Payment Systems API */ try { $paymentSystems = new PaymentSystem(); $list = $paymentSystems->getPaymentSystemsFor($country); } catch (Exception $e) { exit($e->getMessage()); } ?> <html> <head> <meta charset="utf-8">