Jump to content

Guillaume

Member
  • Content Count

    25
  • Joined

  • Last visited

Everything posted by Guillaume

  1. It's indeed specific to my plugin. I don't think the problem comes from the payment processor, I don't master the Cubecart framework, so it's probably a bug in my code, which this work-around solves.
  2. Thanks a million. After several tries, I managed! I am pasting the code which works, for everyone's records: $transaction_records = $GLOBALS['db']->select('CubeCart_transactions', array('id'), array('order_id' => $cart_order_id), false, false, false, false); if (!$transaction_records) $order_log = $order->logTransaction($transData);
  3. Because I can't understand the problem's root cause, I'm trying to make a patch by checking if the existing logs for that order are empty, and only log the transaction if so is the case. But I'm guessing I'm totally wrong in my syntax: I've similarly tried if !empty(...) and a few similar methods, without luck. What I'm struggling to understand is the nature of the object $order->logTransaction($transData) I have also tried capturing the $order->logTransaction($transData) into a variable first, as below, but without luck: Similarly, I have also tried if (empty(.
  4. Thanks a million, I've used the below code and can now get the exchange rate indeed: $currency_records = $GLOBALS['db']->select('CubeCart_currency','value',array('code' => $currencyCode)); if ($currency_records !== false) $exchange_rate = $currency_records[0]['value']; By any chance would you know the equivalent query to retrieve the amount of decimals (which is "2" for nearly all currencies)? I have tried replacing "value" by "decimals_place". Sounded a fair guess from what I saw both in the Cubecart code and in the logs when updating the admin panel (
  5. Hello, I am developping a payment gateway to connect my Cubecart-powered website with French PSP Systempay. Not that I specifically need that myself, but for the sake of public interest, I would like the gateway to support multi-currencies (provided, of course that the website owner has the correct set-up but in Cubecart and in Systempay). Where I am struggling is on how to retrieve the exchange rates, which we have in Cubecart's admin panel. I have tried the following, all of them staying empty: $currency_records = $GLOBALS['db']->select('CubeCart_curren
  6. Hi everyone, I am developping a plugin with the aim to interface my Cubecart-powered website to a French PSP called Systempay. All works good, and I am about to publish. However, for a reason which I ignore, after payment, transactions are systematically logged twice. The problem is specific to my plugin Systempay (as you can see from the transaction logs enclosed, Paypal Commerce and Print Order Form work all right). I believe the problem is somewhere around line 163 of my call function: $order->logTransaction($transData); But what really puzzles me is that,
  7. Thanks for your heads-up. I have tried a few things which did not work, only to later find out that, in my soft the order ID is used as a key for nearly everything (see picture enclosed). The problem is, in that call() function I get the order ID back from the payment gateway message, and hence it must be defined with its own syntax. In the very case of Systempay that means: $cart_order_id = sanitizeVar($_REQUEST['vads_order_id']); And that's what I got wrong all the way. Now everything works, not only I have the transaction in the logs, but the order status is updated, and everythin
  8. Hi, Thanks for the heads-up above, that's good to know. I tried the above and it didn't work, unfortunately. As I was afraid it may be because $_REQUEST['transId'] is empty, I identified seven characteristics of transData present in the "Print Order Form" gateway (which correctly logs transactions made on the website I am developping) and tried hard-coding them. It gives a code like the below: $transData['customer_id'] = "Guillaume"; $transData['gateway'] = "Systempay"; $transData['order_id'] = "1234"; $transDat
  9. Hi, The below worked indeed. Thanks a lot for your help, I've adapted it and added it to my code! $currency_records = $GLOBALS['db']->select('CubeCart_currency','iso',array('code' => "AUD")); if ($currency_records !== false) $currencyISO['AUD'] = $currency_records[0]['iso'];
  10. I've tried the above, but I am afraid my code does not compile. I have a few questions: Why do we need to define a Tax object for that? Isn't it just about calling a Cubecart database with a key (e.g. "EUR") to retrieve a value ("978")? In the above, what exactly disappears after the below instruction? In particular, is the $currencyIso['AUD'] still defined after that? (I have tried putting the unset at the very end of my code, but it still did not compile unset($myTaxObject); Would we have a description somewhere of the database CubeCart_currencies? I believe I haven't
  11. Hi, My admin page unfortunately is in French, but I believe the below is what you are about. I have several payment gateways (Print Order Form, Paypal Commerce, Systempay) offered on the website, and transactions (and orders) made with Systempay are indeed never reported here... Which I believe is an interesting finding. Looking again at the soft, I am under the impression that the instruction on line 179 $order->logTransaction($transData); is therefore probably not executed? However, I checked again changing the redirection address, and am 100% sure that the call() fun
  12. Hi, Thanks a lot for your support. I am absolutely sure the call() method is executed and we get into the if loop checking the payment is authorized. I tested this by changing the URL we redirect to (see the last version of my file, where in the if loop I define the URL to redirect to, while as you suggested earlier, the httpredir command is only executed at the very end). Enclosed are the logs (Cubecart debug mode) appearing below the page, after payment. Was it these logs you were about? The order ID in this occurence is 210403-223854-8239. I did not find anyting meaningful with re
  13. Hi, Really appreciate your help! However, I have tried the following (the full soft is enclosed to this message), and the order and payment statuses still seem to be ignored. I fully agree with your remark on the order status (complete means it has been shipped), but for now I simply wanted to test using a status which is different enough from pending, so that I can clearly identify if my instruction is applied or not (and unfortunately it is not): $redirection = $GLOBALS['storeURL'].'/index.php'; if($_REQUEST['vads_trans_status'] == "AUTHORISED"){
  14. Hello, I am currently working on developping a new gateway to interface with Systempay, and would like to make it support several currencies (provided of course, that the website of the subscriber supports it). As such, the idea would be to rely on Cubecart's currency conversion tables, and convert the amount and change the currency before approaching the gateway (Systempay). I do not want to let Systempay do the currency conversion (because if they do, any mark-up goes to them). However, as for many gateways, it expects the numerical currency code in the request. This led me to define
  15. Hello, I am developping a new payment gateway, aiming to interface with Systempay payment system. However, even though the payment is accepted, I don't manage to set to the correct status neither the order (which would be ORDER_PROCESS or ORDER_COMPLETE) nor the payment (PAYMENT_SUCCESS). The orcder status stays in ORDER_PENDING I have a piece of software in gateway.class.php (lines 166 and 167), inside an if loop (lines 162 to 167) which I know we get into. Indeed, the httpredir command on line 163 is executed. Am I gettng the below totally wrong? if($_REQUEST['vad
  16. Hi, I did what you mentioned, activating debug mode and checking the logs. I have tried instanciating the following: $GLOBALS['smarty']->getTemplateVars('CURRENT_CURRENCY'); tpl_vars['CURRENT_CURRENCY']->value['exchange_rate']; $CURRENT_CURRENCY[value]; //as I saw from the logs (when updating the exchange rate), that exchange rate variable goes in a field called value All of which are empty... When I try $GLOBALS['tax']->priceFormat(), my file does not execute. The good news is that I manage to retrieve the currency the user selected, in
  17. That was my mistake, and for those who might be interested, to have this function call, you must ensure the call-back URL is indeed yourStoreUrl/modules/gateway/Yourgatewaymodule/return.php I had set up yourStoreUrl/return.php and the call() function was totally ignored.
  18. Enclosed are the logs I am getting in the debug mode. I can indeed see the GBP currency retrieved. However, I see no trace of the exchange rate. My assumption is that this currency characteristic (the exchange rate is not retrieved unless my piece of software especially requests this). Any hint on how I could retrieve it? Logs multi-currency.txt
  19. Hi, I actually manage to display the currency selected by the customer with: $GLOBALS['session']->get('currency', 'client') Would you know with which function I could call the corresponding exchange rate from that currency to the default one (i.e. the rate which is displayed in my Cubecart settings)? Guillaume
  20. Hi, Cheers for the advice. Unfortunately the first line prevents my soft from executing, while on the second one, the variable $exchange_rate ends up being empty. Is there any thing I shall do beforehand (e.g. any import I shall do)? In regards to your last remark, I actually intend to use this piece of code in the gateway code itself. So I'm not sure if that's wise. I'm guessing that in the cart attributes, we should have both the default currency and the currency the user chose, no? Because that's displayed to the user even before we execute any payment call? Thanks in advance
  21. Hi, I've developped a plug-in for Systempay as a payment method. Nothing too fancy here, the form they expect is fairly standard (currency code, amount, etc.) However, I want to offer the user the possibility to change the currency (if the website of course allows it). I try to retrieve the exchange rate from Cubecart's admin with: $exchange_rate = tpl_vars['CURRENT_CURRENCY'] (see gateway.class.php line 97) But that value is always empty. I believe I am calling the variable in a wrong manner. But could anyone guide me on how to retrieve it? Cheers, Guillaume S
  22. Dear all, I am developping a payment plugin (zip enclosed). Similarly to many payment plug-in, on the main file I have a gateway.class.php file with a function "call()". As far as I understood (but maybe I understood incorrectly), this function intends to do some post-processing after the payment request is sent. However, for a reason which I ignore, in my plug-in, that function call() is never called at all. I know it isn't called, because I have tried inputting the following instruction as a first instruction: $GLOBALS['cart']->clear(), and the cart is never emptied, no matter t
  23. All sorted - the option with {if $MODULE.mode == 'TEST'} selected="selected"{/if} works indeed, I simply had forgotten to empty the cache before trying..
  24. Dear all, I am new here, so apologises if I am stating anything obvious. I am developping a payment plugin, which I installed in my Cubecart project. In the admin panel where I set up the parameters of the plugin, I have several text fields (e.g. "test certificate") and drop-down lists (e.g. "mode") with options ("test", "prod"). These parameters are dealt with by the file skin/admin/index.tpl. While my software perfectly understands any value taken from the text field, it completely fails to understand the drop-down lists. It ignores any value I input on the admin panel. Here b
×
×
  • Create New...