Cancelled

Set up Receipt Verification script (in PHP) from [login to view URL] to work on my Server and CS Cart.

I need someone to set up receipt verification script (in PHP) from [url removed, login to view] to work on my server and communicate with my CS Cart database.

When someone completes a payment, [url removed, login to view] will inform my server by making a HTTP GET request to the URL that was specified in my service configuration (for example [url removed, login to view]). The payment processor script is written in PHP. This response is considered successful and notification delivered if my server responds with code 200.

This receipt verification script is for integrating in-app purchases with users’ profile

.

The Receipt Verification script (hosted on my server) is called whenever a user makes a payment. The script first makes security checks (validate IP addresses, check the signature) to validate that the request came from Fortumo. Then the script processes the $_GET['product_name'] and $_GET['status'] parameters and grants virtual items to the user who made the purchase.

Fortumo Mobile Payments for Web Apps integration is designed to be extremely simple and straightforward. The payment flow uses Premium SMS messages and HTTP requests to process payments. Payment is considered to be successful after Fortumo server has sent HTTP request to my receipt verification URL on my server. After my server has received the request from Fortumo with payment status=completed my backend should notify my frontend of successful payment and grant virtual goods to the end-user.

The virtual goods will be in the form of virtual credits to the user in my CS Cart shopping cart.

SAMPLE SCRIPT

<?php

// check that the request comes from Fortumo server

if(!in_array($_SERVER['REMOTE_ADDR'],

array('79.125.125.1', '[url removed, login to view]', '[url removed, login to view]', '[url removed, login to view]', '[url removed, login to view]', '[url removed, login to view]', '[url removed, login to view]'))) {

header("HTTP/1.0 403 Forbidden");

die("Error: Unknown IP");

}

// check the signature

$secret = ''; // insert your secret between ''

if(empty($secret) || !check_signature($_GET, $secret)) {

header("HTTP/1.0 404 Not Found");

die("Error: Invalid signature");

}

$sender = $_GET['sender'];//phone num.

$amount = $_GET['amount'];//credit

$cuid = $_GET['cuid'];//resource i.e. user

$payment_id = $_GET['payment_id'];//unique id

$test = $_GET['test']; // this parameter is present only when the payment is a test payment, it's value is either 'ok' or 'fail'

//hint: find or create payment by payment_id

//additional parameters: operator, price, user_share, country

if(preg_match("/failed/i", $_GET['status'])) {

// mark payment as failed

} else {

// mark payment successful

}

// print out the reply

if($test){

echo('TEST OK');

}

else {

echo('OK');

}

function check_signature($params_array, $secret) {

ksort($params_array);

$str = '';

foreach ($params_array as $k=>$v) {

if($k != 'sig') {

$str .= "$k=$v";

}

}

$str .= $secret;

$signature = md5($str);

return ($params_array['sig'] == $signature);

}

?>

Skills: eCommerce, HTML, MySQL, PHP, Shopping Carts

See more: work on web, when to work com, virtual shopping cart, server request processor, security notification service, sample received form, premium web cart, mobile operator to find, mobile operator found, mobile no operator find, k to the i, get html code from url, flow configuration, find the operator, find set, find in set, create shopping cart html, create profile form php, create a web server in php, com profile php id

About the Employer:
( 8 reviews ) Ikeja, Nigeria

Project ID: #6231387

3 freelancers are bidding on average $165 for this job

toinnisfree

A proposal has not yet been provided

$185 USD in 3 days
(656 Reviews)
8.1
mituld

Hi I work towards providing reliable, relevant and robust IT solutions at most competitive prices to my customers. I ensure 100% customer satisfaction so lets start Thanks

$185 USD in 7 days
(101 Reviews)
6.8
VnBestSolutions

Dear Sir, We claim to get it done perfectly for you EXACTLY in the way you want it - Kindly give we a chance and we will prove myself - Ready to prove our words, let's get it done right away and I mean RIGHT AWAY !! More

$126 USD in 3 days
(80 Reviews)
6.2