View | Details | Raw Unified | Return to bug 21701
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_21701_PayPalReturnURL.perl (+14 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    # $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')"  );
5
6
    # or perform some test and warn
7
    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
8
    #    warn "There is something wrong";
9
    # }
10
11
    # Always end with this (adjust the bug info)
12
    SetVersion( $DBversion );
13
    print "Upgrade to $DBversion done (Bug 21701 - PayPal return URL option)\n";
14
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 480-485 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
480
('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' ),
480
('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' ),
481
('PayPalChargeDescription',  'Koha fee payment', NULL ,  'This preference defines what the user will see the charge listed as in PayPal',  'Free'),
481
('PayPalChargeDescription',  'Koha fee payment', NULL ,  'This preference defines what the user will see the charge listed as in PayPal',  'Free'),
482
('PayPalPwd',  '', NULL ,  'Your PayPal API password',  'Free'),
482
('PayPalPwd',  '', NULL ,  'Your PayPal API password',  'Free'),
483
('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'),
483
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
484
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
484
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
485
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
485
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
486
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+7 lines)
Lines 893-895 OPAC: Link Here
893
            - "The patron should see the charge description as "
893
            - "The patron should see the charge description as "
894
            - pref: PayPalChargeDescription
894
            - pref: PayPalChargeDescription
895
              class: long
895
              class: long
896
        -
897
            - "After payment or cancellation, PayPal should return to the "
898
            - pref: PayPalReturnURL
899
              default: BaseURL
900
              choices:
901
                  BaseURL: "OPACBaseURL"
902
                  OPACAlias: "OPAC's alias"
(-)a/opac/opac-account-pay.pl (-2 / +4 lines)
Lines 79-85 if ( $payment_method eq 'paypal' ) { Link Here
79
      ? 'https://api-3t.sandbox.paypal.com/nvp'
79
      ? 'https://api-3t.sandbox.paypal.com/nvp'
80
      : 'https://api-3t.paypal.com/nvp';
80
      : 'https://api-3t.paypal.com/nvp';
81
81
82
    my $opac_base_url = C4::Context->preference('OPACBaseURL');
82
    my $opac_base_url =
83
      C4::Context->preference('PayPalReturnURL') eq 'BaseURL'
84
      ? C4::Context->preference('OPACBaseURL')
85
      : $cgi->url(-base=>1);
83
86
84
    my $return_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account-pay-paypal-return.pl" );
87
    my $return_url = URI->new( $opac_base_url . "/cgi-bin/koha/opac-account-pay-paypal-return.pl" );
85
    $return_url->query_form( { amount => $amount_to_pay, accountlines => \@accountlines } );
88
    $return_url->query_form( { amount => $amount_to_pay, accountlines => \@accountlines } );
86
- 

Return to bug 21701