Jump to content

How do I ad an other Payment Gateway than WHMCS offers?


johans

Recommended Posts

Perfect! This is exactly what I am looking for! I find it very difficult to make this work. I spent over 30 hours trying to configure this code (this is how it should look, I just have problems integrating it in the new whmcs module):

 

// Your payment gateway

$UseCC="Y"; // Set as Y if you will accept payments by your payment gateway. Blank it if you won't.

$ccrate="1.00"; // If the currency of this payment gateway different than your default currency when set the currency exchange rate. If the both is same when set it as 1.00.

$ccurl="https://www.certitrade.net/webshophtml/e/auth.php"; // The url of your payment gateway or form.

$order_number_field="orderid"; // The field name of order number value.

$total_field="amount"; // The field name of total fee value.

$recurring_total_field="recurrtotal"; // The field name of monthly recurring total fee value.

$other_fields="currency=752&lang=sv&retururl=http://yourwebsite.com/index.php?option=com_content&view=article&id=17&approveurl=http://yourwebsite.com/index.php?option=com_content&view=article&id=17&declineurl=http://yourwebsite.com/index.php?option=com_content&view=article&id=17&cancelurl=http://yourwebsite.com/index.php?option=com_content&view=article&id=17&merchantid=1111&md5code=abc123"; // Other field names that required together with their values (for example: cancel_url=http://www.yoursite.com/can.htm&return_url=http://www.yoursite.com/ok.htm)

Link to comment
Share on other sites

This is how the code looks like (thank you for the link m00):

 

<?php

 

function certitrade_config() {

$configarray = array(

"certitrade" => array("Type" => "System", "Value"=>"Certitrade"),

"username" => array("certitrade" => "Login ID", "Type" => "text", "Size" => "20", ),

"transmethod" => array("certitrade" => "Transaction Method", "Type" => "dropdown", "Options" => "Option1,Value2,Method3", ),

"instructions" => array("certitrade" => "Payment Instructions", "Type" => "textarea", "Rows" => "5", "Description" => "Do this then do that etc...", ),

"testmode" => array("Certitrade" => "Test Mode", "Type" => "yesno", "Description" => "Tick this to test", ),

);

return $configarray;

}

 

function certitrade_link($params) {

 

# Gateway Specific Variables

$gatewayusername = $params['username'];

$gatewaytestmode = $params['testmode'];

 

# Invoice Variables

$invoiceid = $params['invoiceid'];

$description = $params["description"];

$amount = $params['amount']; # Format: ##.##

$currency = $params['currency']; # Currency Code

 

# 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']['phonenumber'];

 

# System Variables

$companyname = $params['companyname'];

$systemurl = $params['systemurl'];

$currency = $params['currency'];

 

# Enter your code submit to the gateway...

 

$code = '<form method="http://www.domain.com/submit">

<input type="hidden" name="username" value="'.$gatewayusername.'" />

<input type="hidden" name="testmode" value="'.$gatewaytestmode.'" />

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

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

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

<input type="submit" value="Pay Now" />

</form>';

 

return $code;

 

}

 

?>

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