Skip to content

Commit

Permalink
Improve compatibility with friendly URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Nov 10, 2016
1 parent 8d0ad82 commit 1f61236
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions aplazame/api/Serializers.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,35 +137,29 @@ public static function getCheckout(Cart $cart, $moduleId, $orderId)
/** @var Aplazame $aplazame */
$aplazame = ModuleCore::getInstanceByName('aplazame');

$confirmationQuery = http_build_query(array(
'fc' => 'module',
'module' => 'aplazame',
'controller' => 'confirmation',
$link = Context::getContext()->link;
$confirmationQuery = array(
'id_cart' => $cart->id,
'key' => $cart->secure_key,
));
$cancelQuery = http_build_query(array(
'fc' => 'module',
'module' => 'aplazame',
'controller' => 'cancel',
);
$cancelQuery = array(
'id_cart' => $cart->id,
'key' => $cart->secure_key,
));
$successQuery = http_build_query(array(
'controller' => 'order-confirmation',
);
$successQuery = array(
'id_cart' => $cart->id,
'id_module' => $moduleId,
'id_order' => $orderId,
'key' => $cart->secure_key,
));
);

return array(
'toc' => true,
'merchant' => array(
'confirmation_url' => __PS_BASE_URI__ . 'index.php?' . $confirmationQuery,
'cancel_url' => __PS_BASE_URI__ . 'index.php?' . $cancelQuery,
'checkout_url' => __PS_BASE_URI__ . 'index.php?controller=order-opc',
'success_url' => __PS_BASE_URI__ . 'index.php?' . $successQuery,
'confirmation_url' => $link->getModuleLink('aplazame', 'confirmation', $confirmationQuery),
'cancel_url' => $link->getModuleLink('aplazame', 'cancel', $cancelQuery),
'checkout_url' => $link->getPageLink('order-opc'),
'success_url' => $link->getPageLink('order-confirmation', null, null, $successQuery),
),
'customer' => self::getCustomer(new Customer($cart->id_customer)),
'order' => self::checkoutOrder($cart),
Expand Down

0 comments on commit 1f61236

Please sign in to comment.