<?php

error_reporting(E_ALL);
error_reporting(-1);
ini_set('error_reporting', E_ALL);

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: *');

require_once __DIR__ . '/../vendor/autoload.php';

use Openpay\Data\Openpay;

Openpay::setId('mleuoellwbejhbo7jxmt');
Openpay::setApiKey('sk_a73e463609cd4ecf9ec66c508e8fc0e9');
Openpay::setProductionMode(false);

class OpenpayAuth
{    public static function getOpenpayConexion()
    {
        try
        {
            $openpay = Openpay::getInstance(
                'mleuoellwbejhbo7jxmt',
                'sk_a73e463609cd4ecf9ec66c508e8fc0e9',
                'MX'
            );
            return $openpay;
        }
        catch (Exception $e)
        {
            // echo 'Caught exception: ',  $e->getMessage(), "\n";
            return false;
        }
    }
}