Latest News: (loading..)

Chris H

Members
  • Content count

    102
  • Joined

  • Last visited

  • Days Won

    3

Chris H last won the day on December 14 2013

Chris H had the most liked content!

1 Follower

About Chris H

Profile Information

  • Real Name
    Chris H
  • Gender
    Male
  • Location
    UK
  1. Thanks MrPhil, well spotted.
  2. No reflection on burt's analysis, but satisfy yourself that you are looking at the right instance of 'amount' => $this->format_raw($order->info['total'] - $order->info['shipping_cost'] - $order->info['tax']), Comment the line out, to check that the transaction fails. Then try changing it to 'amount' => $order->info['total'] - $order->info['shipping_cost'] - $this->format_raw($order->info['tax']), Suppose that 'tax' is rounded down by format_raw. In the quoted line of code, it is preceded by a minus sign. So there may be a sense in which 'amount' is rounded up. This would cause a one-penny discrepancy. The two basic numbers in your screen-shot, 31.63 and 37.95, seem to be related as follows 31.63 * 1.2 = 37.956 That is, the 20% vat has been applied to the item values only. Not to the whole order value. We haven't been asked to discuss legalities, but are you sure that is the correct treatment? If you have been undercollecting vat then an occasional rounding error is the least of your problems. There is a further mystery in the line Total Vat @ 20% Included in the Above £7.23 This figure seems to have been derived as 43.35 / 6 = 7.225 but we must divide by 5, not by 6, to split off the 20% vat. Is this 'Total Vat' consistent with the Paypal page, in the case of a successful transaction? Sorry to be just negative. But if the code is fundamentally flawed then fine-tuning, to fix a rounding error, would be premature.
  3. From the osC home page we can click through to Products > Online Demo > View > Source to view the source, and specifically to view line 6 which reads <base href="http://demo.oscommerce.com/" /> The domain-name, as here given, ends with a forward-slash character. So your <img src="/images/credit_cards.gif" can be changed to <img src="images/credit_cards.gif" like in joli's code. Or it might need to be <img src="catalog/images/credit_cards.gif" depending on your directory structure. Just don't start the pathname with a forward-slash.
  4. According to a discussion in the German-language forum, you need to update from 2.3.3.3 to 2.3.3.4 http://forums.oscommerce.de/topic/81909-fehlermeldung-bei-paypalzahlung-nach-update-auf-2333/
  5. Like Mort-lemur says, though there is always the customer who registers with an address that is near to you, with the intention fraudulently to secure a lower postal charge. There is no automatic check for this, you will just have to keep your eyes open. If however we think in terms of whole states, not of specific postcodes, then there is less vulnerability to this fraud. In the case of an Australian address, Paypal returns the values of SHIPTOSTATE SHIPTOCOUNTRYCODE and if function pre_confirmation_check function pre_confirmation_check() { global $HTTP_GET_VARS, $order, $ppe_token; if (!tep_session_is_registered('ppe_token')) { tep_redirect(tep_href_link('ext/modules/payment/paypal/express.php', '', 'SSL')); } if (!isset($HTTP_GET_VARS['do'])) { $response_array = $this->getExpressCheckoutDetails($ppe_token); if (($response_array['ACK'] == 'Success') || ($response_array['ACK'] == 'SuccessWithWarning')) { // load the selected shipping module include(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); include(DIR_WS_CLASSES . 'order_total.php'); $order_total_modules = new order_total; $order_total_modules->process(); if ($response_array['AMT'] == $this->format_raw($order->info['total'])) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')); } else { tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, 'do=confirm', 'SSL')); } } } } is not happy with what it sees then our visitor does not get through to checkout_process. It is still common to offer free shipping on valuable orders, though the practice looks like a relic of the days of printed catalogues. It would have been too much to ask the householder to dip his pen into his inkwell, to start adding up weights. But we can nowadays charge prices which more accurately reflect our costs, and the competition may force us to do so. So maybe place more emphasis on weight-based shipping - more especially as some of the products are 'quite heavy'.
  6. It would be useful to offer a pre-installation tester, that a prospective osC merchant can use to check that for example he has got the right sort of Paypal account. Here's a tester script, followed by 4 subsidiary files. It is run after making 4 substitutions in the file called 'header.php'. And deleting them afterwards of course, not leaving them exposed. As for checking that a connection to the database can be established, that is best treated as a separate test. tester.php : <?php // tester.php require 'header.php'; $cart_array = array ( 'VERSION' => '60.0', 'METHOD' => 'SetExpressCheckout', 'PAYMENTACTION' => 'Sale', 'RETURNURL' => $domain . '/return.php', 'CANCELURL' => $domain . '/cancel.htm', 'SOLUTIONTYPE' => 'Sole', 'CURRENCYCODE' => 'GBP', 'L_NAME0' => 'gold plated shovel', 'L_AMT0' => '0.03', 'L_QTY0' => '3', 'L_TAXAMT0' => '0.00', 'L_NAME1' => "lady's truncheon", 'L_AMT1' => '0.05', 'L_QTY1' => '4', 'L_TAXAMT1' => '0.00', 'ITEMAMT' => '0.29', 'TAXAMT' => '0', 'L_SHIPPINGOPTIONNAME0' => 'Flat Rate (Postage and Packing)', 'L_SHIPINGPOPTIONLABEL0' => 'Flat Rate (Postage and Packing)', 'L_SHIPPINGOPTIONAMOUNT0' => '0.23', 'L_SHIPPINGOPTIONISDEFAULT0' => 'true', 'INSURANCEOPTIONSOFFERED' => 'false', 'SHIPPINGAMT' => '0.23', 'AMT' => '0.52', 'MAXAMT' => '100.75' ); $cart_array = array_merge ($cart_array, $credentials_array); $token_str = fetch (http_build_query($cart_array)); $token_array = array(); parse_str($token_str, $token_array); $_SESSION[TOKEN] = $token_array[TOKEN]; $paypal_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout'; $url = $paypal_url . '&token=' . $token_array[TOKEN] . '&useraction=commit'; header('Location: ' . $url); exit; ?> return.php : <?php // return.php require 'header.php'; $token_array = array ( 'VERSION' => '60.0', 'METHOD' => 'GetExpressCheckoutDetails', 'TOKEN' => $_SESSION[TOKEN] ); $token_array = array_merge ($token_array, $credentials_array); $address_str = fetch (http_build_query ($token_array)); $address_array = array(); parse_str ($address_str, $address_array); $do_array = array ( 'VERSION' => '60.0', 'METHOD' => 'DoExpressCheckoutPayment', 'PAYMENTACTION' => 'Sale', 'BUTTONSOURCE' => 'osCommerce22_Default_EC', 'TOKEN' => $address_array[TOKEN], 'PAYERID' => $address_array[PAYERID], 'AMT' => $address_array[AMT], 'CURRENCYCODE' => $address_array[CURRENCYCODE], 'SHIPTONAME' => $address_array[sHIPTONAME], 'SHIPTOSTREET' => $address_array[sHIPTOSTREET], 'SHIPTOCITY' => $address_array[sHIPTOCITY], 'SHIPTOSTATE' => $address_array[sHIPTOSTATE], 'SHIPTOCOUNTRYCODE' => $address_array[sHIPTOCOUNTRYCODE], 'SHIPTOZIP' => $address_array[sHIPTOZIP] ); $do_array = array_merge ($do_array, $credentials_array); fetch (http_build_query ($do_array)); header('Location: ' . $domain . '/success.htm'); ?> header.php : <?php // header.php session_start(); $domain = 'http://www.xxxxxxxx.co.uk'; $credentials_array = array ( 'USER' => 'sales_api1.xxxxxxxxx.co.uk', 'PWD' => 'APxxxxxxxxxxxxYB', 'SIGNATURE' => 'AmxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxPq' ); function fetch ($parameters){ $curl = curl_init('https://api-3t.paypal.com/nvp'); curl_setopt($curl, CURLOPT_PORT, 443); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_FORBID_REUSE, 1); curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $parameters); $result = curl_exec($curl); curl_close($curl); return $result; } ?> cancel.htm : <html> <head></head> <body> <p>cancel page</p> </body> </html> success.htm : <html> <head></head> <body> <p>success page</p> </body> </html>
  7. If we add 157.46 to 17.50 then we get 174.96 not 174.95. It looks like a rounding error inside the add-on.
  8. Perhaps you have imposed a severe access restriction, such as password protection, whilst getting set up. Your website, and the Paypal server, need to be able to talk to each other. Failing which, PP error messages cannot get through.
  9. My own solution, to a similar problem, was to create a column called 'zone' in the countries table. Some of the entries, in the column, are 'EU' and some are not. $query = ' SELECT zone FROM ' . TABLE_COUNTRIES . ' WHERE countries_id = ' . $order->delivery['country']['id'] ; $result = mysql_query($query); if ($result) { $row = mysql_fetch_row($result); } So your if (XXX){ is then if ($row[0] != 'EU'){ For the archive, I don't believe that this law has been ratified in all EU countries. Or even in most of them.
  10. Can't be much help, other than to list the key/value pairs that are ordinarily sent to PP Express. Presumably Dynamo does the same. VERSION=60.0 METHOD=SetExpressCheckout PAYMENTACTION=Sale RETURNURL=http%3A%2F%2Fwww.xxxxxxxxxx.co.uk%2Fcatalog%2Fext%2Fmodules%2Fpayment%2Fpaypal%2Fexpress.php%3FosC_Action%3Dretrieve CANCELURL=http%3A%2F%2Fwww.xxxxxxxxxx.co.uk%2Fcatalog%2Fext%2Fmodules%2Fpayment%2Fpaypal%2Fexpress.php%3FosC_Action%3Dcancel USER=sales_api1.xxxxxxxxxx.co.uk PWD=ARNAX5YR3SFRGDYB SIGNATURE=AmiDcmdWJ6782BCw9VRzBNLUVRzQAkKCgBxPOld8XsatimkyBNSydOGq SOLUTIONTYPE=Sole CURRENCYCODE=GBP L_NAME0=T+shirt+with+Coca+Cola+logo L_AMT0=0.02 L_QTY0=1 L_TAXAMT0=0.00 ITEMAMT=0.02 TAXAMT=0 L_SHIPPINGOPTIONNAME0=Flat+Rate+%28Postage+and+Packing%29 L_SHIPINGPOPTIONLABEL0=Flat+Rate+%28Postage+and+Packing%29 L_SHIPPINGOPTIONAMOUNT0=0.01 L_SHIPPINGOPTIONISDEFAULT0=true INSURANCEOPTIONSOFFERED=false SHIPPINGAMT=0.01 AMT=0.03 MAXAMT=100.04 This records the purchase of one instance of one product. The values of SIGNATURE, and so forth, have been slightly altered. I seem to remember there was also something called L_NUMBER0, which I took out of the php. And no, I haven't mis-spelled L_SHIPINGPOPTIONLABEL0. The osC developers like it that way.
  11. kymation's point is well made, that the API test results are generated by Paypal. It may be worth mentioning for the archive that RETURNURL and CANCELURL can be set on a per-transaction basis in function setExpressCheckout($parameters) which is itself in catalog/includes/modules/payment/paypal_express.php This over-rides PP account settings. A merchant might after all have several stores, and thus need several RETURN and CANCEL URL's.
  12. Dunno. As a last resort, have two shops www.proudmary.me/winkel www.proudmary.me/shop They can address the same database. The google-searcher has chosen a phrase from a particular language. Having implicitly specified a language, he is happy to get through to a page that offers that language and no other. I am sceptical of the multi-language thing. A fresh install is likely to be easier than copying the winkel directory. And then re-naming the copy. And then fiddling about with the configure files. It has to be an 'upload install', so far as I can see. Fantastico would insist on making a new database. How much of the duplicated admin can be deleted, I do not know. Try it and see. A directory can be 'half-deleted', by vandalising its name. The code, that is looking for it, cannot then find it. Then it's a case of getting into includes/languages/english.php to change 'welcome guest' to 'welkom gast'. Leaving the filename unchanged of course. Like Bertil, I don't see that you need a 'catalog' directory. Directories like 'images' and 'includes' can be directly under 'winkel'.
  13. For the sake of the future searcher in the forum archive, it seemed preferable to not start a new thread on an old topic. He is presented with dozens of threads, all on much the same theme, and having the usual gaps and overlaps in the information that they offer. But, with hindsight, I can see that it looks like I barged into the conversation and I apologise.
  14. Looking to convert my site to osC, I wish to stay with Paypal Standard (with which I have years of experience) rather than change to Paypal Express. But I hunt in vain through the osC programs, looking for an 'include' or 'require' or 'define' statement which mentions paypal_standard.php. Neither is the filename the value of a key/value pair, such that it could be referenced by key. Which of the forum's helpful experts will explain to me how, exactly, 2.3.1 runs paypal_standard.php ?