Skip to content

Commit

Permalink
PIPRES-441: new payment methods added and giropay method deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
GytisZum committed Jul 3, 2024
1 parent b119af5 commit 084001d
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 80 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ prepare-zip:
cp .github/.htaccess vendor/.htaccess
rm -rf .git .docker .editorconfig .github tests .php-cs-fixer.php Makefile cypress .docker cypress.config.js cypress.env.json docker-compose*.yml .gitignore bin codeception.yml package-lock.json package.json .php_cs.dist .php-cs-fixer.dist



# Define SQL commands
SQL_COMMANDS := \
"UPDATE \`ps_configuration\` SET \`value\` = '1' WHERE \`name\` = 'PS_SSL_ENABLED';" \
"UPDATE \`ps_configuration\` SET \`value\` = '1' WHERE \`name\` = 'PS_SSL_ENABLED_EVERYWHERE';" \
"UPDATE \`ps_shop_url\` SET \`domain\` = '$(DOMAIN_NAME)' WHERE active = 1;" \
"UPDATE \`ps_shop_url\` SET \`domain_ssl\` = '$(DOMAIN_NAME)' WHERE active = 1;"
# Target to change shop URL
change-shop-url:
@echo "Executing SQL commands to change shop URL..."
docker exec -i $(DOCKER_CONTAINER_NAME) mysql -u$(MYSQL_USER) -p$(MYSQL_PASSWORD) $(MYSQL_DATABASE) -e "$(SQL_COMMANDS)"
@echo "Shop URL updated successfully."
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Receive payments from European customers with ease. Mollie provides payment meth

Choose the best payment provider available for your online PrestaShop store. Create your merchant account at [Mollie.com](https://www.mollie.com/).

Mollie supports the following payment methods: iDEAL, Credit card, Bancontact, SOFORT Banking, ING Home’Pay, Bank transfers, PayPal, KBC / CBC Payment Button, Belfius, CartaSi, Cartes Bancaires, EPS, Giropay, Klarna: Pay later, Klarna: Slice it
Mollie supports the following payment methods: iDEAL, Credit card, Bancontact, SOFORT Banking, ING Home’Pay, Bank transfers, PayPal, KBC / CBC Payment Button, Belfius, CartaSi, Cartes Bancaires, EPS, Klarna: Pay later, Klarna: Slice it

[![Build Status](https://travis-ci.org/mollie/PrestaShop.svg?branch=master)](https://travis-ci.org/mollie/PrestaShop)
[![Greenkeeper badge](https://badges.greenkeeper.io/mollie/PrestaShop.svg)](https://greenkeeper.io/)
Expand Down
5 changes: 0 additions & 5 deletions README_DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ Die Karten tragen ebenfalls das Markenzeichen von Visa.

Dies macht sie zur wichtigsten Zahlungsmethode in Österreich, die bei österreichischen Konsumenten hohe Beliebtheit genießt.

### Giropay
[Giropay](https://www.mollie.com/de/payments/giropay). Giropay ist eine der beliebtesten Überweisungsmethoden Deutschlands.

Deutsche Kunden schenken dieser Zahlungsmethode ihr Vertrauen, da sie von über 1.500 Banken landesweit unterstützt wird.

### Klarna: Rechnung
[Klarna: Rechnung](https://www.mollie.com/de/payments/klarna-pay-later). Klarna ist eine flexible Zahlungslösung, die Ihren Kunden verschiedene, flexible Zahlungsmöglichkeiten zur Verfügung stellt.

Expand Down
5 changes: 0 additions & 5 deletions README_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ Las tarjetas que comparten marca con Visa.

Esto hace que el EPS sea el principal tipo de pago por transferencia bancaria en Austria y muy popular entre los compradores austriacos.

### Giropay
[Giropay](https://www.mollie.com/es/payments/giropay). Giropay es un tipo de pago por transferencia bancaria, popular en Alemania.

Utiliza más de 1.500 bancos alemanes, lo que lo convierte en un tipo de pago confiable para los clientes alemanes.

### Klarna: Pay later
[Klarna: Pay later](https://www.mollie.com/es/payments/klarna-pay-later). Klarna es una solución de pago flexible que les permite a sus clientes diversas formas de pago flexibles.

Expand Down
5 changes: 0 additions & 5 deletions README_FR.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ Les cartes sont co-marquées avec Visa.

Devenue très populaire auprès des consommateurs autrichiens, EPS est la référence en matière de virement bancaire en Autriche.

### Giropay
[Giropay](https://www.mollie.com/fr/payments/giropay). Giropay est une méthode de paiement très populaire de virement bancaire en Allemagne.

Utilisé par plus de 15000 à travers le pays, cela en fait un moyen de paiement fiable, réputé auprès des consommateurs allemands.

### Klarna : Pay later
[Klarna : Pay later](https://www.mollie.com/fr/payments/klarna-pay-later). Klarna est une solution de paiement flexible, qui permet à vos clients des modes de paiement variés.

Expand Down
5 changes: 0 additions & 5 deletions README_NL.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ De kaarten zijn co-branded met Visa.

Dit maakt EPS de belangrijkste betaalmethode voor bankoverboekingen in Oostenrijk en zeer populair bij Oostenrijkse klanten.

### Giropay
[Giropay](https://www.mollie.com/nl/payments/giropay). Giropay is een populaire bankoverboeking betaalmethode in Duitsland.

Het maakt gebruik van meer dan 1.500 Duitse banken, waardoor het een vertrouwde betaalmethode is onder Duitse klanten.

### Klarna: Achteraf betalen
[Klarna: Achteraf betalen](https://www.mollie.com/nl/payments/klarna-pay-later). Klarna is een flexibele betaaloplossing, waarmee je je klanten diverse mogelijkheden voor uitgestelde betaling biedt.

Expand Down
2 changes: 1 addition & 1 deletion controllers/front/webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function executeWebhook(string $transactionId): void
} else {
$transaction = $this->module->getApiClient()->payments->get($transactionId);

if ($transaction->orderId) {
if ($transaction->orderId && $transaction->status !== 'expired') {
$transaction = $this->module->getApiClient()->orders->get($transaction->orderId, ['embed' => 'payments']);
}
}
Expand Down
14 changes: 1 addition & 13 deletions cypress/e2e/ps1785/03_mollie.ps1785.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,7 @@ it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => {
it('C339366: 29 Przelewy24 Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339367: 30 Giropay Checkouting [Orders API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339368: 31 Giropay Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})

it('C339369: 32 EPS Checkouting [Orders API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
Expand Down
14 changes: 1 addition & 13 deletions cypress/e2e/ps1785/05_mollie.ps1785.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,7 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => {
it('C339392: 57 Przelewy24 BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339393: 58 Giropay Checkouting [Payments API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});

it('C339395: 60 EPS Checkouting [Payments API]', () => {
cy.navigatingToThePayment()
//Payment method choosing
Expand Down
13 changes: 0 additions & 13 deletions cypress/e2e/ps8/03_mollie.ps8.PaymentTestsOrdersAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,6 @@ it('C339365: 28 Przelewy24 Checkouting [Orders API]', () => {
it('C339366: 29 Przelewy24 Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339367: 30 Giropay Checkouting [Orders API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339368: 31 Giropay Order Shipping, Refunding [Orders API]', () => {
cy.OrderRefundingShippingOrdersAPI()
})
it('C339369: 32 EPS Checkouting [Orders API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
Expand Down
13 changes: 0 additions & 13 deletions cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,6 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => {
it('C339392: 57 Przelewy24 BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339393: 58 Giropay Checkouting [Payments API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
cy.contains('giropay').click({force:true})
cy.get('.condition-label > .js-terms').click({force:true})
cy.contains('Place order').click()
cy.get('[value="paid"]').click()
cy.get('[class="button form__button"]').click()
cy.get('#content-hook_order_confirmation > .card-block').should('be.visible')
});
it('C339394: 59 Giropay BO Refunding, Partial Refunding [Payments API]', () => {
cy.OrderRefundingPartialPaymentsAPI()
});
it('C339395: 60 EPS Checkouting [Payments API]', () => {
cy.navigatingToThePaymentPS8()
//Payment method choosing
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import 'cypress-iframe';
// Cypress.Commands.add("login", (email, password) => { ... })
Cypress.Commands.add("ConfOrdersAPI1784", () => {

const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "giropay", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"];
const paymentMethods = ["applepay", "ideal", "creditcard", "in3", "klarnapaylater", "klarnapaynow", "klarnasliceit", "paypal", "banktransfer", "bancontact", "eps", "przelewy24", "kbc", "belfius", "voucher", "directdebit", "billie", "klarna", "twint", "blik", "bancomatpay"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand All @@ -59,7 +59,7 @@ Cypress.Commands.add("ConfOrdersAPI1784", () => {
})
Cypress.Commands.add("ConfPaymentsAPI1784", () => {

const paymentMethods = ["giropay", "eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"];
const paymentMethods = ["eps", "przelewy24", "kbc", "belfius", "bancontact", "creditcard", "ideal", "banktransfer", "paypal", "applepay", "twint", "blik", "bancomatpay"];

// Iterate through the paymentMethods array using forEach
paymentMethods.forEach(method => {
Expand Down
10 changes: 8 additions & 2 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Config
'ideal' => ['nl'],
'bancontact' => ['be'],
'paypal' => [],
'giropay' => ['de'],
'eps' => ['at'],
'belfius' => ['be'],
'inghomepay' => ['be'],
Expand All @@ -64,6 +63,9 @@ class Config
'ro', 'bl', 'mf', 'pm', 'sm', 'sk', 'sl', 'es', 'se', 'ch', 'gb', 'uk',
],
'mybank' => [],
'trustly' => ['at', 'de', 'ee', 'es', 'fi', 'lt', 'lv', 'nl'],
'riverty' => ['nl','be','de','at'],
'payconiq' => [],
];

const SUPPORTED_PHP_VERSION = '5.6';
Expand Down Expand Up @@ -240,6 +242,7 @@ class Config
const MOLLIE_METHOD_ID_APPLE_PAY = 'applepay';
const MOLLIE_VOUCHER_METHOD_ID = 'voucher';
const MOLLIE_in3_METHOD_ID = 'in3';
const RIVERTY = 'riverty';

const MOLLIE_VOUCHER_CATEGORY_NULL = 'null';
const MOLLIE_VOUCHER_CATEGORY_MEAL = 'meal';
Expand Down Expand Up @@ -275,6 +278,7 @@ class Config
PaymentMethod::BILLIE,
self::MOLLIE_VOUCHER_METHOD_ID,
self::MOLLIE_in3_METHOD_ID,
self::RIVERTY,
];

const PAYMENT_API_ONLY_METHODS = [
Expand All @@ -301,7 +305,6 @@ class Config
'directdebit' => 'Direct Debit',
'eps' => 'EPS',
'giftcard' => 'Giftcard',
'giropay' => 'Giropay',
'ideal' => 'iDEAL',
'inghomepay' => 'ING Homepay',
'kbc' => 'KBC',
Expand All @@ -322,6 +325,9 @@ class Config
'alma' => 'Alma',
'blik' => 'BLIK',
'klarna' => 'Pay with Klarna.',
'riverty' => 'Riverty',
'payconiq' => 'Payconiq',
'trustly' => 'Trustly',
];

const MOLLIE_BUTTON_ORDER_TOTAL_REFRESH = 'MOLLIE_BUTTON_ORDER_TOTAL_REFRESH';
Expand Down
3 changes: 3 additions & 0 deletions src/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public function getMethodsForConfig(MollieApiClient $api)
$apiMethods = $apiMethods->getArrayCopy();
/** @var Method $method */
foreach ($apiMethods as $key => $method) {
if ($method->status === 'pending-review') { // TODO REMOVE THIS ONCE RIVERTY IS IMPLEMENTED
continue;
}
if ($method->status !== 'activated') {
unset($apiMethods[$key]);
}
Expand Down
5 changes: 5 additions & 0 deletions src/Service/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ public function processTransaction($apiPayment)
return $apiPayment;
}

/** @var PrestaLoggerInterface $logger */
$logger = $this->module->getService(PrestaLoggerInterface::class);
$logger->error($apiPayment->resource);
switch ($apiPayment->resource) {
case Config::MOLLIE_API_STATUS_PAYMENT:
PrestaShopLogger::addLog(__METHOD__ . ' said: Starting to process PAYMENT transaction.', Config::NOTICE);
Expand Down Expand Up @@ -284,6 +287,8 @@ public function processTransaction($apiPayment)
$this->configurationAdapter->get(Config::MOLLIE_AUTHORIZABLE_PAYMENT_INVOICE_ON_STATUS)
=== Config::MOLLIE_AUTHORIZABLE_PAYMENT_STATUS_DEFAULT;


$logger->error($apiPayment->method);
if (
!$isAuthorizablePaymentInvoiceOnStatusDefault
&& $apiPayment->status === OrderStatus::STATUS_COMPLETED
Expand Down

0 comments on commit 084001d

Please sign in to comment.