Bug 23868

Summary: PayPal payment button is never enabled
Product: Koha Reporter: Andrew Isherwood <bugzilla>
Component: OPACAssignee: Agustín Moyano <agustinmoyano>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: blocker    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, katrin.fischer, kyle, martin.renvoize, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00
Bug Depends on: 23213    
Bug Blocks:    
Attachments: Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt
Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt
Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt

Description Andrew Isherwood 2019-10-22 11:36:41 UTC
Enabling and configuring "EnablePayPalOpacPayments PayPalSandboxMode" works fine. But when it comes to paying a fine in the OPAC, the "Make payment" button is never enabled. It is disabled initially, but is supposed to be enabled if at least one fine is selected to be paid.

This it the line that is supposed to enable it (now commented out):

https://github.com/PTFS-Europe/koha/blob/master/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt#L104

it was commented out as part of Bug 23213 - is this an oversight or is this functionality now superseded?
Comment 1 Andrew Isherwood 2019-10-22 11:46:23 UTC
Looking further into it, I think my initial conclusion was wrong. Uncommenting that line doesn't cause the button to be enabled when a fine is selected. There is reference to elements with a `data-threshold` attribute, which I cannot find in my markup, so I am now wondering if this PayPal functionality is dependent on the plugins mentioned in Bug 23213. In short, I'm confused!
Comment 2 Katrin Fischer 2019-11-03 21:57:41 UTC
Tomas or Kyle, can you help here?
Comment 3 Agustín Moyano 2019-11-04 18:17:36 UTC
Created attachment 95029 [details] [review]
Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt

This patch fixes a bug introduced by checking payment plugins threshold

To test:
1. do not apply this patch
2. configure paypal options in intranet
3. create a manual invoice for a patron
4. in opac try to pay that invoice
CHECK => Make Payment button is disabled, even when invoices where checked.
5. apply this patch
6. repeat step 4
SUCCESS => Make Payment button is enabled when an invoice is checked.
7. Sign off
Comment 4 Jonathan Druart 2019-11-05 17:09:12 UTC
Created attachment 95066 [details] [review]
Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt

This patch fixes a bug introduced by checking payment plugins threshold

To test:
1. do not apply this patch
2. configure paypal options in intranet
3. create a manual invoice for a patron
4. in opac try to pay that invoice
CHECK => Make Payment button is disabled, even when invoices where checked.
5. apply this patch
6. repeat step 4
SUCCESS => Make Payment button is enabled when an invoice is checked.
7. Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Katrin Fischer 2019-11-06 17:42:56 UTC
Created attachment 95119 [details] [review]
Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt

This patch fixes a bug introduced by checking payment plugins threshold

To test:
1. do not apply this patch
2. configure paypal options in intranet
3. create a manual invoice for a patron
4. in opac try to pay that invoice
CHECK => Make Payment button is disabled, even when invoices where checked.
5. apply this patch
6. repeat step 4
SUCCESS => Make Payment button is enabled when an invoice is checked.
7. Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2019-11-06 17:43:20 UTC
Just changing: String patch = Interface/GUI strings, changing to Trivial.
Comment 7 Martin Renvoize 2019-11-07 09:12:45 UTC
Nice work!

Pushed to master for 19.11.00
Comment 8 Fridolin Somers 2019-11-15 07:53:00 UTC
Depends on Bug 23213 not in 19.05.x