Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
luchaos committed Feb 12, 2020
2 parents 8ba5ddd + 301945a commit 3cd8d94
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

## Unreleased

## v1.4.0 (2020-02-12)
### Added
- Gateway callback validation
### Changed
- Remove order status changes from gateway response handling - handled in callback
- Remove superfluous payment gateway response error output
### Fixed
- Missing cc input overflow obfuscating border
- CCV -> CVV typo

## v1.3.1 (2020-01-20)
### Fixed
- Postback callback URL card type assignment
Expand Down
2 changes: 1 addition & 1 deletion build.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* extension source version
*/
$version = '1.3.1';
$version = '1.4.0';

/**
* dist filename
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ public function confirm()
}

if ($paymentResult->hasErrors()) {
$this->processFailure($this->order, $paymentResult->getFirstError());
$this->processFailure($this->order);
}

if ($paymentResult->isSuccess()) {
// $gatewayReferenceId = $paymentResult->getReferenceId();
switch ($paymentResult->getReturnType()) {
case TransactionResult::RETURN_TYPE_ERROR:
$this->processFailure($this->order, $paymentResult->getFirstError());
$this->processFailure($this->order);
break;
case TransactionResult::RETURN_TYPE_REDIRECT:
/**
Expand Down Expand Up @@ -229,14 +229,11 @@ public function confirm()
$this->processFailure($this->order);
}

private function processFailure($order, $errors = null)
private function processFailure($order)
{
if ($order['order_status_id'] == self::PENDING) {
$this->model_checkout_order->addOrderHistory($order['order_id'], self::FAILED);
$this->session->data['error'] = $this->language->get('order_error');
if (!empty($errors)) {
$this->session->data['error'] = $errors;
}
$this->response->redirect($this->url->link('checkout/checkout'));
}
}
Expand Down Expand Up @@ -300,20 +297,17 @@ public function response()
$cancelled = !empty($_REQUEST['cancelled']);
if ($cancelled) {
$this->session->data['error'] = $this->language->get('order_cancelled');
$this->updateOrderStatus($orderId, self::CANCELED);
$this->response->redirect($this->url->link('checkout/checkout'));
return;
}

$success = !empty($_REQUEST['success']);
if ($success) {
$this->updateOrderStatus($orderId, self::PROCESSING);
$this->response->redirect($this->url->link('checkout/success'));
return;
}

$this->session->data['error'] = $this->language->get('order_error');
$this->updateOrderStatus($orderId, self::FAILED);
$this->response->redirect($this->url->link('checkout/checkout'));
}

Expand All @@ -326,12 +320,12 @@ public function callback()

$client = $this->client($cardType);

// if (!$client->validateCallbackWithGlobals()) {
// if (!headers_sent()) {
// http_response_code(400);
// }
// die("OK");
// }
if (!$client->validateCallbackWithGlobals()) {
if (!headers_sent()) {
http_response_code(400);
}
die("OK");
}

$callbackResult = $client->readCallback(file_get_contents('php://input'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

$_['card_holder'] = 'Card Holder';
$_['card_number'] = 'Card Number';
$_['card_ccv'] = 'CCV';
$_['card_cvv'] = 'CVV';
$_['card_expiry_month'] = 'Expiry Month';
$_['card_expiry_year'] = 'Expiry Year';

Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<div class="col-md-8">
<div class="form-group">
<label class="control-label">{{ card_number }}</label>
<div class="form-control" id="payment_gateway_cloud_seamless_card_number" style="padding: 0"></div>
<div class="form-control" id="payment_gateway_cloud_seamless_card_number" style="padding: 0; overflow: hidden"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="control-label">{{ card_ccv }}</label>
<div class="form-control" id="payment_gateway_cloud_seamless_cvv" style="padding: 0"></div>
<label class="control-label">{{ card_cvv }}</label>
<div class="form-control" id="payment_gateway_cloud_seamless_cvv" style="padding: 0; overflow: hidden"></div>
</div>
</div>
</div>
Expand Down

0 comments on commit 3cd8d94

Please sign in to comment.