Skip to content

Commit

Permalink
feat: add validations and fix charge and order methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Tekton authored and Tekton committed Jan 23, 2024
1 parent 79e2946 commit fda30a0
Show file tree
Hide file tree
Showing 456 changed files with 76,634 additions and 6 deletions.
Binary file added .DS_Store
Binary file not shown.
5 changes: 2 additions & 3 deletions ajax/charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

try {
// Cargamos Requests y Culqi PHP
include_once dirname(__FILE__) . '/../libraries/Requests/library/Requests.php';
Requests::register_autoloader();
require '../vendor/autoload.php';
include_once dirname(__FILE__) . '/../vendor/culqi/culqi-php/lib/culqi.php';
include_once '../settings.php';

Expand Down Expand Up @@ -39,7 +38,7 @@
"antifraud_details" => array(
"address" => "Andres Reyes 338",
"address_city" => "Lima",
"country_code" => "PE",
"country_code" => "PEE",
"first_name" => "Roberto",
"last_name" => "Beretta",
"phone_number" => 123456789,
Expand Down
4 changes: 2 additions & 2 deletions ajax/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

try {
// Cargamos Requests y Culqi PHP
include_once dirname(__FILE__) . '/../libraries/Requests/library/Requests.php';
Requests::register_autoloader();
require '../vendor/autoload.php';
include_once dirname(__FILE__) . '/../vendor/culqi/culqi-php/lib/culqi.php';
include_once '../settings.php';

Expand Down Expand Up @@ -35,6 +34,7 @@
// Respuesta
echo json_encode($order);//return $order;
} catch (Exception $e) {
http_response_code(500);
error_log($e->getMessage());
echo $e->getMessage();
}
2 changes: 1 addition & 1 deletion js/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default Object.freeze({
'HiuTfpBl6HpD6+02SQIDAQAB'+
'-----END PUBLIC KEY-----',
COUNTRY_CODE: "PE",
URL_BASE: "http://localhost/culqi-php-demo-checkoutv4-culqi3ds",
URL_BASE: "http://php-demo.test/",
});

export const customerInfo = {
Expand Down
Binary file added vendor/.DS_Store
Binary file not shown.
25 changes: 25 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit003a15d9104c4dd3bddab6ddab808c9a::getLoader();
Loading

0 comments on commit fda30a0

Please sign in to comment.