I have a code and wanted to 'convert' to PagSeguro the Original is Paypal I will leave below the code:
if ($advert_sub == 'paypal') {
$a = array('cmd' => '_xclick',
'business' => SITE_PAYPAL_EMAIL,
'currency_code' => SITE_CURRENCY,
'item_name' => '[Campaign ID: ' . $cid . '] ' . $website_name,
'amount' => $subtotal,
'notify_url' => SITE_PAYPAL_CALLBACK_URL,
'tax_rate' => Utilities::getVAT($subtotal),
'custom' => serialize(array('cid'=>$cid)),
'image_url' => SITE_PAYPAL_CHECKOUT_LOGO,
'cpp_ headerback_ color' => '2687be',
'no_shipping' => '1',
'return' => SITE_LOCATION . '?done',
'cancel_return' => SITE_LOCATION . '?cancelled'
);
$u = 'https://www.paypal.com/cgi-bin/webscr?' . Utilities::arrayToURI($a);
System::redirect($u);
}
So I was trying to change the URL, the variables do not, or the button does not work or it does not appear, If you can help me, I thank you.
This is the payout checkout code:
<!-- Declaração do formulário -->
<form method="post" target="pagseguro"
action="https://pagseguro.uol.com.br/v2/checkout/payment.html">
<!-- Campos obrigatórios -->
<input name="receiverEmail" type="hidden" value="[email protected]">
<input name="currency" type="hidden" value="BRL">
<!-- Itens do pagamento (ao menos um item é obrigatório) -->
<input name="itemId1" type="hidden" value="0001">
<input name="itemDescription1" type="hidden" value="Notebook Prata">
<input name="itemAmount1" type="hidden" value="24300.00">
<input name="itemQuantity1" type="hidden" value="1">
<input name="itemWeight1" type="hidden" value="1000">
<input name="itemId2" type="hidden" value="0002">
<input name="itemDescription2" type="hidden" value="Notebook Rosa">
<input name="itemAmount2" type="hidden" value="25600.00">
<input name="itemQuantity2" type="hidden" value="2">
<input name="itemWeight2" type="hidden" value="750">
<!-- Código de referência do pagamento no seu sistema (opcional) -->
<input name="reference" type="hidden" value="REF1234">
<!-- Informações de frete (opcionais) -->
<input name="shippingType" type="hidden" value="1">
<input name="shippingAddressPostalCode" type="hidden" value="01452002">
<input name="shippingAddressStreet" type="hidden" value="Av. Brig. Faria Lima">
<input name="shippingAddressNumber" type="hidden" value="1384">
<input name="shippingAddressComplement" type="hidden" value="5o andar">
<input name="shippingAddressDistrict" type="hidden" value="Jardim Paulistano">
<input name="shippingAddressCity" type="hidden" value="Sao Paulo">
<input name="shippingAddressState" type="hidden" value="SP">
<input name="shippingAddressCountry" type="hidden" value="BRA">
<!-- Dados do comprador (opcionais) -->
<input name="senderName" type="hidden" value="José Comprador">
<input name="senderAreaCode" type="hidden" value="11">
<input name="senderPhone" type="hidden" value="56273440">
<input name="senderEmail" type="hidden" value="[email protected]">
<!-- submit do form (obrigatório) -->
<input alt="Pague com PagSeguro" name="submit" type="image"
src="https://p.simg.uol.com.br/out/pagseguro/i/botoes/pagamentos/120x53-pagar.gif"/>
</form>