How to Set a Domain name for xampp server project like: example.com

If you want to give a domain name for your Xampp Project, YES! Here you Can do it easily… Just Follow the Below Steps-

Step-1:

Open Your XAMPP Folder, Where You Have Installed.

Then, Go to folder apache,

Then, Open Folder conf,

Then, Open Folder extra.

The Full Path is Like,

PATH::    C:\xampp\apache\conf\extra

Now, Open “httpd-vhosts.conf” in an Editor

FILE NAME:: httpd-vhosts.conf
open file named – httpd-vhosts.conf

Here, You can see the line of code, Like-


#Virtual Hosts
#
#Required modules: mod_log_config
#If you want to maintain multiple domains/hostnames on your
#machine you can setup VirtualHost containers for them. Most configurations
#use only name-based virtual hosts so the server doesn't need to worry about
#IP addresses. This is indicated by the asterisks in the directives below.
#
#Please see the documentation at

#for further details before you try to setup virtual hosts.
#
#You may use the command line option '-S' to verify your virtual host
configuration.
#Use name-based virtual hosting.

#NameVirtualHost *:80
#VirtualHost example:
#Almost any Apache directive may go into a VirtualHost container.
#The first VirtualHost section is used for all requests that do not
#match a ##ServerName or ##ServerAlias in any block.
#

##ServerAdmin [email protected]
##DocumentRoot "C:/xampp/htdocs/dummy-host.example.com"
##ServerName dummy-host.example.com
##ServerAlias www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common


##ServerAdmin [email protected]
##DocumentRoot "C:/xampp/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common


Here, at the End of file just add the below code. here example.com is your project domain name. You Can change it as you want..


ServerAdmin [email protected]
DocumentRoot "C:/xampp/htdocs/example.com"
ServerName example.com
ErrorLog "logs/example.com-error.log"
CustomLog "logs/example.com-access.log" common

Step-2:

Now, Open your C drive’s – Windows Folder,

Then, Open System32 Folder,

Then, Open drivers folder,

Then, Open etc folder,

Here, you can find many files. From here Open “hosts” file in an Editor.

PATH::    C:\Windows\System32\drivers\etc
FILE NAME:: hosts

The hosts file content look like – 

Copyright (c) 1993-2009 Microsoft Corp.
#This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names.
#Each entry should be kept on an individual line.
#The IP address should be placed in the first column followed by the corresponding host name.
#The IP address and the host name should be separated by at least one
space.
#Additionally, comments (such as these) may be inserted on individual
lines or following the machine name denoted by a '#' symbol.

#For example:
#102.54.94.97 rhino.acme.com # source server
#38.25.63.10 x.acme.com # x client host

#localhost name resolution is handled within DNS itself.
#127.0.0.1 localhost
#::1 localhost

# Newly Added Project Domain
127.0.0.1 example.com

Here, you can see newly added domain. It is the project domain which we have created in xammp folder in Step-1


127.0.0.1 example.com

Now, Restart your xampp,

Now you can access the project using the domain name.

Now , Just type your given domain name or example.com, the project fill will open.

Finally Done. 

PayTM Payment Gateway Integration – After Payment Response Data

#PayTM Payment Gateway Integration – After Payment Response Data

 

RESPONSE ATTRIBUTESTYpeDescription
MIDString(20)This is a unique identifier provided to every merchant by Paytm
TXNIDString(64)This is a unique Paytm transaction ID that is issued by Paytm for each transaction
ORDERIDString(50)Unique reference ID for a transaction which is generated by merchant and sent in the request
CUST_IDString(64)Unique reference ID for every customer which is generated by merchant and sent in request
BANKTXNIDStringThe transaction ID sent by the bank. In case of Paytm proprietary instruments too, there is unique reference number generated by Paytm’s system. In case the transaction does not reach the bank, this will be NULL or empty string. Primary reason for this is user dropping out of the payment flow before the transaction reaches to bank to servers
TXNAMOUNTString(10)Amount paid by customer in INR
CURRENCYString(3)Currency in which the transaction has taken place. Currently only “INR” is the supported currency of transaction
STATUSString(20)This contains the transaction status and has only three values: TXN_SUCCESS, TXN_FAILURE and PENDING
RESPCODEString(10)Codes refer to a particular reason of payment failure. List in this PDF
RESPMSGString(500)Description message is linked with each respcode. List in this PDF
TXNDATEDateTimeDate and Time of transaction in the format “yyyy-MM-dd HH:mm:ss.S”Example: “2015-11- 02 11:40:46.0”
GATEWAYNAMEString(15)Gateway used by Paytm to process the transactions. By paymodes, the details are provided below
Credit, debit cards UPI – Gateway used to process the transaction. For example, if HDFC gateway has been used to process SBI credit card transactions, the value will be HDFC
Net banking – Netbanking transactions are not routed via gateway. Hence issuing bank name is passed in this field
Paytm Wallet – Wallet
BANKNAMEString(500)Name of issuing bank of the payment instrument used by customer. By paymodes, the details are provided below
Credit, debit cards, net banking – Name of the issuing bank. Example in case customer uses SBI’s credit card, the value will be “SBI”
Paytm Wallet – Wallet
Note that in case of UPI – This parameter will be not be present in the response
PAYMENTMODEString(15)The payment mode used by customer for transaction
Credit card – CC
Debit card – DC
Net banking – NB
UPI – UPI
Paytm wallet – PPI
CHECKSUMHASHString(108) Security parameter to avoid tampering. Verified using server side checksum utility provided by Paytm. Utilities to generate checksumhash is available here
BIN_NUMBERString(6)Starting 6 digit of Credit Card/Debit Card which used in transaction.
For other modes, this field not provided in response
CARD_LAST_NUMSString(4)Last 4 digit of Credit Card/Debit Card which used in transaction.
For other modes, this field not provided in response

 

Paytm Payment Gateways Response Data, After Payment.

How do I Integrate Paytm Payment Gateway in Php

#How do I Integrate Paytm Payment Gateway in Php?

Collect online payments with Paytm Payment Gateway

paytm

Paytm Checkout for your website provides a secure,

PCI-compliant way to accept Debit/Credit card,

Net-Banking, UPI and Paytm wallet payments from your customers.

Parameters Are –

REQUEST ATTRIBUTES
MID

String(20) Mandatory

This is a unique identifier provided to every merchant by Paytm. MID is part of your account credentials and is different on staging and production environment. Your staging MID is available here and production MID will be available once your activation is complete
ORDER_ID

String(50) Mandatory

Unique reference ID for a transaction which is generated by merchant Special characters allowed in Order ID are: @, -, _, .
CUST_ID

String(64) Mandatory

Unique reference ID for every customer which is generated by merchant Special characters allowed in Cust_ID are @, ! ,_ ,$, .
TXN_AMOUNT

String(10) Mandatory

Amount in INR payable by customer. Should contain digits up to two decimal points. Only special character allowed is (“.”)
CHANNEL_ID

String(3) Mandatory

This parameter is used to control the theme of the payment page. Based on the channel passed, Paytm will render the layout suitable for that specific platform
For websites, the value is WEB
For Mobile websites/App, the value is WAP
WEBSITE

String(30) Mandatory

For staging environment: For staging environment: WEBSTAGING
For production environment: Will be available here once your activation is complete
CHECKSUMHASH

String(108) Mandatory

Signature to avoid tampering. Generated using server side checksum utility available here
MOBILE_NO

String(15) Optional

Customer’s mobile number. Passing this enables faster login for customer into his/her Paytm account. When the customer clicks on login, the mobile number comes pre-filled on our payment page
EMAIL

String(50) Optional

Customer’s email ID
INDUSTRY_TYPE_ID

String(20) Mandatory

For staging environment: “Retail”
For production environment: Will be available here once your activation is complete
CALLBACK_URL

String(255) Mandatory

On completion of transaction, Paytm payment gateway will send the response on this URL.. Sample URL is – https://merchant.com/callback/
PAYMENT_MODE_ONLY

String(3) Optional

If merchant wants to allow payment mode selection on his website or restrict the payment to a particular paymode, then value to be passed is “YES”.
For example, with this parameter merchant can ensure that customer only sees credit card as a paymode when he lands on Paytm’s cashier page.
AUTH_MODE

String(10) Conditional

Required If PAYMENT_MODE_ONLY = YES, then
For Credit/Debit card – 3D
For Wallet, Net Banking – USRPWD
PAYMENT_TYPE_ID

String(15) Conditional

Required If PAYMENT_MODE_ONLY = Yes, then
Credit card payment mode – CC
Debit card payment mode – DC
Net banking payment mode – NB
Paytm wallet – PPI
EMI – EMI
UPI – UPI
BANK_CODE

String(5) Conditional

Required If PAYMENT_MODE_ONLY = Yes PAYMENT_TYPE_ID = NB
List of Bank Codes provided in this PDF

Generate checksumhash using Paytm library with parameters in key value pairs. Using the payload and checksumhash make an HTML form post and redirect customer to Paytm server.

    require_once("encdec_paytm.php");
    define("merchantMid", "rxazcv89315285244163");
    // Key in your staging and production MID available in your dashboard

    define("merchantKey", "gKpu7IKaLSbkchFS");
    // Key in your staging and production merchant key available in your dashboard

    define("orderId", "order1");
    define("channelId", "WEB");
    define("custId", "cust123");
    define("mobileNo", "7777777777");
    define("email", "[email protected]");
    define("txnAmount", "100.12");
    define("website", "WEBSTAGING");
    // This is the staging value. Production value is available in your dashboard

    define("industryTypeId", "Retail");
    // This is the staging value. Production value is available in your dashboard

    define("callbackUrl", "https://<Merchant_Response_URL>");


    $paytmParams = array();
    $paytmParams["MID"] = merchantMid;
    $paytmParams["ORDER_ID"] = orderId;
    $paytmParams["CUST_ID"] = custId;
    $paytmParams["MOBILE_NO"] = mobileNo;
    $paytmParams["EMAIL"] = email;
    $paytmParams["CHANNEL_ID"] = channelId;
    $paytmParams["TXN_AMOUNT"] = txnAmount;
    $paytmParams["WEBSITE"] = website;
    $paytmParams["INDUSTRY_TYPE_ID"] = industryTypeId;
    $paytmParams["CALLBACK_URL"] = callbackUrl;
    $paytmChecksum = getChecksumFromArray($paytmParams, merchantKey);
    $transactionURL = "https://securegw-stage.paytm.in/theia/processTransaction";
    // $transactionURL = "https://securegw.paytm.in/theia/processTransaction"; // for production

The Html data as below..

<html>
    <head>
        <title>Merchant Checkout Page</title>
    </head>
    <body>
        <center><h1>Please do not refresh this page...</h1></center>
        <form method='post' action='<?php echo $transactionURL; ?>' name='f1'>
            <?php
                foreach($paytmParams as $name => $value) {
                    echo '<input type="hidden" name="' . $name .'" value="' . $value . '">';
                }
            ?>
            <input type="hidden" name="CHECKSUMHASH" value="<?php echo $paytmChecksum ?>">
        </form>
        <script type="text/javascript">
            document.f1.submit();
        </script>
    </body>
</html>

Endpoints: 
Staging: https://securegw-stage.paytm.in/theia/processTransaction
Production: https://securegw.paytm.in/theia/processTransaction

HTML Form POST Data::

<html>
    <head>
        <title>Merchant Check Out Page</title>
    </head>
    <body>
        <center><h1>Please do not refresh this page...</h1></center>

        <form method="post" action="https://securegw-stage.paytm.in/theia/processTransaction?ORDER_ID=order1" name="f1">
            <table border="1">
                <tbody>
                    <input type="hidden" name="MID" value="rxazcv89315285244163">

                    <input type="hidden" name="WEBSITE" value="WEBSTAGING">

                    <input type="hidden" name="ORDER_ID" value="order1">

                    <input type="hidden" name="CUST_ID" value="cust123">

                    <input type="hidden" name="MOBILE_NO" value="7777777777">

                    <input type="hidden" name="EMAIL" value="[email protected]">

                    <input type="hidden" name="INDUSTRY_TYPE_ID" value="Retail">

                    <input type="hidden" name="CHANNEL_ID" value="WEB">

                    <input type="hidden" name="TXN_AMOUNT" value="100.12">

                    <input type="hidden" name="CALLBACK_URL" value="https://Merchant_Response_URL>">

                    <input type="hidden" name="CHECKSUMHASH" value="ZWdMJOr1yGiFh1nns2U8sDC9VzgUDHVnQpG
                    pVnHyrrPb6bthwro1Z8AREUKdUR/K46x3XvFs6Xv7EnoSOLZT29qbZJKXXvyEuEWQIJGkw=">

                </tbody>
            </table>

        <script type="text/javascript">

            document.f1.submit();
        </script>

        </form>
    </body>
</html>

Response Parameters by PayTM:

RESPONSE ATTRIBUTESTypeDescription
MIDString(20)This is a unique identifier provided to every merchant by Paytm
TXNIDString(64)This is a unique Paytm transaction ID that is issued by Paytm for each transaction
ORDERIDString(50)Unique reference ID for a transaction which is generated by merchant and sent in the request
CUST_IDString(64)Unique reference ID for every customer which is generated by merchant and sent in request
BANKTXNIDStringThe transaction ID sent by the bank. In case of Paytm proprietary instruments too, there is unique reference number generated by Paytm’s system. In case the transaction does not reach the bank, this will be NULL or empty string. Primary reason for this is user dropping out of the payment flow before the transaction reaches to bank to servers
TXNAMOUNTString(10)Amount paid by customer in INR
CURRENCYString(3)Currency in which the transaction has taken place. Currently only “INR” is the supported currency of transaction
STATUSString(20)This contains the transaction status and has only three values: TXN_SUCCESS, TXN_FAILURE and PENDING
RESPCODEString(10)Codes refer to a particular reason of payment failure. List in this PDF
RESPMSGString(500)Description message is linked with each respcode. List in this PDF
TXNDATEDateTimeDate and Time of transaction in the format “yyyy-MM-dd HH:mm:ss.S”Example: “2015-11- 02 11:40:46.0”
GATEWAYNAMEString(15)Gateway used by Paytm to process the transactions. By paymodes, the details are provided below
Credit, debit cards UPI – Gateway used to process the transaction. For example, if HDFC gateway has been used to process SBI credit card transactions, the value will be HDFC
Net banking – Netbanking transactions are not routed via gateway. Hence issuing bank name is passed in this field
Paytm Wallet – Wallet
BANKNAMEString(500)Name of issuing bank of the payment instrument used by customer. By paymodes, the details are provided below
Credit, debit cards, net banking – Name of the issuing bank. Example in case customer uses SBI’s credit card, the value will be “SBI”
Paytm Wallet – Wallet
Note that in case of UPI – This parameter will be not be present in the response
PAYMENTMODEString(15)The payment mode used by customer for transaction
Credit card – CC
Debit card – DC
Net banking – NB
UPI – UPI
Paytm wallet – PPI
CHECKSUMHASHString(108)Security parameter to avoid tampering. Verified using server side checksum utility provided by Paytm. Utilities to generate checksumhash is available here
BIN_NUMBERString(6)Starting 6 digit of Credit Card/Debit Card which used in transaction.
For other modes, this field not provided in response
CARD_LAST_NUMSString(4)Last 4 digit of Credit Card/Debit Card which used in transaction.
For other modes, this field not provided in response

References:

https://developer.paytm.com/docs/v1/payment-gateway

Please enter a valid value. The two nearest valid values are 499.999 and 500.999

 

When Typeing and Click its Showing for Number Field as

“Please enter a valid value. The two nearest valid values are 499.999 and 500.999”

 

And the Data Not Saving?

 

Solution:

Here, You need to use step=”any” as an attribute when working with type=”number” input fields.

Like:

 

<form>
        <input step="any" type="number" name="price" maxlength="5" value="" />
</form>

EBS – Secure Hash Validation Failed

EBS provides the document for the posted data & other formats.

There, we have to pass that required Credentials. like secure hash.

 

//Pass your Registered Secret Key

$hashData = “Your Secret Key“;

$hash = “ebskey”.”|”.urlencode($_POST[‘account_id’]).”|”.urlencode($_POST[‘amount’]).”|”.urlencode($_POST[‘reference_no’]).”|”.$_POST[‘return_url’].”|”.urlencode($_POST[‘mode’]);

$secure_hash = md5($hash);

// now pass $secure_hash secure hash to ebs .

// now pass $secure_hash secure hash to ebs .

 

how to make secure hash to send in ebs payment gateway

Click here: Ebs Invalid Hash