Skip to content

Commit

Permalink
Merge pull request #84 from SwedbankPay/hotfix/core-fix
Browse files Browse the repository at this point in the history
Remove the workaround
  • Loading branch information
olegisk authored Oct 11, 2022
2 parents 52dc562 + 493a1ae commit 1f965d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 5.2.1
Changed
- Removed the workaround in WC_Adapter

Version 5.2.0
Added
- Added method `isCreditMemoExist($transactionId)`
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"email": "asbjorn.ulsberg@payex.com"
}
],
"version": "5.2.0",
"version": "5.2.1",
"keywords": [
"SwedbankPay",
"core",
Expand Down
5 changes: 0 additions & 5 deletions src/SwedbankPay/Core/Adapter/WC_Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ public function getPlatformUrls($orderId)
$paymentUrl = add_query_arg(array('payment_url' => '1'), wc_get_checkout_url());
}

// Workaround: don't set paymentUrl if there's "pay_for_order" page
if (isset($_GET['pay_for_order'], $_GET['key'])) {
$paymentUrl = null;
}

if ($this->gateway->is_new_credit_card) {
return array(
PlatformUrlsInterface::COMPLETE_URL => add_query_arg(
Expand Down
6 changes: 3 additions & 3 deletions src/SwedbankPay/Core/Library/Methods/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ trait Checkout
*
* @param mixed $orderId
* @param string|null $consumerProfileRef
* @param bool $generateRecurrenceToken
* @param bool $generateToken
*
* @return Response
* @throws Exception
Expand All @@ -48,7 +48,7 @@ trait Checkout
public function initiatePaymentOrderPurchase(
$orderId,
$consumerProfileRef = null,
$generateRecurrenceToken = false
$generateToken = false
) {
/** @var Order $order */
$order = $this->getOrder($orderId);
Expand Down Expand Up @@ -118,7 +118,7 @@ public function initiatePaymentOrderPurchase(
->setDescription($order->getDescription())
->setUserAgent($order->getHttpUserAgent())
->setLanguage($order->getLanguage())
->setGenerateRecurrenceToken($generateRecurrenceToken)
->setGenerateRecurrenceToken($generateToken)
->setDisablePaymentMenu(false)
->setUrls($urlData)
->setPayeeInfo($payeeInfo)
Expand Down

0 comments on commit 1f965d7

Please sign in to comment.