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

Cancelado Publicado Jul 24, 2014 Pagado a la entrega
Cancelado Pagado a la entrega

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);

}

?>

Comercio electrónico HTML MySQL PHP Carritos de compras

Nº del proyecto: #6231387

Sobre el proyecto

3 propuestas Proyecto remoto Activo Jul 26, 2014

3 freelancers están ofertando un promedio de $165 por este trabajo

toinnisfree

A proposal has not yet been provided

$185 USD en 3 días
(656 comentarios)
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 en 7 días
(101 comentarios)
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 !! Más

$126 USD en 3 días
(80 comentarios)
6.2