Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. I hqve solved this one a long time ago, so for anyone interested, here below is what I have done: #Calculation of several currency characteristics $currencyCode = $GLOBALS['tax']->_currency_vars['code']; #Numeric currency calculation $currency_records = $GLOBALS['db']->select('CubeCart_currency','iso',array('code' => $currencyCode)); if ($currency_records !== false) $numericalCurrency = $currency_records[0]['iso']; #Exchange rate calculation $currency_records = $GLOBALS['db']->selec
  2. Cheers, I retrieve the config version and uid with the below code - works perfectly indeed: $configxml = simplexml_load_file(__DIR__ . "/config.xml"); $module_version = $configxml->info->version; $module_uid = $configxml->info->uid;
  3. I'd very happily do this. I could even use the selected shipping product, without the need to iterate. But would we have this "3" or "5" value in a parameter? Or are you saying that this would be a prospective development for Cubecart?
  4. I could do what you recommend for shipping_type indeed. For shipping_speed and shipping_delay, I belive I do not really want to have anything specific to a given shipping company, in the payment gateway. I believe an interesting improvement in Cubecart would be either: to allow, for a given payment gateway a setting (say: shipping_speed) which could be instantiated on each and every shipping product or to allow defining such standard settings (shipping_speed, shipping_delay, etc. but not sure everyone needs the same as I do, maybe expected_delivery_datetime would sound bette
  5. I have actually just tried applying the url_encode function to the address containing the quote, and the payment provider system seems to be happy because the payment goes through. Next, I will url_encode all the variables in the array. Now one thing I am wondering is that if I send either of those, it works: $signature = hash_hmac('sha256', $concatenated_string, $certificate, true); $signature = hash_hmac('sha256', $concatenated_string, $certificate, false); $signature = base64_encode(hash_hmac('sha256', $concatenated_string, $certificate, true));
  6. Really appreciate your help. Unfortunately, I'm getting two different strings when trying what you mentioned: Expected string : [egPOUxw8gjnOnBs2weJDngpxIwVBGvTStigqFGqEknQ=] Received string : [FkGkaCo8foKTG2y/b4F/t22GrYkQjj5nmRU/a5zdWVk=] Can it be a subtlety of the hash_hmac function which we are missing?
  7. No I completely appreciate that the encoding will be totally different with or without the quote. What I am struggling to understand is that, I'm encoding a string, (say AB'CD), and the payment gateway tells me the string I shall encode is AB'CD, and: The expected encryption is: [tqMQ6eliAfYpBWPUf5E6QDTlTRxER1GQvIllzZ652xo=] While the received encryption is: [CYrNQ4ETAFfoN9xMAy+phHEopWZQbelEOJndkQJWz8k=] Where I am struggling is, that when I try (on https://www.devglan.com/online-tools/hmac-sha256-online) to encrypt AB'CD, it says that the encryption is: tqMQ6eliAfYpBWPUf5E6QD
  8. Cheers, this is really interesting. So in the file admin/index.inc.php I have added these instructions: if($_POST['module']['status'] == 1) { $code = file_get_contents(CC_ROOT_DIR.'/modules/gateway/Systempay_multi/snippet-class.display_gateways'); $GLOBALS['db']->insert('CubeCart_code_snippet', array('enabled' => 1, 'unique_id' => 'systempay-multi-gateway-display', 'description' => 'Systempay Display Multipay Option', 'hook_trigger' => 'class.cubecart.display_gateways', 'php_code' => base64_encode($code), 'version' => '1.0.0', 'author' => 'Guilla
  9. Hi, That might be more of a question on a PHP developer forum, and apologise if it's irrelevant here. I am working on developping a plug-in for a payment gateway. As part the payment gateway API, I am sending several fields (e.g. amount, currency, etc. but also some plain-text fields like delivery address). I put all these in an array.The payment gateay requires to be passed a field called "signature", which is an encryption of the concatenation of all other fields. The encryption is as the PHP code below: $signature = base64_encode(hash_hmac('sha256',$concatenated_string, $certific
  10. Hi, I just had a look at what is done in goShippo shipping module and indeed the snippet option looks promising. I understand that I shall call it from index.inc.php, but I am really in the blind on how to adapt the below (taken from goShippo): if($_POST['module']['status'] == 1) { $code = file_get_contents(CC_ROOT_DIR.'/modules/shipping/goShippo/snippet-class.order_status.php'); $GLOBALS['db']->insert('CubeCart_code_snippet', array('enabled' => 1, 'unique_id' => 'shippo-transaction-create', 'description' => 'Shippo Create Rate Transaction', 'hook_tr
  11. Hi, I believe there is no solution for this problem, but I am still raising it, just in case there is actually one, or in case Cubecart is interested in developping it. After discussing with the payment provider of the gateways I developped (Systempay), for their fraud assessment policy, they asked me to input: The shipping provider (that's easy, I get it from basket['shipping']['product'] But they also want a couple of structured data, and I wonder whether Cubecart offers a standard for that: Shipping type (which can be "delivery at address", "delivery at pi
  12. Cheers, I guess I am struggling from the very beginning, which is, getting to the config.xml file (which is in the very same folder as the gateway.class.php I am calling it from...) The glob function wouldn't really work for me as I have only one file. So I have tried getcwd() but it returns this: /home/clients/730d21bd55854ec4d0c02aa159bd4077/sites/www.temp-alerte.com, not exactly what I was after... Of course I have tried simplexml_load_file("config.xml") and simplexml_load_file("/config.xml") but none worked. I'm certainly missing something very basic here.
  13. Thanks, I've used something very similar in my code. Posting it below if anyone is interested: if ($GLOBALS['user']->getId()){ $hidden['vads_cust_id'] = $GLOBALS['user']->getId(); $hidden['vads_ext_info_guest'] = "NO"; } else { $hidden['vads_cust_id'] = $GLOBALS['user']->getGhostId(); $hidden['vads_ext_info_guest'] = "YES"; }
  14. Thanks! I got really confused that I was doing all my tests with the same user, user whom had changed the currency at some point, and hence I got always see the currency in the session parameters. But as soon as I got someone else to test my module everything failed. Sorted now, thanks!
  15. Hi, I developped two twin payment gateways which differ only by an if loop (I would have liked to avoid it, but was advised to do this way, see below link). To better manage my if loop where the modules differ, I would like, in gateway.class.php, to retrieve the module name (as defined in config.xml) and make a condition on it. In index.tpl, I use $VAL_SELF (which isn't exactly the module name, but good enough to make a condition), but I don't see how to get such data in gateway.class.php. Similarly, the payment provider would like me to send them the version of my module (as de
  • Create New...