Skip to content

Commit

Permalink
Fix samdays - on version v1.4.30
Browse files Browse the repository at this point in the history
  • Loading branch information
dummyntp committed Jan 17, 2023
1 parent ffcfcd3 commit 551caad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion 1.7.7/mobilpay_cc/controllers/front/betavalidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public function postProcess()
$IpnOrderIdParts = explode('#', $objPmReq->orderId);
$realOrderId = intval($IpnOrderIdParts[0]);
$lockerId = intval($IpnOrderIdParts[1]);
$lockerName = strval($IpnOrderIdParts[2]);
$lockerAddress = strval($IpnOrderIdParts[3]);
$cart = new Cart($realOrderId);
$customer = new Customer((int)$cart->id_customer);

Expand Down Expand Up @@ -141,7 +143,7 @@ public function postProcess()
*/

if($order_id > 0) {
$sql = "INSERT INTO "._DB_PREFIX_."sameday_order_locker ( id_order, id_locker ) values( '$order_id', '$lockerId' )";
$sql = "INSERT INTO "._DB_PREFIX_."sameday_order_locker ( id_order, id_locker, address_locker, name_locker ) values( '$order_id', '$lockerId', '$lockerAddress', '$lockerName' )";
Db::getInstance()->execute($sql);
}
}
Expand Down
6 changes: 4 additions & 2 deletions 1.7.7/mobilpay_cc/mobilpay_cc.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,16 @@ public function hookPaymentOptions($params)

try {
/**
* Locker ID
* Locker Info
*/
$lockerId = (int)isset($_COOKIE['samedaycourier_locker_id']) ? $_COOKIE['samedaycourier_locker_id'] : 0;
$lockerName = (int)isset($_COOKIE['samedaycourier_locker_name']) ? $_COOKIE['samedaycourier_locker_name'] : null;
$lockerAddress = (int)isset($_COOKIE['samedaycourier_locker_address']) ? $_COOKIE['samedaycourier_locker_address'] : null;

$objPmReqCard = new Mobilpay_Payment_Request_Card();
$objPmReqCard->signature = Configuration::get('MPCC_SIGNATURE');

$objPmReqCard->orderId = intval($params['cart']->id) . '#' .$lockerId.'#'. time();
$objPmReqCard->orderId = intval($params['cart']->id) . '#' .$lockerId.'#'.$lockerName.'#' .$lockerAddress.'#'. time();
$objPmReqCard->returnUrl = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT,'UTF-8') . __PS_BASE_URI__ . 'index.php?controller=order-confirmation?key=' . $customer->secure_key . '&id_cart=' . intval($params['cart']->id) . '&id_module=' . intval($this->id);


Expand Down

0 comments on commit 551caad

Please sign in to comment.