Skip to content

Commit

Permalink
The plugin now checks the correct currency amount
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Pieters committed May 25, 2016
1 parent 009c814 commit 85fae7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion paynl_paymentmethods/includes/classes/Pay/Api/Info.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Pay_Api_Info extends Pay_Api {
*
* @var string The version of the api
*/
protected $_version = 'v3';
protected $_version = 'v5';
/**
*
* @var string The controller of the api
Expand Down
13 changes: 5 additions & 8 deletions paynl_paymentmethods/includes/classes/Pay/Helper/Transaction.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public static function processTransaction($transactionId) {
$apiInfo->setTransactionId($transactionId);

$result = $apiInfo->doRequest();
$transactionAmount = $result['paymentDetails']['paidAmount'];


$transactionAmount = $result['paymentDetails']['paidCurrenyAmount'];

$stateId = $result['paymentDetails']['state'];

Expand Down Expand Up @@ -135,14 +137,9 @@ public static function processTransaction($transactionId) {

$paymentMethodName = $module->getPaymentMethodName($transaction['option_id']);


$paidAmount = $transactionAmount / 100;

// als de valuta afwijkt, sturen we het originele orderbedrag mee als betaald bedrag, omdat anders prestashop in payment error schiet
$objCurrency = new CurrencyCore($currency);
if($objCurrency->iso_code != 'EUR'){
$paidAmount = $orderTotal+$extraFee;
} else {
$paidAmount = $transactionAmount / 100;
}


$module->validateOrderPay((int) $cart->id, $id_order_state, $paidAmount, $extraFee, $paymentMethodName, NULL, array('transaction_id' => $transactionId), (int) $currency, false, $customer->secure_key);
Expand Down
2 changes: 1 addition & 1 deletion paynl_paymentmethods/paynl_paymentmethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class paynl_paymentmethods extends PaymentModule {
public function __construct() {
$this->name = 'paynl_paymentmethods';
$this->tab = 'payments_gateways';
$this->version = '3.2.9';
$this->version = '3.3.0';
$this->_postErrors = array();
$this->module_key = '6c2f48f238008e8f68271f5e4763d308';

Expand Down

0 comments on commit 85fae7b

Please sign in to comment.