Bugzilla – Attachment 93818 Details for
Bug 23761
Allow PayPal return url to be set based on current domain, not OPACBaseURL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23761 - Allow PayPal return url to be set based on current domain, not OPACBaseURL
Bug-23761---Allow-PayPal-return-url-to-be-set-base.patch (text/plain), 2.08 KB, created by
Kyle M Hall (khall)
on 2019-10-07 10:34:51 UTC
(
hide
)
Description:
Bug 23761 - Allow PayPal return url to be set based on current domain, not OPACBaseURL
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-10-07 10:34:51 UTC
Size:
2.08 KB
patch
obsolete
>From 58694feb38b91834ddcce54008792d59b8bc2cf2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 7 Oct 2019 06:29:32 -0400 >Subject: [PATCH] Bug 23761 - Allow PayPal return url to be set based on > current domain, not OPACBaseURL > >In some library systems, each library has a customized sub-opac and a separate PayPal account. This is accomplished using the css and syspref override directives in the Apache conf. This all works great until a patron wants to make a PayPal payment. > >Let us assume OPACBaseURL is set to catalog.mylib.org, the generic unstyled OPAC. Each library then has a 'sub-opac' such as labA.catalog.mylib.lorg. If the patron is on an OPAC at libA.catalog.mylib.org, and makes a paypal payment, the patron will not be returned to libA.catalog.mylib.org. Instead, the patron will be send back to catalog.mylib.org. > >The simple solution is to use the CGI module to build a URL using the current base URL: $cgi->url( -base => 1 ) > >Test Plan: >1) Set up sub-OPACs and PayPal ( production or sandbox mode ) >2) Initiate a payment from a sub-OPAC >3) Note you are returned to whatever is in OPACBaseURL >4) Apply this patch >5) Restart all the things! >6) Initiate a second payment from a sub-OPAC >7) Note that you are returned to the correct sub-OPAC url! > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: David Kuhn <kuhn@monterey.org> >--- > opac/opac-account-pay.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-account-pay.pl b/opac/opac-account-pay.pl >index a4598bda38..e42c0bf4f7 100755 >--- a/opac/opac-account-pay.pl >+++ b/opac/opac-account-pay.pl >@@ -79,7 +79,7 @@ if ( $payment_method eq 'paypal' ) { > ? '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 = $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 } ); >-- >2.21.0 (Apple Git-122)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23761
:
93817
| 93818