Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Firstgate "Click & Buy"


Ahler

Recommended Posts

Hello,

 

is some1 here in the forum who can make a simple payment-modul for the services from FIRSTgate "click & buy"?

 

Here are the restrictions for a php from FIRSTgate:

 

<?

/*************************************

***** Transaction Script Example *****

*************************************/

 

//Init Products

$products = Array("product1" => 29.90,"product2" => 39.90);

 

//Init Header and GET Variables

$fg_linknr = $_SERVER["HTTP_X_CONTENTID"]; //Premium Link Number

$fg_price = $_SERVER["HTTP_X_PRICE"]; //Millicents !

$fg_uid = $_SERVER["HTTP_X_USERID"]; //Firstgate Customer Reference Number

$my_productid = $_GET["productid"]; //Your own GET Parameter

$my_price = $_GET["price"]; //Your own GET Parameter

$my_uid = $_GET["uid"]; //Your own GET Parameter

 

$result = true;

 

//Check UserID

if(empty($fg_uid) || is_nan($fg_uid))

{

$result = false;

}

 

//Check Firstgate Price

if(empty($fg_price) || is_nan($fg_price))

{

$result = false;

}

 

//Check My Price

if(($fg_price / 1000) != $my_price)

{

$result = false;

}

 

//Check Product-Price Matching

if($products[$my_productid] != $my_price)

{

$result = false;

}

 

//Create new Record in Database

$sql = "INSERT INTO transactions (uid,fg_uid,date_time,product_id,link_nr) ";

$sql .= "VALUES ";

$sql .= "('$my_uid','$fg_uid','".date("Y-m-d H:i:s")."','$my_productid','$fg_linknr')";

if(!$query = @mysql_query($sql,$connection))

{

$result = false;

}

 

//Send mail ?

if(!@mail("[email protected]","Transaction Message","Some text here...","[email protected]"))

{

$result = false;

}

 

if($result)

{

header("Location: http://www.somewhere.com/firstgate/thanks....meters=");

}

else header("Location: http://www.somewhere.com/firstgate/sorry.p...meters=");

?>

 

GET- and POST-Parameters could be the folowings: (case-sensitiv)!

 

 

Company

FirstName

LastName

Street

ZIP

Email

City

Phone

Fax

DateOfBirth

Gender = (m|w)

 

Here comes a textfile which was translated by googel from germany to english! Sorry!

 

ShortDOKU TRANSACTIONS

 

you communicate the URL to us on a Buchungsscript with you.

 

We replace this Orginallink in our system by a Premium left of the following form:

 

< http://premium-link.net/$5444554446...#036;/Script.pl > (or asp, or php or.....)

 

Premium left you would have to exchange these for their Orginal Script left.

 

On it do you hang then all parameters by GET on (e.g. email, username, user ID? and the blanks as %20) parameters, which we need compellingly, are the following:

 

price=<euro, > (ONLY WITH DYNAMIC PRICES) success=<success URL, HTTP cent>oder<cent:/.....> error=<error URL, HTTP://....>

 

The parameter ' price ' is picked out by us with the call and indicated to the surfer for account. The parameter ' success ' is picked out by us and in case of success redirecten we on this URL. The parameter ' error ' is picked out by us and in case of non--success redirecten we on this URL. The success and error URL must be public. In the ideal case the Success URL is a thank side, which reports success to the surfer.

 

Now to the tasks of your SCRIPT: (script area may be callable only over our IP) the surfer registered with us, is noticeable we to him the price from the Premium URL. The surfer clicks to the accept Button in the paying side with us. Thereupon we call your Script on with all parameters, which attached you at the Premium left (GET).

 

z. B: http://premium-link.net/$5444554446....00&request=ok& user ID = 0000001&Endkunden-ID=0000001 your Script booked now the amount and other parameters, with which we called the Script.

 

The Script picks from the header the roofridge gates inserting sides the customer reference number out surfer. With cancellations one can manufacture so the alignment to your Datenbankk. With php one can pick the customer reference number out in such a way:

 

<?PHP// output the crypted userid $$userid = getenv("HTTP_X_USERID"); echo $$userid; >

 

Their Script should examine, checken the price whether the surfer changed the price in the URL. If now the price were manipulated answers your Script with ERROR (see below, ' no success ') gives it two possibilities: 1) the reservation could not be implemented by your Script 2) the reservation by your Script successfully implemented

 

1) no success the Script answers with ERROR in the content as text/plain or text/cHtml. Thereupon redirecten we to the error URL, which transferred you to us in the parameter ' error '. No account is produced!!!

 

2) success the Script answers text/cHtml with OK ONE in the content as text/plain or. Thereupon redirecten we to the Success URL, which transferred you to us in the parameter ' success '. NOW THE ACCOUNT TAKES PLACE. -- of the surfer accepts the payment, then we call your Script. Only if we receive the OK of the Script, the account takes place.

 

This way one saves unnecessary cancellations, if the reservation is not successful

 

I hope, some1 can code a paymentmodul for FIRSTgate "click & buy" with this informations!

 

Thx

 

Ahler

Edited by Ahler
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...