コード例 #1
0
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $postString);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);
$postResponse = curl_exec($request);
curl_close($request);
$response = explode('|', $postResponse);
if (!isset($response[7]) or !isset($response[3]) or !isset($response[9])) {
    Logger::addLog('Authorize.net returned a malformed response for cart ' . $response[7], 4);
    die('Authorize.net returned a malformed response, aborted.');
}
if ($response[0] == 3) {
    Tools::redirect('order.php?step=3&aimerror=1');
} else {
    /* Does the cart exist and is valid? */
    $cart = new Cart((int) $response[7]);
    if (!Validate::isLoadedObject($cart)) {
        Logger::addLog('Cart loading failed for cart ' . $response[7], 4);
        exit;
    }
    $customer = new Customer((int) $cart->id_customer);
    /* Loading the object */
    $authorizeaim = new authorizeaim();
    $message = $response[3];
    if ($response[0] == 1) {
        $authorizeaim->validateOrder((int) $cart->id, _PS_OS_PAYMENT_, (double) $response[9], $authorizeaim->displayName, $message);
    } else {
        $authorizeaim->validateOrder((int) $cart->id, _PS_OS_ERROR_, (double) $response[9], $authorizeaim->displayName, $message);
    }
    Tools::redirect('order-confirmation.php?id_module=' . (int) $authorizeaim->id . '&id_cart=' . (int) $cart->id . '&key=' . $customer->secure_key);
}
コード例 #2
0
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $postString);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);
$postResponse = curl_exec($request);
curl_close($request);
$response = explode('|', $postResponse);
if (!isset($response[7]) or !isset($response[3]) or !isset($response[9])) {
    Logger::addLog('Authorize.net returned a malformed response for cart ' . $response[7], 4);
    die('Authorize.net returned a malformed response, aborted.');
}
if ($response[0] == 3) {
    Tools::redirect('order.php?step=3&aimerror=1');
} else {
    /* Does the cart exist and is valid? */
    $cart = new Cart((int) $response[7]);
    if (!Validate::isLoadedObject($cart)) {
        Logger::addLog('Cart loading failed for cart ' . $response[7], 4);
        exit;
    }
    $customer = new Customer((int) $cart->id_customer);
    /* Loading the object */
    $authorizeaim = new authorizeaim();
    $message = $response[3];
    if ($response[0] == 1) {
        $authorizeaim->validateOrder((int) $cart->id, Configuration::get('PS_OS_PAYMENT'), (double) $response[9], $authorizeaim->displayName, $message, NULL, NULL, false, $customer->secure_key);
    } else {
        $authorizeaim->validateOrder((int) $cart->id, Configuration::get('PS_OS_ERROR'), (double) $response[9], $authorizeaim->displayName, $message, NULL, NULL, false, $customer->secure_key);
    }
    Tools::redirect('order-confirmation.php?id_module=' . (int) $authorizeaim->id . '&id_cart=' . (int) $cart->id . '&key=' . $customer->secure_key);
}
コード例 #3
0
curl_setopt($request, CURLOPT_HEADER, 0);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_POSTFIELDS, $postString);
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);
$postResponse = curl_exec($request);
curl_close($request);
$response = explode('|', $postResponse);
if (!isset($response[7]) or !isset($response[3]) or !isset($response[9])) {
    Logger::addLog('Authorize.net returned a malformed response for cart ' . $response[7], 4);
    die('Authorize.net returned a malformed response, aborted.');
}
if ($response[0] == 3) {
    Tools::redirect('order.php?step=3&aimerror=1');
} else {
    /* Does the cart exist and is valid? */
    $cart = new Cart((int) $response[7]);
    if (!Validate::isLoadedObject($cart)) {
        Logger::addLog('Cart loading failed for cart ' . $response[7], 4);
        exit;
    }
    $customer = new Customer((int) $cart->id_customer);
    /* Loading the object */
    $authorizeaim = new authorizeaim();
    $message = $response[3];
    if ($response[0] == 1) {
        $authorizeaim->validateOrder((int) $cart->id, _PS_OS_PAYMENT_, (double) $response[9], $authorizeaim->displayName, $message, NULL, NULL, false, $customer->secure_key);
    } else {
        $authorizeaim->validateOrder((int) $cart->id, _PS_OS_ERROR_, (double) $response[9], $authorizeaim->displayName, $message, NULL, NULL, false, $customer->secure_key);
    }
    Tools::redirect('order-confirmation.php?id_module=' . (int) $authorizeaim->id . '&id_cart=' . (int) $cart->id . '&key=' . $customer->secure_key);
}