ionos

Monday, December 30, 2013

Input type validation using Regular Expression

Three letter country code validation

input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code"

Email address validation

^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$

Date validation[yyyy-mm-dd]

^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$
Regular Expression Description
[abc] Any character between the brackets
[^abc] Any character not between the brackets
[0-9] Any digit between the brackets
[^0-9] Any digit not between the brackets
(x|y) Any of the alternatives specified
[a-z] Any character from lowercase a to z
[A-Z] Any character from lowercase A to Z
[^a-zA-Z] Any string not containing any of the characters ranging from a-z and A-Z.
^.{2}$ It matches any string containing exactly two characters.

Change body background image using javascript

Put the java script between head tag.Create a folder "images" and keep all the images in that folder

HTML Code

img id="imgRotator" src="" alt="" height="470" width="600"/

Start Script

script type="text/javascript"
var picPaths = ['images/pic1.jpg','images/pic2.jpg','images/pic3.jpg','images/pic4.jpg'];
var oPics = [];
for(i=0; i < picPaths.length; i++){
oPics[i] = new Image();
oPics[i].src = picPaths[i];
}
curPic = Math.floor(Math.random()*oPics.length);
window.onload=function(){
document.getElementById('imgRotator').src = oPics[curPic].src;
}

End script


Saturday, December 21, 2013

Moneybookers Payment Gateway integration in php


Moneybookers Payment Gateway.

Moneybookers provide an easily customizable payment gateway that can be implemented without much headache.
You just need to create two accounts on Moneybookers
  • Merchant
  • Buyer.
Send a request to Moneybookers to convert these accounts into test accounts (for testing purpose). This is a manual process as Moneybookers provide no sandbox account like PayPal. After your account has been approved as test account, you can use it for transactions in your website. Moneybookers payment gateway integration code:

***Change merchant email,status URL,amount,currency & description fields as per your requirements

******Start HTML form
form action="https://www.moneybookers.com/app/payment.pl" method="post"
input type="hidden" name="pay_to_email" value="merchant-email@example.com"/
input type="hidden" name="status_url" value="http://example.com/success.php"/
input type="hidden" name="language" value="EN"/
input type="hidden" name="amount" value="Total amount (e.g. 120.0)"/
input type="hidden" name="currency" value="Currency code (e.g. USD)"/
input type="hidden" name="detail1_description" value="Your description"/
input type="hidden" name="detail1_text" value="License"/
input type="submit" value="Pay Via Moneybookers!"/
End of the ******form

Thursday, December 19, 2013

Payza integration


Payza's Advanced Button in HTML

Using simple HTML, you can integrate easily with Payza.Generate buttons and manage payment details from your Payza account with Standard Integration. No advanced technical knowledge needed. Create one-time or recurring payment buttons by customizing your buttons using Advanced Integration


form method="post" action="https://secure.payza.com/checkout"
input type="hidden" name="ap_merchant" value="apdevforum@gmail.com"/
input type="hidden" name="ap_purchasetype" value="item-goods"
input type="hidden" name="ap_itemname" value="MP3 Player"
input type="hidden" name="ap_amount" value="50"
input type="hidden" name="ap_currency" value="USD"
input type="hidden" name="ap_quantity" value="1"
input type="hidden" name="ap_itemcode" value="XYZ123"
input type="hidden" name="ap_description" value="Lorem ipsum."
input type="hidden" name="ap_returnurl" value="http://www.example.com/thankyou.html"
input type="hidden" name="ap_cancelurl" value="http://www.example.com/cancel.html"
input type="hidden" name="ap_taxamount" value="2.49"
input type="hidden" name="ap_additionalcharges" value="1.19"
input type="hidden" name="ap_shippingcharges" value="7.99"
input type="hidden" name="ap_discountamount" value="4.99"
input type="hidden" name="apc_1" value="Blue"
input type="image" src="https://www.payza.com/images/payza-buy-now.png"
/form>

How to integrate Payza in wordpress?

Easy integration of Payza payments / AlertPay payments to your WordPres Website. You can configure all options on WP Admin interface.

Installation:

Unzip the plugin and copy the payza-payments folder to your wp-content/plugins folder or install from wordpress.org repository and activate the plugin.

Setting up the plugin

  • install the plugin in your WordPress Website
  • sign-up for a Payza account and verify it
  • enter API data on the plugin configuration page
  • set IPN URL in your Payza account
  • create your buttons with shortcodes


Integrate Payza using WooCommerce Extension

Payza is a money transfer service which allows customers to pay you using their E-Wallet. Customers are redirected to the secure Payza servers for payment, and then redirected back to your site after paying, relieving you of the need for a SSL certificate for your server. Merchants like Payza for the ease and convenience of accepting payment, customers prefer Payza because they know their financial details will be safe and secure.

Installation

  • Buy this extension
  • Download and install into your WooCommerce store
  • Enter your Payza Live email on the settings page and save
  • Now you can easily transfers money

Note:

For more details please visit http://docs.woothemes.com/document/payza/

PayPal Integration


PayPal Buy Now Button

If you know HTML you can avoid the Button Factory and create your own “Buy Now” buttons by changing the HTML code directly. The sample code below shows the minimum information you need to create a Buy Now button (in this case, to purchase a teddy bear).

Sample URL Code for a Buy Now Email Payment Link

You can write down your own URL for “Buy Now” payment links.
The same variables and values that you include in HTML code for Buy Now buttons can be used in Buy Now email payment links. Separate the variables and their values from each other with ampersands (&). Do not include values in quotation marks; use plus signs (+) as substitutes for spaces in values, if needed.
Note:
You cannot include variables for option fields in email payment links. You can use the following URL as a starting point for writing your own URL for Buy Now email payment links. The value for the business variable should be a valid id of your PayPal account. You can change the values for other variables as per your requirements.

Example 1 URL for a Buy Now Email Payment Link

https://www.paypal.com/_xclick/business=me@mybusiness.com&item_name=Baseball&item_number=123&amount=120&currency_code=USD&undefined_quantity=1


Set Up a PayPal Shopping Cart

  1. Go to http://www.paypal.com/
  2. Mouse over the "Get Paid" option in the menu and then click on "Accept Credit Cards"
  3. Click on the "Setting Up" tab
  4. Click on "set up your button"
Once you're in the button builder you can customize lots of options on your form, including:
  • Change it to an "add to cart" button so that customers can shop for multiple items
  • Accept donations, set up subscriptions, or sell gift certificates
  • Use item IDs to have Paypal help you with your inventory
  • Change currencies or set up multiple prices
  • Add in shipping fees and taxes
  • Most importantly have Paypal use a Merchant ID for your transactions, so your email address is secure.
  • Customize checkout pages
  • And other options
Once you're done choosing all the options, click on the "Save Changes" button. Then just paste the code that is generated into your website where you put the cart button.

PayPal Shopping Cart Code

Wednesday, December 11, 2013

Paymall Payment Gateway Integration


Paymall Payment Gateway(Code)

How to integrate PAYMALL?

Steps:

  • Create the HTML form:
  • Integrate the HTML form with below PHP code.It will working fine.


Amount:
Currency:

Card Details


Name On Card:
Card Number:
CardExpiration Date:
Card Validation Value:

Billing Info Details


First Name:


Last Name:

Address Line1:

Address Line2:

City:

State:

Country:

Postal Code:


PHP Code:

Note:-isset($_POST['paymall'])//////Here "paymall" is submit button name

if(isset($_POST['paymall'])) {

function do_post_request($url, $data, $optional_headers = null){
$params = array('http' => array('method' => 'POST','content' => http_build_query($data),));
if ($optional_headers !== null) {
$params['http']['header'] = $optional_headers; }
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
if (!$fp) {
throw new Exception("Problem with $url, $php_errormsg"); }
$response = @stream_get_contents($fp);
if ($response === false) {
throw new Exception("Problem reading data from $url, $php_errormsg");}
parse_str($response, $output); return $output;}

The mp_IsTestTrans value must be changed to 'False' when the mp_AuthenticationID/mp_AuthenticationPassword test account values are replaced with values for a live account

$postdata = array(
'mp_APIVersion' => '2.0',
'mp_IsTestTrans' => 'False', Live account
'mp_AuthenticationID' => 'xxxxxxx' , Enter your AuthenticationID
'mp_AuthenticationPassword' => 'xxxxxxx', Enter your AuthenticationPassword
'mp_ConfigID' => '1',
'mp_MessageRequestType' => 'Sale',
'mp_TransClearingAction' => 'Capture',
'mp_IsCardPresent' => 'False',
'mp_PaymentMethod' => 'CreditCard',
'mp_CardNumber' => $_REQUEST['mp_CardNumber'],
'mp_NameOnCard' => $_REQUEST['mp_NameOnCard'],
'mp_CardExpirationDate' => $_REQUEST['mp_CardExpirationDate'],
'mp_CardValidationValue' => $_REQUEST['mp_CardValidationValue'],
'mp_TotalAmount' => $_REQUEST['mp_TotalAmount'],
'mp_CurrencyCode' => 'USD',
'mp_OrderNumber' => '5678',
'mp_BillingFirstName' => $_REQUEST['mp_BillingFirstName'],
'mp_BillingLastName' => $_REQUEST['mp_BillingLastName'],
'mp_BillingAddressLine1' => $_REQUEST['mp_BillingAddressLine1'],
'mp_BillingCity' => $_REQUEST['mp_BillingCity'],
'mp_BillingState' => $_REQUEST['mp_BillingState'],
'mp_BillingPostalCode' => $_REQUEST['mp_BillingPostalCode'],
'mp_BillingCountryCode' => $_REQUEST['mp_BillingCountryCode'],
'mp_CustomerIPAddress' => $_SERVER['REMOTE_ADDR'],
);
$result = do_post_request('https://gateway.mtrex.com/omega.mp',$postdata);
echo "Customer Name:".$_REQUEST['mp_BillingFirstName']."".$_REQUEST['mp_BillingLastName'];
echo "
";
echo "Your Transaction ID:".$result['mp_TransID']."\n";
echo "
";
echo "Transaction Result:".$result['mp_TransResult']."\n";
echo "
";
echo "Transaction Result:".$result['mp_TransResultMessage']."\n";
echo "
";
}
?> End Here

GSPAY Gateway Integration(PHP Code)


GSPAY Gateway Integration

GSPAY provides a credit card payment gateway allowing you to clear all major credit cards against very competitive rates. We provide dependable Merchant Account Services. If you use the GSPAY you will benefit of a substantial sales increase, as well as lower costs. GSPAY offers these solutions in integrated packages that will perfectly adjust to your company requirements, in any field of work. We processes for both low-risk and high-risk merchant accounts. We set your rates as determined by your type of business. "Low risk" businesses such as web hosting qualify for a lower rate, whereas a “High risk” business such as travel merchant account has higher rates. A business is generally classified as high risk when both its chargeback potential and the likelihood that it will shut its doors and disappear over-night are considered high based on the history of that type of business. Whether a business is considered high-risk by GSPAY and our banks depends on on many variables. For high volume merchants GSPAY provide XML API interface for direct credit card transactions processing.

GSPAY Benefits:-

1.Support shopping cart systems: OSCommerce, CubeCart, X-cart, ZenCart, Shop-Script, Virtuemart, Magento

2.Visa and Mastercard SecureCode available

3.Quick online payment implementation

4.Acceptance of the main credit card types

5.Secure Server (SSL certificate)

6.Customized shopping cart and order page design

7.Immediate integration with your website

8.Every country is welcome

9.Powerful Marketing Tools

10.Recurring billing supported as well as free demo for your clients

GSPAY PHP Code

"The E Check" Gateway Integration(PHP Code)

echeck payment gateway integration in php 
how to integrate ACH and electronic checks in your website
echeck merchant account



First Name
Last Name
Address
City
State
Zip Code
Phone
Email
Bank Account Number
Routing Number
Plan
Amount


//create array of data to be posted

$post_data['security_key'] = 'xxxxxxxxxx'; // Insert your security key here
$post_data['purchaser_firstname'] = $_REQUEST['fname'];
$post_data['purchaser_lastname'] = $_REQUEST['lname'];
$post_data['purchaser_address'] = $_REQUEST['address'];
$post_data['purchaser_city'] = $_REQUEST['city'];
$post_data['purchaser_state'] = $_REQUEST['state'];
$post_data['purchaser_zipcode'] = $_REQUEST['zip'];
$post_data['purchaser_phone'] = $_REQUEST['phone'];
$post_data['purchaser_email'] = $_REQUEST['email'];
$post_data['transaction_amount'] = $_REQUEST['amount'];
$post_data['purchaser_ip'] = $_SERVER["REMOTE_ADDR"];
$post_data['purchaser_account'] = $_REQUEST['paccount']; // The test account number is 000000
$post_data['purchaser_routing'] = $_REQUEST['prouting']; // The test routing number is 011000015
foreach ( $post_data as $key => $value) { $post_items[] = $key . '=' . $value; }

//create the final string to be posted using implode()

$post_string = implode ('&', $post_items);

//create cURL connection

$curl_connection = curl_init('https://theecheck.com/backoffice/api/api.php');

//set options

curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); // Must be set to recieve transaction
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);

//set data to be posted

curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);

//perform our request

$result = curl_exec($curl_connection); // Catches the result from the request into a variable
echo "Transaction Result: " . $result . "

";

//show information regarding the request

print_r(curl_getinfo($curl_connection)); information regarding the CURL request
echo curl_errno($curl_connection) . '-' . curl_error($curl_connection);

//close the connection

curl_close($curl_connection);
}

Monday, December 2, 2013

PHP code sample for Secure Web Pay Checkout

Payments Gateway(is now FORTE)

Secure Web Pay(SWP)Checkout allows you to call the Payments Gateway payment form for entering and securely submitting transaction information.You can customize the look and feel of the form by either selecting a predefined form style in the Virtual Terminal(VT) or passing in fields along with the call.
URLs
Sandbox:https://sandbox.paymentsgateway.net/swp/co/default.aspx
Live:https://swp.paymentsgateway.net/co/default.aspx

Featured Post

Payza integration

Payza's Advanced Button in HTML Using simple HTML, you can integrate easily with Payza.Generate buttons and manage payment details f...

Most Popular