Add Paytm Payment Gateway to your mobile app or website. Collect online payments from your customers using UPI, Debit/Credit Cards, 50+ NetBanking options and Paytm Wallet.
PaytmIS A PAYMENT PROCESS SYSTEM, I WILL INTEGRATE Paytm WITH WEBSITES BY USING WITH PHP
Just follow below steps:
Step1: First, we need to create an account at https://business.paytm.com/ and get our merchant ID and Secret Key.
Now we can start coding in our site to use the Paytm. First, we will configure the Paytm with test credentials to test our code.
Step 2. (filename – config.php)
<?php /*
– Use PAYTM_ENVIRONMENT as ‘PROD’ if you wanted to do transaction in production environment else ‘TEST’ for doing transaction in testing environment. – Change the value of PAYTM_MERCHANT_KEY constant with details received from Paytm. – Change the value of PAYTM_MERCHANT_MID constant with details received from Paytm. – Change the value of PAYTM_MERCHANT_WEBSITE constant with details received from Paytm. – Above details will be different for testing and production environment.
*/ define(‘PAYTM_ENVIRONMENT’, ‘TEST’); // PROD define(‘PAYTM_MERCHANT_KEY’, ‘**********’); //Change this constant’s value with Merchant key downloaded from portal define(‘PAYTM_MERCHANT_MID’, ‘**********’); //Change this constant’s value with MID (Merchant ID) received from Paytm define(‘PAYTM_MERCHANT_WEBSITE’, ‘**********’); //Change this constant’s value with Website name received from Paytm
Step 4. Here in form, we have set the action=”Redirect.php”, so we will create a new file with this name –
<?php header(“Pragma: no-cache”); header(“Cache-Control: no-cache”); header(“Expires: 0”); // following files need to be included require_once(“./lib/config_paytm.php”); require_once(“./lib/encdec_paytm.php”);
SafexPay is the brand from PayGate having multiple payment solutions like white label payment gateways for banks and institutions and provides an all-inclusive payment gateway solution to merchants. SafexPay also provides Prepaid wallet platform , UPI solution, Recharge Solution, Offline Payments Like email, SMS and QR code based payments. Some of our unique product offerings are advanced Integration API for best success ratios, Dynamic Currency Conversion (DCC), Push Response Technology, Dynamic Switching, Retry options, Advanced Analytics, Recurring Payments, Multiple Currency Options, Omni-Channel Offering, E-Wallet & M-commerce etc. SafexPay aims to build digital payments businesses and platforms- Encompassing payment gateways, payment aggregation (through a PSP setup), mobile wallets , White-Label Solutions as well as to provide value added services in the payments domain to consumers, merchants, banks and financial institutions across the globe.
SAFEXPAYis a payment process system, I will integrate SAFEXPAY with websites by using with php
PayPal is a payment process system, we will integrate PayPal with websites by using with php.
PayPal integration classification system PayPal integration classification systemincludedfour files as shown below.
constants.php − This file has included API user name, password and signature.
CallerService.php − This file has included PayPal Services, thatis employed to decision PayPal services.
confirmation.php − This file has included a form with minimum fields requiredto make payment process and it’llcome back payment success or failure.
PayPal_entry.php − This page has used to send the user the info to PayPal. It acts as associate adapter between PayPal and user form.
The user has totransfer a PayPal SDK file from here and precisea zipper file. The zip file contains four php files, we do nothave to be compelled toamendment any file except constants.php
The constants.php file contains code as shown below −
<?php
define('API_USERNAME','YOUR USER NAME HERE');
define('API_PASSWORD','YOUR PASSWORD HERE');
define('API_SIGNATURE','YOUR API SIGNATURE HERE');
define('API_ENDPOINT','https://api-3t.paypal.com/nvp');
define('USE_PROXY',FALSE);
define('PROXY_HOST','127.0.0.1');
define('PROXY_PORT','808');
define('PAYPAL_URL','https://www.PayPal.com/webscr&cmd=_express-checkout&token=');
define('VERSION','53.0');?>
The user can declare User Name, password and signature in on top of syntax thatarea unit placed in constants.php. this can beAN experimental example therefore the last quantityaresupplementary to sandbox’s account.
PHP security is that theadditionalinvolved topic in internet application security, during this article, you’ll learn some techniques that you simplywill use in your applications to fix security problems and improve the security of PHP web applications.
1. Input Validation
All issuesbegin here If you’re not validating & sanitizing user submitted information through forms or URLs. If you strictly follow this step, then you’ll be able to overcome a great deal of issuestogether with your applications that’srelating to security.
First of all, Check whether or not the input submitted with the right method? that’s if the user input ought to be passed to computer address and if you’revictimisation request superglobal, Then that’sthe matter. as a result ofhacker willpretend the request with differentstyles oftechnique. Request superglobal works with all style ofinputs that’s post & get.
The simple answer is don’t use request superglobal, solely use get or post supported the request kind.
If the input technique is get and if you’re expecting solelyrange from the computer address as user input. Use PHP functions to validate the user submitted computer file, during thisexplicitscenarioyou’ll be able to use is_int PHP operate. to examinewhether or not the input is Associate in Nursingwhole number.
For validation, you’ll be able to use filter_var PHP operate with this operateyou’ll be able to validate the input and additionally sanitize the input. you have got to use the right filter supported your demand. For offered filters check the php.net web site.
2. XSS Cross-Site Scripting
Cross website Scripting in briefknown as XSS, the offender injects javascript code into our application, at the moment our application acts weirdly like redirecting to offender {site|website|web website} or causation user infoto attackers site.
Here we are going to see howeverwe are able to overcome XSS attacks by creatingeasy changes to our applications with these 2strategies. that’s filtering Input and Escaping Output
2.1 Filtering Input
While acceptive knowledge from web site users we must always filter. as an example in comment system, we must always settle for solely text input not hypertext markup language tags. If we have a tendency to aren’tfiltering the input, the user will submit any reasonably info even malicious code.
To filter unwanted code we are able to use these PHP functions, here I’m presenting you 3 PHP functions and their blessings.
strip_tags PHP operate removes hypertext markup language tags from the user submitted input.
filter_var : and therefore thesafermeans of filtering input is filter_var with filter_sanitize_string removes hypertext markup language tags even hypertext markup language syntax entered by the user is wrong.
regular expressions: If you have gota particulardemand, you’ll be able to build an everyday expression to filter user input.
2.2 Escaping Output
Escaping Output may be a technique wont tostop XSS. Suppose, let’s assume with on top of comment system you have got some comments within theinformationwhile not filtering input. which means these comments couldhave some hypertext markup language tags and even some comments could have malicious code. while notdeleting this knowledge from the information, we are able to fix this issue by escaping output with these PHP functions.
htmlspecialchars PHP operate encodes special characters into hypertext markup language entities and althoughyou would like to convert quote marks to hypertext markup language entities use it with ent_quotes.
htmlentities PHP operate converts all hypertext markup language character entities into hypertext markup language entities. You can convert the quote marks additionally with ent_quotes
The safermeans is to to use filter_var with filter filter_sanitize_full_special_chars to convert all hypertext markup language entities.
3. SQL Injection
SQL Injection is that themost important threat to any application that uses a information. you’ll be able to follow these techniques to beat SQL Injection.
Provide Minimum info to the user, don’t show SQL queries and rectifyinfo to the user. because itcould reveal table names and table structure to the attackers, so it makes straightforward for Associate in Nursingoffenderto try to to SQL Injection.
Validate the Input, undergo the step one. By following this you’ll be able to minimize the few problems.
Escape the output whereas inserting knowledge into the information. antecedentlywe’ve got seen escaping output whereas displaying comments within the browser. within the same means, we are able to escape the output whereas inserting the records within theinformation with the mysqli_real_escape_sting PHP operate.
Use ready statements with PHP PDO, it’s most secure techniqueto beat SQL Injection. you’ll be able to learn additionalregarding PDO ready Statements from PHP CRUD Application with PDO.
Least Privileged information User Account – produce a information user on your server with least privileges. Like if you’resolely displaying info in your application from informationproduce a information user with solelybrowseprivileges. perceive your application and buildAssociate in Nursing account supported the privileges.
4. positive identification Hashing
While storing Passwords of users, don’t store it in plain text positive identification. as a result of it’s exposing your user’s necessaryinfo to the offender, most of the users can use an equivalentpositive identification on differentwebsites. So that, your users area unit in nice danger.
Use secure positive identification hashing algorithmic rule, a Most secure positive identification hashing algorithmic rule is password_hash. Use positive identification_hash whereas generating password hash. to come up with the hash with password_hash PHP operate, use this below code.
Cross-Site Request Forgery is another spacewhereveryou would like to implement CSRF tokens to boostthe safety of kind submissions.
CSRF Tokens area unitwont to secure forms in PHP, we are going to generate a random token and this can be hold onwithin the session and this token are going to beresponded tothe shape. oncekind submission, CSRF token from the shapeand therefore the token hold on in session are going to be compared. If each these values match then solelykind submission can succeed. Otherwise, kind submission are going to befailing. The offenderwon’t be ready to succeed with his/her tries.
I’ve already created a whole article on Securing PHP Forms with CSRF Tokens.
6. Error Handling
While in production mode don’t show all the errors to users, follow least info principle.
I am an experienced PHP web developer and completed several web development projects successfully using WordPress , Woocommerce, Html5, CSS3, Bootstrap, JavaScript, JQuery, PHP, Codeigniter, and Mysqli.