diff --git a/Koha/REST/V1/Patrons/Account.pm b/Koha/REST/V1/Patrons/Account.pm index e2d18f5824..95c998ad56 100644 --- a/Koha/REST/V1/Patrons/Account.pm +++ b/Koha/REST/V1/Patrons/Account.pm @@ -145,6 +145,10 @@ sub add_credit { my $note = $body->{note}; my $library_id = $body->{library_id}; + if ( C4::Context->preference("RequirePaymentType") && !defined($payment_type) ) { + Koha::Exceptions::Account::PaymentTypeRequired->throw(); + } + my $credit = $account->add_credit( { amount => $amount,