Jump to content

quochuy

Members
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • First Name
    Quoc Huy
  • Last Name
    Nguyen Dinh

Recent Profile Visitors

146 profile views

quochuy's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Have you added the CURL code change for the paypalSdk.php I mentioned above?
  2. Yet another bug with this module. Now that it seems to be working, I made a test payment and at step 4 from the cart checkout, when select Paypal as method then proceed with the payment, the button takes me to /module/paypal/ecInit?credit_card=0 and then goes back to the checkout page. With some debug output I saw that the module was passing NULL as currency to Paypal API which does not like it. The reason for that NULL value is modules/paypal/classes/MethodEC.php in the init() method, near the top: $currency = $module->getCurrency($context->cart->id_currency); Which is then used lower: $items[] = array( 'quantity' => 1, 'name' => $paypal->l('Discount : ').$discount['name'], 'price' => $price_discount, 'currency' => $currency->iso_code, 'description' => strip_tags($discount['description']), 'tax' => $tax_discount, ); The problem is getCurrency() is coming from /classes/PaymentModule.php And that method is returning an array of more than one currency (at least in my case because my shop uses two currencies). However, the code above is expecting a single currency and thus $currency->iso_code returns null. The name of the function is getCurrency, so one expects this to return a single currency not multiple... Because I don't know the impact of changing that, I made a fix in MethodEC.php instead. So I just replaced: $currency = $module->getCurrency($context->cart->id_currency); With this: $currencies = $module->getCurrency($context->cart->id_currency); foreach ($currencies as $availableCurrency) { if ((int)$context->cart->id_currency === (int) $availableCurrency['id_currency']) { $availableCurrency['id'] = $availableCurrency['id_currency']; $currency = (object) $availableCurrency; break; } } Then do the same in the validation() method, replace: $currencies = $paypal->getCurrency($context->currency->id); with this: $currencies = $paypal->getCurrency($context->currency->id); foreach ($currencies as $availableCurrency) { if ((int)$context->cart->id_currency === (int) $availableCurrency['id_currency']) { $availableCurrency['id'] = $availableCurrency['id_currency']; $currency = (object) $availableCurrency; break; } }
  3. Go in Payment > Preferences and make sure you have selected Paypal where you need it.
  4. Paypal is enforcing TLS v1.2 on their sandbox API, so I believe your PayPal module would be affected too if the user decided to enable Paypal Sandbox on a server with older version of the libraries (OpenSSL, curl and PHP) that don't support TLS v1.2
  5. Ubuntu 14.04 PHP 5.5.9 curl 7.35.0 libcurl 7.35.0 OpenSSL/1.0.1f Your versions seem OK, so maybe try adding this line: curl_setopt ($curl, CURLOPT_SSLVERSION, 6); To this file: modules/paypal/sdk/PaypalSDK.php to the method makeCall() Just before the line that contains curl_exec(....) This will force PHP Curl to use TLS v1.2 Also few lines under curl_exec(...) you will see a commented out line, uncomment that line, next time you update your paypal settings it should show you what was the error curl has encountered.
  6. I got it fixed by updating opeenssl, curl and PHP as explained above. I now don't get the error messages and get this confirmation that Paypal is now OK Your PayPal account is currently configured to accept payments on the Sandbox (test environment). Any transaction will be fictitious. Disable the option to accept actual payments (production environment) and log in with your PayPal credentials
  7. Looks like it's due to Paypal requiring TLS 1.2 and your openssl/php/curl might not support it. You need: openssl v1.0.1+ php v5.5.19+ curl v7.34+ If all versions are OK then try adding this to the file: modules/paypal/sdk/PaypalSDK.php to the method makeCall() curl_setopt ($curl, CURLOPT_SSLVERSION, 6);
  8. I'm getting this same issue with PS 1.7.1.1 and setting "separate attributes anchor" to "-" didn't work for me.
  9. This is a better fix. If you applied my suggestion above, revert it back then for Nginx rewrite, add the conf below. Note: I've install prestashop in a sub-directory of my web root. # legacy Prestashop location ~ ^(/prestashop-directory/.*\.php)(/.*)$ { fastcgi_param SCRIPT_NAME $1; fastcgi_param PATH_INFO $2; try_files $uri $uri/ $1?$args; }
  10. On v1.7.1.1 in the file classes/Link.php At line 698 Remove the exclamation mark from "if (!$redirectLegacy) {" That does not solve everything though, now the page shows up but won't display any product...
×
×
  • Create New...