Skip to content

Make VaultMigration compatible with disabled/removed Magento PayPal module #2806

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
11 changes: 11 additions & 0 deletions Setup/Patch/Data/VaultMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ public function apply(): void

private function migrateBillingAgreementsToVault(ModuleDataSetupInterface $setup): void
{
if (!$setup->tableExists('paypal_billing_agreement')) {
$this->adyenLogger->addAdyenInfoLog('Table paypal_billing_agreement does not exist, skipping migration');
return;
}

$columns = $setup->getConnection()->describeTable('paypal_billing_agreement');
if (!isset($columns['method_code']) || !isset($columns['status'])) {
$this->adyenLogger->addAdyenInfoLog('Columns method_code and status do not exist, skipping migration');
return;
}

$paypalTable = $setup->getTable('paypal_billing_agreement');
$connection = $setup->getConnection();

Expand Down
Loading