Jump to content
  • 0

Custom Payment Gateway Question


goldeniws

Question

can you help me i want maker my personel payment

Config form to get paid

<form action="http://test.pro/payment" method="POST">
<input type="hidden" name="merchant_account" value="merchant@email.com">
<input type="hidden" name="item_number" value="2">
<input type="hidden" name="item_name" value="iPhone 8 PLUS 64GB">
<input type="hidden" name="item_price" value="1100">
<input type="hidden" name="item_currency" value="USD">
<input type="hidden" name="return_success" value="http://yourwebsite.com/success.php">
<input type="hidden" name="return_fail" value="http://yourwebsite.com/fail.php">
<input type="hidden" name="return_cancel" value="http://yourwebsite.com/cancel.php">
<button type="submit">Pay</button>
</form>

Payment Verification (success.php)

 

<?php
$merchant_key = 'M63C0-5CC62-06EFB-505A3-11209'; // Enter here your merchant API Key

$merchant_account = $_POST['merchant_account'];
$item_number = $_POST['item_number'];
$item_name = $_POST['item_name'];
$item_price = $_POST['item_price'];
$item_currency = $_POST['item_currency'];
$txid = $_POST['txid']; // Transaction ID
$payment_time = $_POST['payment_time']; // Current time of payment
$payee_account = $_POST['payee_account']; // The account of payee
$verification_link = "http://test.pro/payment_status.php?merchant_key=$merchant_key&merchant_account=$merchant_account&txid=$txid";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$verification_link);
$results=curl_exec($ch);
curl_close($ch);
$results = json_decode($results);
if($results->status == "success") {
    //Payment is successful
    //Run your php code here
    echo 'Payment is successful.';
} else {
    echo 'Payment was failed.';
}
?>

this Integration Guide

how config with this Merchant Gateway Module

https://github.com/WHMCS/sample-merchant-gateway

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
Answer this question...

×   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