Add payment.gateway_type_id

This commit is contained in:
Hillel Coren 2023-04-26 20:52:46 +03:00
parent 290f52b49d
commit 697c24ccc3
2 changed files with 3 additions and 3 deletions

View File

@ -826,8 +826,8 @@ abstract class GatewayEntity extends Object
.where((typeId) => options[typeId].supportTokenBilling)
.isNotEmpty;
bool get supportsRefunds =>
options.keys.where((typeId) => options[typeId].supportRefunds).isNotEmpty;
bool supportsRefunds(String gatewayTypeId) =>
options[gatewayTypeId].supportRefunds;
Map<String, dynamic> get parsedFields =>
fields.isEmpty ? <String, dynamic>{} : jsonDecode(fields);

View File

@ -150,7 +150,7 @@ class _PaymentRefundState extends State<PaymentRefund> {
onChanged: (value) => viewModel
.onChanged(payment.rebuild((b) => b..sendEmail = value)),
),
if (gateway.supportsRefunds)
if (gateway.supportsRefunds(payment.gatewayTypeId))
SwitchListTile(
activeColor: Theme.of(context).colorScheme.secondary,
title: Text(localization.gatewayRefund),