Skip to content

Commit

Permalink
Merge pull request #528 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 4.1.0
  • Loading branch information
candemiralp authored Aug 2, 2024
2 parents a7b2473 + 4d8e346 commit eca395a
Show file tree
Hide file tree
Showing 14 changed files with 169 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The plugin integrates card component (Secured Fields) using Adyen Checkout for a
- Apple Pay
- Bancontact
- Blik
- Billie
- Clearpay
- Dotpay
- Electronic Payment Service (EPS)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
],
"description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen",
"version": "4.0.0",
"version": "4.1.0",
"type": "shopware-platform-plugin",
"license": "MIT",
"require": {
Expand Down
24 changes: 22 additions & 2 deletions src/AdyenPaymentShopware6.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ public function update(UpdateContext $updateContext): void
if (\version_compare($currentVersion, '3.15.0', '<')) {
$this->updateTo3150($updateContext);
}

if (\version_compare($currentVersion, '4.1.0', '<')) {
$this->updateTo410($updateContext);
}
}

private function addPaymentMethod(PaymentMethods\PaymentMethodInterface $paymentMethod, Context $context): void
Expand Down Expand Up @@ -361,8 +365,8 @@ private function updateTo350(UpdateContext $updateContext): void
{
//Version 3.5.0 introduces Bancontact mobile
foreach ([
new PaymentMethods\BancontactMobilePaymentMethod()
] as $method) {
new PaymentMethods\BancontactMobilePaymentMethod()
] as $method) {
$this->addPaymentMethod(
$method,
$updateContext->getContext()
Expand Down Expand Up @@ -461,6 +465,22 @@ private function updateTo3150(UpdateContext $updateContext): void
}
}

private function updateTo410(UpdateContext $updateContext): void
{
/* Version 4.1.0 introduces following payment method.
* Billie
*/
$this->addPaymentMethod(
new PaymentMethods\BilliePaymentMethod(),
$updateContext->getContext()
);
$this->setPaymentMethodIsActive(
true,
$updateContext->getContext(),
new PaymentMethods\BilliePaymentMethod()
);
}

/**
* @param UpdateContext $updateContext
* @param string $paymentMethodHandler
Expand Down
37 changes: 37 additions & 0 deletions src/Handlers/BilliePaymentMethodHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php declare(strict_types=1);
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment Module
*
* Copyright (c) 2021 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
* Author: Adyen <[email protected]>
*/

namespace Adyen\Shopware\Handlers;

class BilliePaymentMethodHandler extends AbstractPaymentMethodHandler
{
public static bool $isOpenInvoice = true;
public static bool $supportsManualCapture = true;
public static bool $supportsPartialCapture = true;

public static function getPaymentMethodCode()
{
return 'klarna_b2b';
}
}
87 changes: 87 additions & 0 deletions src/PaymentMethods/BilliePaymentMethod.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php declare(strict_types=1);
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment Module
*
* Copyright (c) 2021 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
* Author: Adyen <[email protected]>
*/

namespace Adyen\Shopware\PaymentMethods;

use Adyen\Shopware\Handlers\BilliePaymentMethodHandler;

class BilliePaymentMethod implements PaymentMethodInterface
{

/**
* @inheritDoc
*/
public function getName(): string
{
return 'Billie';
}

/**
* @inheritDoc
*/
public function getDescription(): string
{
return 'Buy Now Pay Later with Billie';
}

/**
* @inheritDoc
*/
public function getPaymentHandler(): string
{
return BilliePaymentMethodHandler::class;
}

/**
* @inheritDoc
*/
public function getGatewayCode(): string
{
return 'ADYEN_KLARNA_B2B';
}

/**
* @inheritDoc
*/
public function getTemplate(): ?string
{
return null;
}

/**
* @inheritDoc
*/
public function getLogo(): string
{
return 'billie.png';
}

/**
* @inheritDoc
*/
public function getType(): string
{
return 'redirect';
}
}
3 changes: 2 additions & 1 deletion src/PaymentMethods/PaymentMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class PaymentMethods
MbwayPaymentMethod::class,
VippsPaymentMethod::class,
MobilePayPaymentMethod::class,
OpenBankingPaymentMethod::class
OpenBankingPaymentMethod::class,
BilliePaymentMethod::class
];
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class ConfirmOrderPlugin extends Plugin {
paymentMethodsConfiguration: {
card: {
hasHolderName: true,
holderNameRequired: true,
clickToPayConfiguration: {
merchantDisplayName: merchantAccount,
shopperEmail: shopperDetails.shopperEmail
Expand Down Expand Up @@ -521,6 +522,10 @@ export default class ConfirmOrderPlugin extends Plugin {
},
onSubmit: function(state, component) {
if (state.isValid) {
if (isOneClick) {
state.data.paymentMethod.holderName = paymentMethod.holderName ?? '';
}

let extraParams = {
stateData: JSON.stringify(state.data)
};
Expand Down
5 changes: 3 additions & 2 deletions src/Resources/app/storefront/src/configuration/adyen.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

export default {
updatablePaymentMethods: [
'scheme', 'ideal', 'sepadirectdebit', 'oneclick', 'dotpay', 'bcmc', 'bcmc_mobile', 'blik', 'eps', 'facilypay_3x',
'scheme', 'ideal', 'sepadirectdebit', 'oneclick', 'dotpay', 'bcmc', 'bcmc_mobile', 'blik', 'klarna_b2b', 'eps', 'facilypay_3x',
'facilypay_4x', 'facilypay_6x', 'facilypay_10x', 'facilypay_12x', 'afterpay_default', 'ratepay',
'ratepay_directdebit', 'giftcard', 'paybright', 'affirm', 'multibanco', 'mbway', 'vipps', 'mobilepay',
'wechatpayQR', 'wechatpayWeb', 'paybybank'
Expand Down Expand Up @@ -155,6 +155,7 @@ export default {
'vipps': 'handler_adyen_vippspaymentmethodhandler',
'affirm': 'handler_adyen_affirmpaymentmethodhandler',
'paybright': 'handler_adyen_paybrightpaymentmethodhandler',
'paybybank': 'handler_adyen_openbankingpaymentmethodhandler'
'paybybank': 'handler_adyen_openbankingpaymentmethodhandler',
'klarna_b2b': 'handler_adyen_billiepaymentmethodhandler'
}
}
4 changes: 4 additions & 0 deletions src/Resources/config/services/payment-handlers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@
parent="Adyen\Shopware\Handlers\AbstractPaymentMethodHandler">
<tag name="shopware.payment.method.async"/>
</service>
<service id="Adyen\Shopware\Handlers\BilliePaymentMethodHandler"
parent="Adyen\Shopware\Handlers\AbstractPaymentMethodHandler">
<tag name="shopware.payment.method.async"/>
</service>
<service id="Adyen\Shopware\Handlers\GivexGiftCardPaymentMethodHandler"
parent="Adyen\Shopware\Handlers\AbstractPaymentMethodHandler">
<tag name="shopware.payment.method.async"/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

0 comments on commit eca395a

Please sign in to comment.