Created
August 24, 2018 22:57
-
-
Save iDavidMorales/80d09c4849f3b4bb0f001cf9c00e9d24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
header('Access-Control-Allow-Origin: *'); | |
$token = $_POST['token_app']; | |
require_once("conekta-php/lib/Conekta.php"); | |
\Conekta\Conekta::setApiKey("key_XXXXXXXXXX"); | |
\Conekta\Conekta::setApiVersion("2.0.0"); | |
try{ | |
$customer = \Conekta\Customer::create( | |
array( | |
'name' => "XXXXXX", | |
'email' => "usuario@example.com", | |
'phone' => "+5215555555555", | |
//'plan_id' => "gold-plan", | |
'corporate' => true, | |
'antifraud_info' => array( | |
'account_created_at' => 1484040996, | |
'first_paid_at' => 1485151007 | |
), | |
'shipping_contacts' => array(array( | |
'phone' => "+5215555555555", | |
'receiver' => "Marvin Fuller", | |
'between_streets' => "Morelos Campeche", | |
'address' => array( | |
'street1' => "Nuevo Leon 4", | |
'street2' => "fake street", | |
'city' => "Ciudad de Mexico", | |
'state' => "Ciudad de Mexico", | |
'country' => "MX", | |
'postal_code' => "06100", | |
'residential' => true | |
) | |
)) | |
) | |
); | |
} catch (\Conekta\ProcessingError $error){ | |
echo $error->getMessage(); | |
} catch (\Conekta\ParameterValidationError $error){ | |
echo $error->getMessage(); | |
} catch (\Conekta\Handler $error){ | |
echo $error->getMessage(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment