Upgrade the Payment module
Edit on GitHubUpgrading from version 4.* to version 5.0.0
In this new version of the Payment
module, we have added support of the payment method per store. You can find more details about the changes on the Payment module release page.
Estimated migration time: 15 min
To upgrade to the new version of the module, do the following:
- Upgrade the Payment module to the new version:
composer require spryker/payment:"^5.0.0" --update-with-dependencies
- Prepare database entity schema for each store in the system:
APPLICATION_STORE=DE console propel:schema:copy
APPLICATION_STORE=US console propel:schema:copy
- Run the database migration:
console propel:install
console transfer:generate
- The
SalesPaymentMethodTypeInstallerPlugin
plugin was removed, please usePaymentDataImport module
instead. - The
PaymentConfig::getSalesPaymentMethodTypes()
config method was removed, please use thePaymentDataImport
module instead.
Upgrading from version 3.* to version 4.*
In the Payment module version 4 we have added new payment tables to store order payment related information. To enable the new version:
- Composer update
spryker/payment
to new version. - Run
vendor/bin/console transfer:generate
to generate new transfer objects. - Insert new sales payment tables by executing the following queries:
CREATE SEQUENCE “spy_sales_payment_pk_seq”;
CREATE TABLE “spy_sales_payment”
(
“id_sales_payment” INTEGER NOT NULL,
“fk_sales_order” INTEGER NOT NULL,
“fk_sales_payment_method_type” INTEGER NOT NULL,
“amount” INTEGER NOT NULL,
“created_at” TIMESTAMP,
“updated_at” TIMESTAMP,
PRIMARY KEY (“id_sales_payment”)
);
CREATE SEQUENCE “spy_sales_payment_method_type_pk_seq”;
CREATE TABLE “spy_sales_payment_method_type”
(
“id_sales_payment_method_type” INTEGER NOT NULL,
“payment_provider” VARCHAR NOT NULL,
“payment_method” VARCHAR NOT NULL,
PRIMARY KEY (“id_sales_payment_method_type”)
);
CREATE INDEX “spy_sales_payment_method_type-type” ON “spy_sales_payment_method_type” (“payment_provider”,“payment_method”);
ALTER TABLE “spy_sales_payment” ADD CONSTRAINT “spy_sales_payment-fk_sales_order”
FOREIGN KEY (“fk_sales_order”)
REFERENCES “spy_sales_order” (“id_sales_order”);
ALTER TABLE “spy_sales_payment” ADD CONSTRAINT “spy_sales_payment-fk_sales_payment_method_type”
FOREIGN KEY (“fk_sales_payment_method_type”)
REFERENCES “spy_sales_payment_method_type” (“id_sales_payment_method_type”);
You should now be able to see that the new order saved payment information into the spy_sales_payment
table.
You may also want to enable the new plugin \Spryker\Zed\Payment\Communication\Plugin\Sales\PaymentOrderHydratePlugin
by adding it to \Pyz\Zed\Sales\SalesDependencyProvider::getOrderHydrationPlugins
.
This enables new payment provider hydration plugins which are hydrated to OrderTransfer
.
Thank you!
For submitting the form