Skip to main content

Posts

Showing posts from February, 2016

Access modifier in php

Access modifier in php Restricting access to properties PUBLIC PRIVATE PROTECTED Those class properties and class methods which are set to be PUBLIC is accessed from any where in PHP script.I Access: Every where Those Class properties and class methods which are set to be PRIVATE can only be access with in the class.i.e Only the same class can access the property. Access: This class only Those class properties and class methods which are set to be PROTECTED can only be accessed in side a class and from its child class.i.e only the same class and classes derived from that class can access the property Access: This Class and sub class. public $height; protected $social_insurance; private $pin_number; $abc = new User(); /* Since $pin_number was declared private, this line of code will generate an error. Try it out! */ echo "Tell me private stuff: ".$abc->pin_number; /* Since $pin_number was declared protected, this line of code will genera

Authorize.net payment gateway integration

Authorize.net payment gateway integration Create login key and api key to check for realtime and for sandbox. You have to fill in the customers login key and transaction key either sandbox or live. Both are different. $LOGINKEY = 'XXXXXXXXX'; $TRANSKEY = 'XXXXXXXXX'; Store all the post values into respective variables by url encoding them. $firstName =urlencode( $_POST['firstname']); $lastName =urlencode($_POST['lastname']); $creditCardType =urlencode( $_POST['cardtype']); $creditCardNumber = urlencode($_POST['cardnumber']); $expMonth =urlencode( $_POST['cardmonth']);   $padMonth = str_pad($expMonth, 2, '0', STR_PAD_LEFT);     $expYear =urlencode( $_POST['cardyear']); $cvv2Number = urlencode($_POST['cardcvv']); $address1 = urlencode($_POST['address']); $city = urlencode($_POST['city']); $state =urlencode( $_POST['state']); $zip = urlencode($_POST['zip