We are part of a multi-library consortium that shares a single Koha server. Each of the member libraries has its own unique OPAC URL. When a patron pays a charge online, they are directed to PayPal. When the transaction is completed (or if the patron cancels the payment) they are redirected to the value of OPACBaseURL, not the URL from which the patron was using. This ends up with the ending up on a screen displaying a combination of all our OPACs together. We would like to have the ability to have the URL of the OPAC the patron is using be sent as the return url sent to PayPal. This could also be set up as a global option to use either the OPACBaseURL or the OPAC's individual's domain (for systems that would prefer to still use the current method).
Created attachment 82103 [details] [review] Bug 21701: Have PayPal optionally return to originating OPAC url rather than OPACBaseURL This enhancement will allow a library to choose whether to use the alias of the current OPAC or the value of OPACBaseURL as the return url when making payments via PayPal. To test: Note: you need to have PayPal enabled on your system (either Sandbox mode or Live) and be using an alias URL for your OPAC. 1. Apply the patch. 2. With the option "PayPalReturnURL" set to "OPACBaseURL", log into a card via the OPAC and start the process to pay in PayPal (you can either complete the payment or cancel from the PayPal page). When you are returned to the OPAC, the domain will be the value of OPACBaseURL. 3. With the option "PayPalReturnURL" set to "OPAC's alias", repeat the above sequence to make a payment in PayPal. When you are returned to the OPAC, the domain will be your current alias.
David, As per your instructions I tried to make payment using PayPal using both OPACBaseURL and OPAC's Alias. I used ByWater's 18.05.05 sandbox and added the patch. After logging in to staff, I created a fine for the koha patron. I then logged into the OPAC and went to pay the fine. I selected the fine to be paid and then pressed the button for Make payment. The message I've received is the following: Error: there was a problem processing your payment Unable to verify payment. Please contact the library to verify your payment.
The following prerequisites are needed to test this patch: 1. Enable PayPal on your system (either Sandbox mode or Live) 2. Set the PayPal credentials PayPalPwd, PayPalSignature, and PayPalUser for the mode selected above Of course, you also need to be using an alias URL for your OPAC. If needed, you can set up a PayPal sandbox account at https://developer.paypal.com To test: 1. Apply the patch. 2. With the option "PayPalReturnURL" set to "OPACBaseURL", log into a card via the OPAC and start the process to pay in PayPal (you can either complete the payment or cancel from the PayPal page). When you are returned to the OPAC, the domain will be the value of OPACBaseURL. 3. With the option "PayPalReturnURL" set to "OPAC's alias", repeat the above sequence to make a payment in PayPal. When you are returned to the OPAC, the domain will be your current alias. If you get the message: "Error: there was a problem processing your payment Unable to verify payment. Please contact the library to verify your payment." there may be a problem with the Paypal credentials entered.
Created attachment 93477 [details] [review] Bug 21701: Have PayPal optionally return to originating OPAC url rather than OPACBaseURL This enhancement will allow a library to choose whether to use the alias of the current OPAC or the value of OPACBaseURL as the return url when making payments via PayPal. To test: Note: you need to have PayPal enabled on your system (either Sandbox mode or Live) and be using an alias URL for your OPAC. 1. Apply the patch. 2. With the option "PayPalReturnURL" set to "OPACBaseURL", log into a card via the OPAC and start the process to pay in PayPal (you can either complete the payment or cancel from the PayPal page). When you are returned to the OPAC, the domain will be the value of OPACBaseURL. 3. With the option "PayPalReturnURL" set to "OPAC's alias", repeat the above sequence to make a payment in PayPal. When you are returned to the OPAC, the domain will be your current alias. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
*** Bug 23761 has been marked as a duplicate of this bug. ***
Created attachment 93821 [details] [review] Bug 21701: Have PayPal optionally return to originating OPAC url rather than OPACBaseURL This enhancement will allow a library to choose whether to use the alias of the current OPAC or the value of OPACBaseURL as the return url when making payments via PayPal. To test: Note: you need to have PayPal enabled on your system (either Sandbox mode or Live) and be using an alias URL for your OPAC. 1. Apply the patch. 2. With the option "PayPalReturnURL" set to "OPACBaseURL", log into a card via the OPAC and start the process to pay in PayPal (you can either complete the payment or cancel from the PayPal page). When you are returned to the OPAC, the domain will be the value of OPACBaseURL. 3. With the option "PayPalReturnURL" set to "OPAC's alias", repeat the above sequence to make a payment in PayPal. When you are returned to the OPAC, the domain will be your current alias. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 93822 [details] [review] Bug 21701: Fix up db update Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Nice work! Pushed to master for 19.11.00