Jump to content

Custom Payment Gateway


Recommended Posts

Hi Guys,

 

I'd like to create a "Pay Now" button in the invoice so when the client logins to their client area to view the invoice, they can manually click on the "Pay Now" button to make payment. These are the codes.

 

function anzegate_link($params) {

 

// Gateway URL

$vpcURL = "https://migs.mastercard.com.au/vpcdps";

 

// Varibales to pass to gateway

$vpc_Version = "1";

$vpc_Command = "pay";

$vpc_Merchant = $params['vpc_Merchant'];

$vpc_AccessCode = $params['vpc_AccessCode'];

$vpc_MerchTxnRef = $params['invoiceid']."/".date('ymdHis');

$vpc_OrderInfo = $params['invoiceid'];

$vpc_Amount = intval($params['amount']*100);

$vpc_CardNum = "5123456789012346";

$vpc_CardExp = "1305";

 

# Enter your code submit to the gateway...

 

$code = '

<form action="../VPC_PHP_2P_CSC.php" method="post">

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

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

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

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

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

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

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

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

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

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

<input type="submit" name="SubButL" value="Pay Now">

</form>

';

 

return $code;

}

 

As you can see that I've to hardcoded the credit card details for the time being as the function anzegate_link($params) doesn't automatically pick up the details as function anzegate_capture($params) does. Please advise. Thanks.

Link to comment
Share on other sites

Let me explain is a little more.

There are 2 types of whmcs gateways.

Invoice and Credit Cards.

 

Credit Card ones are ones that use the capture, and invoice ones use the link.

The idea is that the CC ones are run via the cron to do it all beind the users back. While the invoice ones are initiated via a user clicking ok.

 

The idea with the link ones is that they usually have to enter more data at the gateway (eg payapl info). I persoanlly think you should use the CC one in your case as you will be getting CC data from the DB.

 

Feel free to MSN me to pick my brain.

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