Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bp 3748 pay pal error can't ship to this location (choose another address) #1045

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a453841
BP-3684-Add-payment-method-Blik-Magento-2
AlbinaBaraliu Aug 21, 2024
41a3cc3
code consistency
AlbinaBaraliu Aug 21, 2024
88ea81f
BP-3709-Change "Riverty/Afterpay" logo to the new "Riverty" logo (Mag…
SandervdHulst Aug 28, 2024
e3baca9
BP-3709-Change "Riverty/Afterpay" logo to the new "Riverty" logo (Mag…
SandervdHulst Aug 28, 2024
0add818
Apply logo changes from media repository
SandervdHulst Aug 28, 2024
9b1ca60
Merge pull request #1031 from buckaroo-it/BP-3709-Change-Riverty/Afte…
SandervdHulst Aug 28, 2024
95049f9
BP-3727-Increased payment method logo size for enhanced visibility an…
SandervdHulst Aug 28, 2024
23c38ac
Merge pull request #1032 from buckaroo-it/BP-3727-Increased-payment-m…
SandervdHulst Aug 28, 2024
f3ffc4c
hyva checkout fee calculation
vegimcarkaxhija Sep 2, 2024
6beea0f
hyva checkout fee calculation
vegimcarkaxhija Sep 2, 2024
e802b4a
added web as a refund channel
AlbinaBaraliu Sep 3, 2024
5f59ce3
Apply logo changes from media repository
AlbinaBaraliu Sep 3, 2024
e646253
remove Buckaroo from label
vegimcarkaxhija Sep 3, 2024
55354f8
Apply logo changes from media repository
vegimcarkaxhija Sep 4, 2024
d769fc3
Apply logo changes from media repository
vegimcarkaxhija Sep 4, 2024
6d56365
Merge pull request #1035 from buckaroo-it/BP-3740-Remove-the-word-Buc…
vegimcarkaxhija Sep 4, 2024
6e0520d
Merge pull request #1036 from buckaroo-it/BP-3739-Improve-Buckaroo-fe…
vegimcarkaxhija Sep 4, 2024
9a358cf
Merge branch 'refs/heads/develop' into BP-3684-Add-payment-method-Bli…
vegimcarkaxhija Sep 4, 2024
af26fee
removed Buckaroo from Blik title
vegimcarkaxhija Sep 4, 2024
3eb80a1
Merge pull request #1020 from buckaroo-it/BP-3684-Add-payment-method-…
vegimcarkaxhija Sep 4, 2024
5562de7
unregister current invoice after transaction is saved
AlbinaBaraliu Sep 4, 2024
997a104
Merge pull request #1037 from buckaroo-it/BP-3659-Shipment-Importer-i…
AlbinaBaraliu Sep 4, 2024
4a451c7
BP-3730-Update, test & release (1.49.4)
SandervdHulst Sep 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Copy payment method icons
run: |
cd "${{ github.workspace }}/Media/Payment methods/SVG/"
rm -f ideal-qr.svg knaken.svg paylink.svg paybybank.svg pos-nfc.svg riverty.svg
rm -f ideal-qr.svg knaken.svg paylink.svg paybybank.svg pos-nfc.svg
cd ${{ github.workspace }}/Media
cp -R "Payment methods/SVG/." ${{ github.workspace }}/view/base/web/images/svg/
- name: Copy creditcards icons
Expand Down
5 changes: 3 additions & 2 deletions Api/PaypalExpressQuoteCreateInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
namespace Buckaroo\Magento2\Api;

use Buckaroo\Magento2\Api\Data\PaypalExpress\ShippingAddressRequestInterface;
use Buckaroo\Magento2\Api\Data\QuoteCreateResponseInterface;

interface PaypalExpressQuoteCreateInterface
{
Expand All @@ -31,8 +32,8 @@ interface PaypalExpressQuoteCreateInterface
* @param \Buckaroo\Magento2\Api\Data\PaypalExpress\ShippingAddressRequestInterface $shipping_address
* @param string $page
* @param string|null $order_data
* @return \Buckaroo\Magento2\Api\Data\PaypalExpress\QuoteCreateResponseInterface
*/
* @return QuoteCreateResponseInterface
*/
public function execute(
ShippingAddressRequestInterface $shipping_address,
string $page,
Expand Down
4 changes: 2 additions & 2 deletions Block/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public function getPayPerEmailMethod()
public function getPaymentLogo(string $method): string
{
$mappings = [
"afterpay2" => "svg/afterpay.svg",
"afterpay20" => "svg/afterpay.svg",
"afterpay2" => "svg/riverty.svg",
"afterpay20" => "svg/riverty.svg",
"capayablein3" => "svg/in3.svg",
"capayablepostpay" => "svg/in3.svg",
"creditcard" => "svg/creditcards.svg",
Expand Down
3 changes: 2 additions & 1 deletion Block/Widget/Button/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class Toolbar
'buckaroo_magento2_wechatpay',
'buckaroo_magento2_p24',
'buckaroo_magento2_trustly',
'buckaroo_magento2_pospayment'
'buckaroo_magento2_pospayment',
'buckaroo_magento2_blik',
];

/**
Expand Down
1 change: 1 addition & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public function getPaymentMethodsList()
['value' => 'transfer', 'label' => __('Bank Transfer')],
['value' => 'trustly', 'label' => __('Trustly')],
['value' => 'wechatpay', 'label' => __('WeChatPay')],
['value' => 'blik', 'label' => __('Blik')],
];
}

Expand Down
1 change: 1 addition & 0 deletions Model/Config/Source/PaymentMethods/AfterExpiry.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function toOptionArray()
['value' => 'wechatpay', 'label' => __('WeChatPay')],
['value' => 'p24', 'label' => __('P24')],
['value' => 'trustly', 'label' => __('Trustly')],
['value' => 'blik', 'label' => __('Blik')],
];

return $options;
Expand Down
1 change: 1 addition & 0 deletions Model/Config/Source/PaymentMethods/PayLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function toOptionArray()
['value' => 'wechatpay', 'label' => __('WeChatPay')],
['value' => 'p24', 'label' => __('P24')],
['value' => 'trustly', 'label' => __('Trustly')],
['value' => 'blik', 'label' => __('Blik')],
];

return $options;
Expand Down
5 changes: 5 additions & 0 deletions Model/Config/Source/PaymentMethods/PayPerEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ public function toOptionArray()
'value' => 'trustly',
'label' => __('Trustly'),
'code' => 'buckaroo_magento2_trustly'
],
[
'value' => 'blik',
'label' => __('Blik'),
'code' => 'buckaroo_magento2_blik'
]
];

Expand Down
87 changes: 87 additions & 0 deletions Model/ConfigProvider/Method/Blik.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact [email protected] for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\Magento2\Model\ConfigProvider\Method;

class Blik extends AbstractConfigProvider
{
const XPATH_BLIK_PAYMENT_FEE = 'payment/buckaroo_magento2_blik/payment_fee';
const XPATH_BLIK_PAYMENT_FEE_LABEL = 'payment/buckaroo_magento2_blik/payment_fee_label';
const XPATH_BLIK_ACTIVE = 'payment/buckaroo_magento2_blik/active';
const XPATH_BLIK_SUBTEXT = 'payment/buckaroo_magento2_blik/subtext';
const XPATH_BLIK_SUBTEXT_STYLE = 'payment/buckaroo_magento2_blik/subtext_style';
const XPATH_BLIK_SUBTEXT_COLOR = 'payment/buckaroo_magento2_blik/subtext_color';
const XPATH_BLIK_ACTIVE_STATUS = 'payment/buckaroo_magento2_blik/active_status';
const XPATH_BLIK_ORDER_STATUS_SUCCESS = 'payment/buckaroo_magento2_blik/order_status_success';
const XPATH_BLIK_ORDER_STATUS_FAILED = 'payment/buckaroo_magento2_blik/order_status_failed';
const XPATH_BLIK_AVAILABLE_IN_BACKEND = 'payment/buckaroo_magento2_blik/available_in_backend';

const XPATH_ALLOWED_CURRENCIES = 'payment/buckaroo_magento2_blik/allowed_currencies';

const XPATH_ALLOW_SPECIFIC = 'payment/buckaroo_magento2_blik/allowspecific';
const XPATH_SPECIFIC_COUNTRY = 'payment/buckaroo_magento2_blik/specificcountry';
const XPATH_SPECIFIC_CUSTOMER_GROUP = 'payment/buckaroo_magento2_blik/specificcustomergroup';

/**
* @var array
*/
protected $allowedCurrencies = [
'PLN'
];
/**
* @return array|void
*/
public function getConfig()
{
$paymentFeeLabel = $this->getBuckarooPaymentFeeLabel(
\Buckaroo\Magento2\Model\Method\Blik::PAYMENT_METHOD_CODE
);

return [
'payment' => [
'buckaroo' => [
'blik' => [
'paymentFeeLabel' => $paymentFeeLabel,
'subtext' => $this->getSubtext(),
'subtext_style' => $this->getSubtextStyle(),
'subtext_color' => $this->getSubtextColor(),
'allowedCurrencies' => $this->getAllowedCurrencies(),
],
],
],
];
}

/**
* @param null|int $storeId
*
* @return float
*/
public function getPaymentFee($storeId = null)
{
$paymentFee = $this->scopeConfig->getValue(
self::XPATH_BLIK_PAYMENT_FEE,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
$storeId
);

return $paymentFee ? $paymentFee : false;
}
}
103 changes: 103 additions & 0 deletions Model/Method/Blik.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact [email protected] for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/

namespace Buckaroo\Magento2\Model\Method;

class Blik extends AbstractMethod
{
/**
* Payment Code
*/
const PAYMENT_METHOD_CODE = 'buckaroo_magento2_blik';

/**
* @var string
*/
public $buckarooPaymentMethodCode = 'blik';

/**
* Payment method code
*
* @var string
*/
protected $_code = self::PAYMENT_METHOD_CODE;

/**
* {@inheritdoc}
*/
public function getOrderTransactionBuilder($payment)
{
$transactionBuilder = $this->transactionBuilderFactory->get('order');

$services = [
'Name' => 'blik',
'Action' => 'Pay',
'Version' => 0,
];

/**
* @noinspection PhpUndefinedMethodInspection
*/
$transactionBuilder->setOrder($payment->getOrder())
->setServices($services)
->setMethod('TransactionRequest');

return $transactionBuilder;
}

/**
* {@inheritdoc}
*/
public function getCaptureTransactionBuilder($payment)
{
return false;
}

/**
* {@inheritdoc}
*/
public function getAuthorizeTransactionBuilder($payment)
{
return false;
}

/**
* {@inheritdoc}
*/
public function getVoidTransactionBuilder($payment)
{
return true;
}

/**
* @param \Magento\Sales\Api\Data\OrderPaymentInterface|\Magento\Payment\Model\InfoInterface $payment
*
* @return bool|string
*/
public function getPaymentMethodName($payment)
{
return 'blik';
}

protected function getRefundTransactionBuilderChannel()
{
return 'Web';
}
}
4 changes: 3 additions & 1 deletion Model/Service/CreateInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public function createInvoiceGeneralSetting(Order $order, array $invoiceItems):

$transactionSave->save();

$this->registry->unregister('current_invoice');

$payment = $invoice->getOrder()->getPayment();

$transactionKey = (string)$payment->getAdditionalInformation(
Expand Down Expand Up @@ -225,4 +227,4 @@ public function addTransactionData($payment, $transactionKey = false, $datas = f

return $payment;
}
}
}
Loading
Loading