Jump to content

Módulo de lopago.com para WHMCS


lopagocom

Recommended Posts

Gente,

 

Les dejo el módulo de lopago.com para WHMCS para que puedan incorporarlo a su servicio de hosting dándole la posibilidad a sus clientes de pagar con diferentes medios de pago.

 

<?php

/**

* User: lopago.com

* Date: 10/02/12

* Time: 17:42

* Credits: Lopago.com & HV Grafica

* Based on: OportHost.com code

* Notes: Copiar este archivo en WHMCS_DOCUMENT_ROOT/modules/gateways/

*/

 

$GATEWAYMODULE["lopagocomname"] = "lopagocom";

$GATEWAYMODULE["lopagocomvisiblename"] = "Lopago.com";

$GATEWAYMODULE["lopagocomtype"] = "Invoices";

 

function lopagocom_activate()

{

defineGatewayField("lopagocom", "text", "account_id", "", "Tu cuenta de lopago.com", "", "Ej.: <strong>info@lopago.com</strong>");

defineGatewayField("lopagocom", "text", "item_currency", "", "Moneda", "1", "Pesos=ARS Dolares=USD");

defineGatewayField("lopagocom", "text", "success_url", "", "URL Exito", "", "Ej. http://www.dominio.com/exito.html");

defineGatewayField("lopagocom", "text", "error_url", " ", "URL Fracaso", "", "Ej. http://www.dominio.com/fracaso.html");

defineGatewayField("lopagocom", "yesno", "testmode", "", "Test Mode", "", "");

}

 

function lopagocom_link($params)

{

# Gateway Specific Variables

$gatewayaccount = $params['account_id'];

$gatewaycurrency = $params['item_currency'];

$gatewaysuccessurl = $params['success_url'];

$gatewayerrorurl = $params['error_url'];

$gatewaytestmode = $params['testmode'];

 

# Invoice Variables

$invoiceid = $params['invoiceid'];

$description = $params["description"];

$amount = $params['amount'];

$duedate = $params['duedate'];

 

# Client Variables

$firstname = $params['clientdetails']['firstname'];

$lastname = $params['clientdetails']['lastname'];

$email = $params['clientdetails']['email'];

$address1 = $params['clientdetails']['address1'];

$address2 = $params['clientdetails']['address2'];

$city = $params['clientdetails']['city'];

$state = $params['clientdetails']['state'];

$postcode = $params['clientdetails']['postcode'];

$country = $params['clientdetails']['country'];

$phone = $params['clientdetails']['phone'];

 

# System Variables

$companyname = $params['companyname'];

$systemurl = $params['systemurl'];

$currency = $params['currency'];

# End of Variables

 

$code = '

<form action="https://lopago.com/api" method="post">

<!-- Tu cuenta de lopago.com donde recibirás el dinero -->

<input type="hidden" name="account_id" value="' . $gatewayaccount . '" />

 

<!-- Producto que quieres cobrar -->

<input type="hidden" name="item_code" value="' . $invoiceid .'" />

<input type="hidden" name="item_name" value="Pago por FACTURA Nro. ' . $invoiceid . '" />

<input type="hidden" name="item_price" value="' . $amount .'" />

<input type="hidden" name="item_currency" value="' . $gatewaycurrency . '" />

<input type="hidden" name="success_url" value="' . $gatewaysuccessurl . '>

<input type="hidden" name="error_url" value="' . $gatewayerrorurl . '">

<input type="hidden" name="email" value="' . $email . '">

 

<!-- Botón de compra. También puede ser un <button> o <input type="submit"> -->

<input type="image" src="https://lopago.com/botones/comprar_ahora.gif" border="0" alt="Comprar Ahora">

</form>';

 

return $code;

}

 

?>

 

Les dejo el código también para que lo descarguen lopagocom.php.txt

 

Espero que les sirva y cualquier modificación y mejora que le puedan hacer al código bienvenida sea.

 

Les dejamos un saludo!

 

lopago.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated