Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Classes/NVP/PaypalNvpMessageSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

namespace Paypal\Classes\NVP;

use Paypal\Classes\NVP\Operations\PaypalNvpOperationInterface;
use Paypal\Classes\API\PaypalApiManager;
use Paypal\Classes\NVP\Operations\PaypalNvpOperationInterface;

/**
* Class PaypalNvpMessageSender
Expand Down Expand Up @@ -72,10 +72,19 @@ public function send()
{
$paypalApiManager = new PaypalApiManager();

$url = $paypalApiManager->getApiUrl() . '?' . $this->message;
$url = $paypalApiManager->getApiUrl();

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->message);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

return $response;
Expand Down
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>2.1.2</version>
<version>2.1.3</version>
<author>
<name>Thelia</name>
<email>info@thelia.net</email>
Expand Down
9 changes: 9 additions & 0 deletions Controller/PaypalResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function ok($order_id)
$payerid,
PaypalApiManager::PAYMENT_TYPE_SALE,
$token,
// FIXME This URL is not used in PaypalNvpOperationsDoExpressCheckoutPayment, and has no defined route
URL::getInstance()->absoluteUrl("/module/paypal/listen"),
PaypalApiManager::BUTTON_SOURCE
);
Expand All @@ -114,6 +115,14 @@ public function ok($order_id)

$this->logger->logTransaction($response);

// Store correlation ID in the order
if (isset($response['CORRELATIONID'])) {
$order
->setTransactionRef($response['CORRELATIONID'])
->save();
;
}

// In case of pending status, log the reason to get usefull information (multi-currency problem, ...)
if (isset($response['ACK']) && $response['ACK'] === "Success" &&
isset($response['PAYMENTINFO_0_PAYMENTSTATUS']) && $response['PAYMENTINFO_0_PAYMENTSTATUS'] === "Pending") {
Expand Down
2 changes: 1 addition & 1 deletion templates/email/default/paypal-payment-confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{block name="email-content"}
<p>
<a href="{url path="/account"}">
{intl l="View this order in your account at %shop_name" shop_name={config key="store_name"}}
{intl d='paypal.email.default' l="View this order in your account at %shop_name" shop_name={config key="store_name"}}
</a>
</p>
<p>{intl d='paypal.email.default' l='Thank you again for your purchase.'}</p>
Expand Down
10 changes: 5 additions & 5 deletions templates/email/default/paypal-payment-confirmation.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{intl d='paypal.email.default' l='Dear customer'},

<br>
{intl d='paypal.email.default' l='This is a confirmation of the payment of your order %ref via Paypal on our shop.' ref=$order_ref}

<br>
{intl d='paypal.email.default' l='Your invoice is now available in your customer account at %url.'} url={config key="url_site"}}

<br>
{intl d='paypal.email.default' l='Thank you again for your purchase.'}

{intl d='paypal.email.default' l='The %store_name team.' store_name={config key="store_name"}}
<br>
{intl d='paypal.email.default' l='The %store_name team.' store_name={config key="store_name"}}