- core/payments/providers/mollie: Client (Bearer API-Key, Idempotency-Key), Provider nach dem PayPal-v2-Vertrag: start (POST /v2/payments mit method aus payment_methods.argument), onReturn/onCancel (Status per GET, Rueckkehr-URL traegt o=<orders.id>), onWebhook (id=tr_..., Wahrheit per GET), reconcile (paid/canceled/expired/failed, >24h abbrechen) - Klarna: lines aus order_item (brutto je Stueck), Versand, Zahlartgebuehr, Gutschein, Rabatt, Rundungsausgleich; billing/shippingAddress mit E-Mail und Telefon (E.164) - core/paymentmethods/molliepaymentmethod.class.php: Kassen-Adapter ohne Express - install_mollie.sql: 16 Spalten in shipping_area (4 helperjoinkeys), Einstellungen Gruppe mollie, 4 Zahlarten (module mollie, argument = Methode), Freischaltung/Leichen als Kommentar - Kasse neu: Mollie-Logos je Methode, Apple Pay nur auf faehigen Geraeten - cli.php status: mehrere Zahlarten je Anbieter, Modus generisch
89 lines
6.3 KiB
SQL
89 lines
6.3 KiB
SQL
-- ============================================================================
|
|
-- core/payments -- Mollie (MySQL, Shop-DB). Additiv, mehrfach ausfuehrbar.
|
|
-- Voraussetzung: install.sql (payment_transactions, payment_provider_secrets) ist drin.
|
|
--
|
|
-- Getrennte Gateways je Zahlungsart (Tom, 27.09.2026): je Mollie-Methode EINE Zeile in
|
|
-- payment_methods mit module='mollie' und argument=<Methode>. Mollie zeigt dann nur
|
|
-- diese Methode, keine Auswahl bei Mollie, kein abweichendes Warenkorb-Verhalten.
|
|
--
|
|
-- Reihenfolge: 1) Versandgebiet-Spalten 2) Einstellungen 3) Zahlarten 4) Freischaltung (manuell)
|
|
-- ============================================================================
|
|
|
|
-- 1) Die Kasse haengt jede Zahlart ueber helperjoinkey an vier Spalten in shipping_area
|
|
-- (active_/add_/account_type_/free_payment_<key>). Neue Keys = neue Spalten.
|
|
-- Aufschlaege sind bei Karten/Klarna/Wallets ohnehin nicht zulaessig -> add=0, aktiv=1.
|
|
ALTER TABLE `shipping_area`
|
|
ADD COLUMN IF NOT EXISTS `active_mollie_klarna` TINYINT(2) NOT NULL DEFAULT 1,
|
|
ADD COLUMN IF NOT EXISTS `add_mollie_klarna` DECIMAL(9,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `account_type_mollie_klarna` TINYINT(4) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `free_payment_mollie_klarna` DECIMAL(6,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `active_mollie_creditcard` TINYINT(2) NOT NULL DEFAULT 1,
|
|
ADD COLUMN IF NOT EXISTS `add_mollie_creditcard` DECIMAL(9,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `account_type_mollie_creditcard` TINYINT(4) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `free_payment_mollie_creditcard` DECIMAL(6,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `active_mollie_applepay` TINYINT(2) NOT NULL DEFAULT 1,
|
|
ADD COLUMN IF NOT EXISTS `add_mollie_applepay` DECIMAL(9,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `account_type_mollie_applepay` TINYINT(4) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `free_payment_mollie_applepay` DECIMAL(6,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `active_mollie_googlepay` TINYINT(2) NOT NULL DEFAULT 1,
|
|
ADD COLUMN IF NOT EXISTS `add_mollie_googlepay` DECIMAL(9,2) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `account_type_mollie_googlepay` TINYINT(4) NOT NULL DEFAULT 0,
|
|
ADD COLUMN IF NOT EXISTS `free_payment_mollie_googlepay` DECIMAL(6,2) NOT NULL DEFAULT 0;
|
|
|
|
-- 2) Einstellungen (Zahlart-Editor, Reiter "Einstellungen", Gruppe mollie). API-Keys sind
|
|
-- Secrets (verschluesselt), nicht hier: test_api_key, live_api_key.
|
|
INSERT IGNORE INTO `configuration` (`name`, `text`, `group_id`, `setting`, `type`, `description`) VALUES
|
|
('mollie_mode', '', 'mollie', 'test', 1, 'test oder live (waehlt den API-Key)'),
|
|
('mollie_locale', '', 'mollie', 'de_DE', 1, 'Sprache der Mollie-Seite (xx_XX)'),
|
|
('mollie_currency', '', 'mollie', 'EUR', 1, 'Waehrung (ISO 4217)'),
|
|
('mollie_description', '', 'mollie', 'Bestellung [#order_number]', 1, 'Verwendungszweck auf dem Kontoauszug des Kunden');
|
|
|
|
-- 3) Zahlarten: eine Zeile je Methode. active=1, aber noch KEINER Kundengruppe zugeordnet
|
|
-- => im Shop unsichtbar, bis Schritt 4 laeuft. argument = Mollie-Methode (Pflicht).
|
|
INSERT INTO `payment_methods`
|
|
(`name`, `module`, `argument`, `active`, `rang`, `invoice_text`, `order_text`, `order_email_text`, `helperjoinkey`, `configuration_group_id`)
|
|
SELECT 'Klarna', 'mollie', 'klarna', 1, 3,
|
|
'Bezahlung erfolgte per Klarna',
|
|
'Sie werden zur Bezahlung Ihrer Bestellung zu Klarna weitergeleitet (Rechnung, Ratenkauf oder Sofort bezahlen).',
|
|
'Der zu zahlende Betrag wird ueber Klarna abgewickelt.',
|
|
'mollie_klarna', 'mollie'
|
|
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `payment_methods` WHERE `module`='mollie' AND `argument`='klarna');
|
|
|
|
INSERT INTO `payment_methods`
|
|
(`name`, `module`, `argument`, `active`, `rang`, `invoice_text`, `order_text`, `order_email_text`, `helperjoinkey`, `configuration_group_id`)
|
|
SELECT 'Kreditkarte', 'mollie', 'creditcard', 1, 4,
|
|
'Bezahlung erfolgte per Kreditkarte',
|
|
'Sie werden zur sicheren Eingabe Ihrer Kartendaten weitergeleitet (Visa, Mastercard, American Express).',
|
|
'Der zu zahlende Betrag wurde per Kreditkarte beglichen.',
|
|
'mollie_creditcard', 'mollie'
|
|
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `payment_methods` WHERE `module`='mollie' AND `argument`='creditcard');
|
|
|
|
INSERT INTO `payment_methods`
|
|
(`name`, `module`, `argument`, `active`, `rang`, `invoice_text`, `order_text`, `order_email_text`, `helperjoinkey`, `configuration_group_id`)
|
|
SELECT 'Apple Pay', 'mollie', 'applepay', 1, 5,
|
|
'Bezahlung erfolgte per Apple Pay',
|
|
'Sie werden zur Bezahlung mit Apple Pay weitergeleitet.',
|
|
'Der zu zahlende Betrag wurde per Apple Pay beglichen.',
|
|
'mollie_applepay', 'mollie'
|
|
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `payment_methods` WHERE `module`='mollie' AND `argument`='applepay');
|
|
|
|
INSERT INTO `payment_methods`
|
|
(`name`, `module`, `argument`, `active`, `rang`, `invoice_text`, `order_text`, `order_email_text`, `helperjoinkey`, `configuration_group_id`)
|
|
SELECT 'Google Pay', 'mollie', 'googlepay', 1, 6,
|
|
'Bezahlung erfolgte per Google Pay',
|
|
'Sie werden zur Bezahlung mit Google Pay weitergeleitet.',
|
|
'Der zu zahlende Betrag wurde per Google Pay beglichen.',
|
|
'mollie_googlepay', 'mollie'
|
|
FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `payment_methods` WHERE `module`='mollie' AND `argument`='googlepay');
|
|
|
|
-- 4) FREISCHALTUNG (manuell, nach Test): Kundengruppen 1 Endverbraucher, 103 Gast
|
|
-- (Haendler 101 bewusst nicht -- die zahlen kundenspezifisch), Versandgebiet 1.
|
|
-- INSERT INTO `customer_group_payment_method_configuration` (`group_id`, `payment_method_id`, `shipping_area_id`, `active`)
|
|
-- SELECT g.id, pm.id, 1, 1 FROM payment_methods pm JOIN customer_groups g ON g.id IN (1,103)
|
|
-- WHERE pm.module='mollie'
|
|
-- AND NOT EXISTS (SELECT 1 FROM customer_group_payment_method_configuration c WHERE c.group_id=g.id AND c.payment_method_id=pm.id AND c.shipping_area_id=1);
|
|
|
|
-- 5) LEICHEN (nach Go-Live): alte Klarna-/paymorrow-/BILLPAY-/computop-Zahlarten verstecken.
|
|
-- Nicht loeschen -- Bestellungen von frueher zeigen noch auf die ids.
|
|
-- UPDATE `payment_methods` SET active=0 WHERE id IN (8,9,10,11,12,13);
|