News:

Looking for documentation? Take a look on our wiki

Main Menu

Pls help me with www.shareit.com payment module

Started by beman, April 14, 2006, 18:36:54 PM

Previous topic - Next topic

beman

Hello all,

I try some time to code my own payment module for www.shareit.com but it is unsuccessfull. May be i have litter knowledge about code php.Pls help me to code it.

This is tutorial from www.shareit.com to tell us how to wire payment code:

Shopping Cart Integration

Important: You must have your own interactive shopping cart on your Web site. You can transfer the full shopping cart to our pages using the following interface description.

By default, no shopping cart is used in the order process. You can activate the shopping cart function by entering the "cart=1" parameter in the URL. In addition, you can also transfer a full shopping cart to our server.

The order process can now begin on three different pages. The possible referral parameters for each page are listed below. Please note that all parameters that are transferred via a link must be URL encoded, i.e. the coding is the same as that used in Web forms transferred using the POST method, e.g. blank spaces must be changed to "+" signs. Examples of this can be found in the text below, and more information is available on the Internet at http://www.w3.org.

1. product.html (product page with ordering option)

    * productid=#product ID
    * cart=1 (shopping cart functionality activated, default=0 means that this function is deactivated)
    * cookies=1 (a cookie is placed on the customer's computer that contains the current session ID, which is used to identify a full shopping cart again even if the customer has visited other Websites before finalizing the order.)

2. cart.html (shopping cart)

You can also access the shopping cart page directly and transfer the full shopping cart from your own Web pages to our server in this way. These are the possible parameters:

    * productid=#product ID (only this one product, quantity=1)
    * PRODUCT[#product_id]=#AMOUNT (quantity of the selected product)
    * stylefrom=#product ID (uses the layout of one of your other products as defined in the Style Editor)
    * ADDITIONAL1=any text and
    * ADDITIONAL2=any text (for additional information in the order process)

You can use this parameter to transfer additional information only if you are also transferring your products in this form: PRODUCT[#product_id]=#AMOUNT:

    * ADDITIONAL1[product_id]=any text and
    * ADDITIONAL2[product_id]=any text

If you do not wish to display additional information in the order process, but still want to have it saved with an order, then please use the following parameters:

    * HADDITIONAL1[product_id]=any text and
    * HADDITIONAL2[product_id]=any text

Example of the ADDITIONAL1 parameter:
ADDITIONAL1=This is any text with some [/?] special characters
This example URL-encoded: http://www.shareit.com/cart.html?additional1=This+is+any+text+with+some+%5B%2F%3F%5D+special+characters

3. checkout.html (order page with form)

You can also use all of the parameters listed under No. 2 (cart.html) for the order page.

Note: The following parameters are applicable to all three pages mentioned above:

    * affiliate = affiliate name or ID; sent to you when an order is placed

    * Please note that the parameter reseller=<resellername> is still valid. language = English, German, Portuguese, Spanish, Italian, French, Norwegian, Dutch, or Swedish
    * nolselection = 1, hides the language selection menu on the order pages
    * noquickbuy = 1, use this parameter to deactivate the "Quickbuy" button on your order pages
    * alternative: languageid = 1,2,3,4,5,6,7,8,9, or 10 (1=English, 2=German, 3=Portuguese, 4=Spanish, 5=Italian, 6=French, 7=Norwegian, 8=Dutch, 9=Swedish, 10=Finnish)
    * currencies=EUR, USD, ARS, AUD, BRL, GBP, CNY, HKD, INR, JPY, CAD, NZD, NOK, SEK, CHF, SGD, KRW, TWD

This parameter can be used to display various currencies. We only accept payments in Euro, US Dollars, Pounds Sterling, Canadian Dollars, Swiss Francs, Australian Dollars, or Yen (billing currencies). All other currencies can be displayed only (virtual currencies) and are translated at the current exchange rate. For example, currencies=NOK means that Norwegian Kroner is the default currency on your Website, but payments are accepted in Euros. You can transfer any number of virtual currencies. Please use the internationally accepted abbreviations (see above). Additional information and the table containing all of the currencies that we offer and their international abbreviations are located under 'Products' and 'Generate Links'.

Example:

Here is an example for accessing the shopping cart page with an already full shopping cart. The customer has selected 3 copies of product 123456 and 5 copies of product 100000 on your page. The customer's language is Spanish, and he will be paying in Euros. You would access the following URL from your Website to transfer this product order to our order process (the shopping cart in this case):

http://www.shareit.com/cart.html?PRODUCT[123456]=3&PRODUCT[100000]=5&languageid=4&currencies=EUR


thank you!

dtcom

i need it too... please someone expert... please help me..!! ???

Marchert

Hello,

I have something but it does not work right now. The problem is to get the product numbers and the product amounts. I`m not very familar with php and mysql and so it would be very nice if someone can help me.

This is the code I tried:

<?php

$url "http://www.shareit.de/checkout.html";

if( $page == "checkout.thankyou" ) {

$post_variables = Array(
"COMPANY" => $user->company,
"SALUTATION" => $user->title,
"FIRSTNAME" => $user->first_name,
"LASTNAME" => $user->last_name,
"D_STREET1" => $user->address_1,
"D_STREET2" => $user->address_2,
"D_POSTALCODE" => $user->zip,
"D_CITY" => $user->city,
"PHONE" => $user->phone_1,
"FAX" => $user->fax,
"EMAIL" => $user->user_email,
"EMAIL_CONFIRM" => $user->user_email,
"CURRENCY_ID" => $_SESSION['vendor_currency'] // Währung
);

if( $page == "checkout.thankyou" ) {

$query_string "?";
foreach( $post_variables as $name => $value ) {
$query_string .= $name"=" urlencode($value) ."&";
}

$query_string .= "PRODUCT[" $db->f("order_item_sku") . "]=" $db->f("product_quantity");

mosRedirect$url $query_string );

} else {

echo '<form action="'.$url.'" method="post" target="_blank">';
echo '<input type="image" name="submit" border="0" alt="" />';

foreach( $post_variables as $name => $value ) {
echo '<input type="hidden" name="'.$name.'" value="'.$value.'" />';
}
echo '</form>';

}

}
?>


The main problem is the access to the database and the order information. This line will do nothing:

$query_string .= "PRODUCT[" . $db->f("order_item_sku") . "]=" . $db->f("product_quantity");

How can I access to the database and how to loop to all orderd products?

Thanks for any help in advance!

Peter