satheesh
satheesh

Reputation: 27

Invalid md5 in mercadopago payment gateway?

I have a problem in mercedopago payment gateway. I am using following code for payment

<?php
 $data = array (
// Required
"item_title" => "item name",
"item_quantity" => "1",
"item_unit_price" => "1.00",
"item_currency_id" => "BsF", //Argentina: ARS, Brasil: BRL

// Optional
"item_id" => "CODE_012",
"item_description" => "item description",
"item_picture_url" => "item image",
"external_reference" => "BILL_001",
"payer_name" => "name",
"payer_surname" => "surname",
"payer_email" => "[email protected]",
"back_url_success" => "www.website.com?success",
"back_url_pending" => "www.website.com?pending");

$md5String = "client_id".                    
        "client_secret".                
        $data["item_quantity"].                 // item_quantity
        $data["item_currency_id"].              // item_currency_id
        $data["item_unit_price"].               // item_unit_price
        $data["item_id"].                       // item_id
        $data["external_reference"];            // external_reference
$md5 = md5($md5String);
?>

if i am using currency_code as ARS or BRL it works fine. But when i use BsF(venezuelan bolivar) it should not Run properly it shows as invalid md5 as follows,

Ops, algo deu errado invalid md5. Feche e tente novamente.

I also create the individual account for Venezuela. But it is not working. Payment form as follows

<form action="https://www.mercadopago.com/checkout/init" method="post" enctype="application/x-www-form-urlencoded" target="">

        <input type="hidden" name="client_id" value="client_id"/>

        <!-- Hash MD5 -->
        <input type="hidden" name="md5" value="<?php echo $md5 ?>"/>

        <!-- Required -->
        <input type="hidden" name="item_title" value="<?php echo $data["item_title"]?> "/>
        <input type="hidden" name="item_quantity" value="<?php echo $data["item_quantity"]?>"/>
        <input type="hidden" name="item_currency_id" value="<?php echo $data["item_currency_id"]?>"/>
        <input type="hidden" name="item_unit_price" value="<?php echo $data["item_unit_price"]?>"/>

        <!-- Optional -->
        <input type="hidden" name="item_id" value="<?php echo $data["item_id"]?>"/>
        <input type="hidden" name="external_reference" value="<?php echo $data["external_reference"]?>"/>
        <input type="hidden" name="item_picture_url" value="<?php echo $data["item_picture_url"]?>"/>
        <input type="hidden" name="payer_name" value="<?php echo $data["payer_name"]?>"/>
        <input type="hidden" name="payer_surname" value="<?php echo $data["payer_surname"]?>"/>
        <input type="hidden" name="payer_email" value="<?php echo $data["payer_email"]?>"/>
        <input type="hidden" name="back_url_success" value="<?php echo $data["back_url_success"]?>"/>
        <input type="hidden" name="back_url_pending" value="<?php echo $data["back_url_pending"]?>"/>

        <!-- Checkout Button -->
        <button type="submit" class="lightblue-rn-m-tr-arall" name="MP-Checkout">Pagar</button>
    </form>

The above form should used for payment. Please anyone help me how can i fix this problem.

Thanks in advance.

Upvotes: 0

Views: 1061

Answers (2)

German
German

Reputation: 794

Integration with md5 currently is not available in Venezuela. Is likely to be available from January.

I hope this helps.

Upvotes: 2

Patricio
Patricio

Reputation: 21

You have to edit the field:

<input type="hidden" name="client_id" value="client_id"/>

With your client_id

Upvotes: 2

Related Questions