-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
795f9e7
commit 8f9b98b
Showing
8 changed files
with
231 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,34 +48,28 @@ Please follow the [installation procedure](#installation--usage) and then run th | |
<?php | ||
require_once(__DIR__ . '/vendor/autoload.php'); | ||
|
||
use Conekta\Api\CustomersApi; | ||
use Conekta\ApiException; | ||
use Conekta\Configuration; | ||
use Conekta\Model\Customer; | ||
|
||
// Configure authorization | ||
/** | ||
* @var string $apiKey use private key for authentication | ||
* @link https://developers.conekta.com/reference/autenticaci%C3%B3n for more information | ||
*/ | ||
$apiKey = getenv("CONEKTA_API_KEY"); | ||
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken($apiKey); | ||
|
||
$apiInstance = new CustomersApi(null, $config); | ||
$rq = new Customer([ | ||
'name' => 'Franklin carrero', | ||
'email'=> '[email protected]', | ||
'phone' => '+5218181818181' | ||
]); | ||
|
||
|
||
// Configure Bearer authorization: bearerAuth | ||
$config = Conekta\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); | ||
|
||
|
||
$apiInstance = new Conekta\Api\AntifraudApi( | ||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. | ||
// This is optional, `GuzzleHttp\Client` will be used as default. | ||
new GuzzleHttp\Client(), | ||
$config | ||
); | ||
$create_risk_rules_data = new \Conekta\Model\CreateRiskRulesData(); // \Conekta\Model\CreateRiskRulesData | requested field for blacklist rule | ||
$accept_language = es; // string | Use for knowing which language to use | ||
|
||
try { | ||
$result = $apiInstance->createCustomer($rq); | ||
$json_string = json_encode($result, JSON_PRETTY_PRINT); | ||
print_r($json_string); | ||
} catch (ApiException $e) { | ||
echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL; | ||
$result = $apiInstance->createRuleBlacklist($create_risk_rules_data, $accept_language); | ||
print_r($result); | ||
} catch (Exception $e) { | ||
echo 'Exception when calling AntifraudApi->createRuleBlacklist: ', $e->getMessage(), PHP_EOL; | ||
} | ||
|
||
|
||
``` | ||
|
||
## API Endpoints | ||
|
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
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
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
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
Oops, something went wrong.