diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 51b7db24a..68b9efd43 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - fixed #11777: Thingy search on yes no field fails - fixed #11787: Gallery resolutions wrongly ordered - fixed #11785: Article title / URL with äÄöÖüÜ (reopen #11683) + - fixed #11799: 7.8.24->7.9.11 upgrade breaks on custom Paydrivers 7.9.12 - webgui.org homepage gives 404 (#11778) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index a97f33ca7..ba7de5e18 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -51,6 +51,13 @@ save you many hours of grief. * The Cart will now work without javascript. Javascript is used to make parts of the cart easier, and to automatically update the user's cart so they don't have to manually update it. + * All custom Payment drivers have to be rewritten. Please read the POD for + WebGUI::Shop::PayDriver for information about the update. The upgrade script for 7.9.4 + is designed to die if a non-core payment driver is detected, so after updating your custom + driver you will need to change the upgrade script. + + * Custom cart templates will need to be updated to accomodate the new cart design. + 7.9.3 -------------------------------------------------------------------- * Test:Deep, which had been an optional dependency for testing, has been used diff --git a/docs/upgrades/upgrade_7.9.3-7.9.4.pl b/docs/upgrades/upgrade_7.9.3-7.9.4.pl index 18d7d96fd..872edf45d 100644 --- a/docs/upgrades/upgrade_7.9.3-7.9.4.pl +++ b/docs/upgrades/upgrade_7.9.3-7.9.4.pl @@ -25,6 +25,7 @@ use WebGUI::Asset; use WebGUI::Asset::WikiPage; use WebGUI::Exception; use WebGUI::Shop::Pay; +use WebGUI::Utility qw/isIn/; my $toVersion = '7.9.4'; @@ -182,7 +183,8 @@ sub addPayDriverTemplates { $properties->{summaryTemplateId} = 'GqnZPB0gLoZmqQzYFaq7bg'; } else { - die "Unknown payment driver type found. Unable to automatically upgrade.\n"; + warn "Unknown payment driver type found. Unable to automatically upgrade.\n"; + next GATEWAY; } $gateway->update($properties); } @@ -232,6 +234,17 @@ sub start { ); my $session = WebGUI::Session->open($webguiRoot,$configFile); $session->user({userId=>3}); + + my $pay = WebGUI::Shop::Pay->new($session); + my @gateways = @{ $pay->getPaymentGateways }; + GATEWAY: foreach my $gateway (@gateways) { + next GATEWAY unless $gateway; + if (! isIn ($gateway->className, qw/WebGUI::Shop::PayDriver::Cash WebGUI::Shop::PayDriver::Ogone WebGUI::Shop::PayDriver::ITransact WebGUI::Shop::PayDriver::PayPal::PayPalStd WebGUI::Shop::PayDriver::PayPal::ExpressCheckout/) ) { + $session->close; + die "Custom payment driver found:".$gateway->className.". Please read the gotchas.txt file and the POD in WebGUI::Shop::PayDriver on how to update it for the new Cart. Then, you can safely disable this check.\n"; + } + } + my $versionTag = WebGUI::VersionTag->getWorking($session); $versionTag->set({name=>"Upgrade to ".$toVersion}); return $session; diff --git a/lib/WebGUI/Shop/PayDriver.pm b/lib/WebGUI/Shop/PayDriver.pm index 5c3417f1c..3575eba7a 100644 --- a/lib/WebGUI/Shop/PayDriver.pm +++ b/lib/WebGUI/Shop/PayDriver.pm @@ -781,5 +781,20 @@ sub www_editSave { return undef; } +=head2 CHANGES ( ) + +=head3 7.9.4 + +In 7.9.4, the base PayDriver class was changed to accomodate the new Cart. The Cart is now in +charge of gathering billing information. The PayDriver's job is to summarize all the payment +information for the user to review (www_getCredentials) and provide the user a button to complete +the checkout process (getButton), and then to complete the checkout. PayDrivers can +do additional things beyond those steps, like the PayPal driver. + +PayDrivers also now have a defult template for displaying that screen, the summaryTemplate. +While each core driver has its own template, custom drivers can use any existing one that +meets its needs. + +=cut 1;