--- /dev/null
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+ # you can use $dbh here like:
+ # $dbh->do("INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('PayPalReturnURL','BaseURL','BaseURL|OPACAlias','Specify whether PayPal will return to the url specified in the OPACBaseURL option or to the OPAC\'s alias url.','Choice')" );
+
+ # or perform some test and warn
+ # if( !column_exists( 'biblio', 'biblionumber' ) ) {
+ # warn "There is something wrong";
+ # }
+
+ # Always end with this (adjust the bug info)
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 21701 - PayPal return URL option)\n";
+}
('PatronQuickAddFields', '', NULL , 'A list of fields separated by "|" to be displayed along with mandatory fields in the patron quick add form if chosen at patron entry', 'Free' ),
('PayPalChargeDescription', 'Koha fee payment', NULL , 'This preference defines what the user will see the charge listed as in PayPal', 'Free'),
('PayPalPwd', '', NULL , 'Your PayPal API password', 'Free'),
+('PayPalReturnURL','BaseURL','BaseURL|OPACAlias','Specify whether PayPal will return to the url specified in the OPACBaseURL option or to the OPAC\'s alias url.','Choice'),
('PayPalSandboxMode', '1', NULL , 'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.', 'YesNo'),
('PayPalSignature', '', NULL , 'Your PayPal API signature', 'Free'),
('PayPalUser', '', NULL , 'Your PayPal API username ( email address )', 'Free'),
- "The patron should see the charge description as "
- pref: PayPalChargeDescription
class: long
+ -
+ - "After payment or cancellation, PayPal should return to the "
+ - pref: PayPalReturnURL
+ default: BaseURL
+ choices:
+ BaseURL: "OPACBaseURL"
+ OPACAlias: "OPAC's alias"
? 'https://api-3t.sandbox.paypal.com/nvp'
: 'https://api-3t.paypal.com/nvp';
- my $opac_base_url = C4::Context->preference('OPACBaseURL');
+ my $opac_base_url =
+ C4::Context->preference('PayPalReturnURL') eq 'BaseURL'
+ ? C4::Context->preference('OPACBaseURL')
+ : $cgi->url(-base=>1);
my $return_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account-pay-paypal-return.pl" );
$return_url->query_form( { amount => $amount_to_pay, accountlines => \@accountlines } );