Skip to content

Commit

Permalink
Merge pull request #38 from thelia-modules/2.1.3
Browse files Browse the repository at this point in the history
NVP messages sent with POST
  • Loading branch information
roadster31 committed May 2, 2018
2 parents ad0034d + 3cf9b55 commit 526dac5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
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
1 change: 1 addition & 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 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"}}

0 comments on commit 526dac5

Please sign in to comment.