- <?php
- /*
- * @ https://EasyToYou.eu - IonCube v11 Decoder Online
- * @ PHP 7.2
- * @ Decoder version: 1.0.4
- * @ Release: 01/09/2021
- */
- require_once __DIR__ . "/../../../init.php";
- require_once __DIR__ . "/../../../includes/gatewayfunctions.php";
- require_once __DIR__ . "/../../../includes/invoicefunctions.php";
- require_once dirname(__FILE__) . "/TodoPago/lib/Sdk.php";
- $gatewayModuleName = "todopago";
- $gatewayParams = getGatewayVariables($gatewayModuleName);
- $clave = explode(" ", $gatewayParams["authKey"]);
- define("ENVMODE", "prod");
- define("MERCHANT", $gatewayParams["merchantId"] + 0);
- define("AUTHORIZATION", $gatewayParams["authKey"]);
- define("SECURITY", $clave[1]);
- define("URL_OK", $gatewayParams["systemurl"] . "modules/gateways/callback/todopago.php");
- define("URL_ERROR", $gatewayParams["systemurl"] . "modules/gateways/callback/todopago.php");
- define("ENCODINGMETHOD", "XML");
- define("PRODUCTCODE", "service");
- define("CURRENCYCODE", 26);
- $csbtCity = filter_input(INPUT_POST, "CSBTCITY");
- $csbtCountry = filter_input(INPUT_POST, "CSBTCOUNTRY");
- $csbtCustomerId = filter_input(INPUT_POST, "CSBTCUSTOMERID");
- $csbtIpAddress = filter_input(INPUT_POST, "CSBTIPADDRESS");
- $csbtEmail = filter_input(INPUT_POST, "CSBTEMAIL");
- $csbtFirstName = filter_input(INPUT_POST, "CSBTFIRSTNAME");
- $csbtLastName = filter_input(INPUT_POST, "CSBTLASTNAME");
- $csbtPhoneNumber = filter_input(INPUT_POST, "CSBTPHONENUMBER");
- $csbtPostalCode = filter_input(INPUT_POST, "CSBTPOSTALCODE");
- $csbtState = filter_input(INPUT_POST, "CSBTSTATE");
- $csbtStreet1 = filter_input(INPUT_POST, "CSBTSTREET1");
- $csptCurrency = filter_input(INPUT_POST, "CSPTCURRENCY");
- $csptGrandTotalAmount = filter_input(INPUT_POST, "CSPTGRANDTOTALAMOUNT");
- $csmdd8 = filter_input(INPUT_POST, "CSMDD8");
- $csstCity = filter_input(INPUT_POST, "CSSTCITY");
- $csstCountry = filter_input(INPUT_POST, "CSSTCOUNTRY");
- $csstEmail = filter_input(INPUT_POST, "CSSTEMAIL");
- $csstFirstName = filter_input(INPUT_POST, "CSSTFIRSTNAME");
- $csstLastName = filter_input(INPUT_POST, "CSSTLASTNAME");
- $csstPhoneNumber = filter_input(INPUT_POST, "CSSTPHONENUMBER");
- $csstPostalCode = filter_input(INPUT_POST, "CSSTPOSTALCODE");
- $csstState = filter_input(INPUT_POST, "CSSTSTATE");
- $csstStreet1 = filter_input(INPUT_POST, "CSSTSTREET1");
- $csitProductSKU = filter_input(INPUT_POST, "CSITPRODUCTSKU");
- $csitProductDescription = filter_input(INPUT_POST, "CSITPRODUCTDESCRIPTION");
- $csitProductName = filter_input(INPUT_POST, "CSITPRODUCTNAME");
- $csitQuantity = filter_input(INPUT_POST, "CSITQUANTITY");
- $csitUnitPrice = filter_input(INPUT_POST, "CSITUNITPRICE");
- $csitTotalAmount = number_format($csitUnitPrice * $csitQuantity, 2, ".", "");
- $http_header = ["Authorization" => AUTHORIZATION, "user_agent" => "PHPSoapClient"];
- $operationId = date("dmY") . $csbtCustomerId . $csitProductSKU;
- $optionsSAR_comercio = ["Security" => SECURITY, "EncodingMethod" => ENCODINGMETHOD, "Merchant" => MERCHANT, "URL_OK" => URL_OK . "?operationid=" . $operationId . "&invoiceid=" . $csitProductSKU, "URL_ERROR" => URL_ERROR . "?operationid=" . $operationId . "&invoiceid=" . $csitProductSKU];
- $postfields["CSBTCITY"] = urldecode($csbtCity);
- $postfields["CSBTCOUNTRY"] = urldecode($csbtCountry);
- $postfields["CSBTCUSTOMERID"] = urldecode($csbtCustomerId);
- $postfields["CSBTIPADDRESS"] = urldecode($csbtIpAddress);
- $postfields["CSBTEMAIL"] = urldecode($csbtEmail);
- $postfields["CSBTFIRSTNAME"] = urldecode($csbtFirstName);
- $postfields["CSBTLASTNAME"] = urldecode($csbtLastName);
- $postfields["CSBTPHONENUMBER"] = urldecode($csbtPhoneNumber);
- $postfields["CSBTPOSTALCODE"] = urldecode($csbtPostalCode);
- $postfields["CSBTSTATE"] = urldecode($csbtState);
- $postfields["CSBTSTREET1"] = urldecode($csbtStreet1);
- $postfields["CSSTCITY"] = urldecode($csstCity);
- $postfields["CSSTCOUNTRY"] = urldecode($csstCountry);
- $postfields["CSSTEMAIL"] = urldecode($csstEmail);
- $postfields["CSSTFIRSTNAME"] = urldecode($csstFirstName);
- $postfields["CSSTLASTNAME"] = urldecode($csstLastName);
- $postfields["CSSTPHONENUMBER"] = urldecode($csstPhoneNumber);
- $postfields["CSSTPOSTALCODE"] = urldecode($csstPostalCode);
- $postfields["CSSTSTATE"] = urldecode($csstState);
- $postfields["CSSTSTREET1"] = urldecode($csstStreet1);
- $postfields["CSPTCURRENCY"] = urldecode($csptCurrency);
- $postfields["CSPTGRANDTOTALAMOUNT"] = number_format($csptGrandTotalAmount, 2, ".", "");
- $postfields["CSMDD8"] = urldecode($csmdd8);
- $postfields["CSITPRODUCTSKU"] = urldecode($csitProductSKU);
- $postfields["CSITPRODUCTDESCRIPTION"] = urldecode($csitProductDescription);
- $postfields["CSITPRODUCTNAME"] = urldecode($csitProductName);
- $postfields["CSITQUANTITY"] = urldecode($csitQuantity);
- $postfields["CSITUNITPRICE"] = number_format($csitUnitPrice, 2, ".", "");
- $postfields["CSITTOTALAMOUNT"] = number_format($csitTotalAmount, 2, ".", "");
- $postfields["CSITPRODUCTCODE"] = PRODUCTCODE;
- $optionsSAR_operacion = $postfields;
- $optionsSAR_operacion["MERCHANT"] = MERCHANT;
- $optionsSAR_operacion["OPERATIONID"] = $operationId;
- $optionsSAR_operacion["CURRENCYCODE"] = CURRENCYCODE;
- $optionsSAR_operacion["AMOUNT"] = number_format($csptGrandTotalAmount, 2, ".", "");
- $optionsSAR_operacion["EMAILCLIENTE"] = urldecode($csbtEmail);
- $connector = new TodoPago\Sdk($http_header, ENVMODE);
- $rta = $connector->sendAuthorizeRequest($optionsSAR_comercio, $optionsSAR_operacion);
- if ($rta["StatusCode"] != -1) {
- var_dump($rta);
- } else {
- setcookie("RequestKey", $rta["RequestKey"], time() + 2592000, "/");
- echo "<script language=Javascript> location.href=\"" . $rta["URL_Request"] . "\"; </script>";
- exit;
- }
- ?>