Show gateway test mode

This commit is contained in:
Hillel Coren 2020-09-03 14:41:07 +03:00
parent 282c8ddb21
commit 2780173296
4 changed files with 43 additions and 12 deletions

View File

@ -82,6 +82,7 @@ abstract class CompanyGatewayEntity extends Object
createdAt: 0, createdAt: 0,
label: '', label: '',
tokenBilling: TOKEN_BILLING_ALWAYS, tokenBilling: TOKEN_BILLING_ALWAYS,
isTestMode: false,
); );
} }
@ -136,6 +137,9 @@ abstract class CompanyGatewayEntity extends Object
@BuiltValueField(wireName: 'token_billing') @BuiltValueField(wireName: 'token_billing')
String get tokenBilling; String get tokenBilling;
@BuiltValueField(wireName: 'test_mode')
bool get isTestMode;
String get label; String get label;
Map<String, dynamic> get parsedConfig => Map<String, dynamic> get parsedConfig =>

View File

@ -165,6 +165,9 @@ class _$CompanyGatewayEntitySerializer
'token_billing', 'token_billing',
serializers.serialize(object.tokenBilling, serializers.serialize(object.tokenBilling,
specifiedType: const FullType(String)), specifiedType: const FullType(String)),
'test_mode',
serializers.serialize(object.isTestMode,
specifiedType: const FullType(bool)),
'label', 'label',
serializers.serialize(object.label, serializers.serialize(object.label,
specifiedType: const FullType(String)), specifiedType: const FullType(String)),
@ -270,6 +273,10 @@ class _$CompanyGatewayEntitySerializer
result.tokenBilling = serializers.deserialize(value, result.tokenBilling = serializers.deserialize(value,
specifiedType: const FullType(String)) as String; specifiedType: const FullType(String)) as String;
break; break;
case 'test_mode':
result.isTestMode = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
case 'label': case 'label':
result.label = serializers.deserialize(value, result.label = serializers.deserialize(value,
specifiedType: const FullType(String)) as String; specifiedType: const FullType(String)) as String;
@ -656,6 +663,8 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
@override @override
final String tokenBilling; final String tokenBilling;
@override @override
final bool isTestMode;
@override
final String label; final String label;
@override @override
final bool isChanged; final bool isChanged;
@ -691,6 +700,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
this.customValue4, this.customValue4,
this.config, this.config,
this.tokenBilling, this.tokenBilling,
this.isTestMode,
this.label, this.label,
this.isChanged, this.isChanged,
this.createdAt, this.createdAt,
@ -747,6 +757,9 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
throw new BuiltValueNullFieldError( throw new BuiltValueNullFieldError(
'CompanyGatewayEntity', 'tokenBilling'); 'CompanyGatewayEntity', 'tokenBilling');
} }
if (isTestMode == null) {
throw new BuiltValueNullFieldError('CompanyGatewayEntity', 'isTestMode');
}
if (label == null) { if (label == null) {
throw new BuiltValueNullFieldError('CompanyGatewayEntity', 'label'); throw new BuiltValueNullFieldError('CompanyGatewayEntity', 'label');
} }
@ -789,6 +802,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
customValue4 == other.customValue4 && customValue4 == other.customValue4 &&
config == other.config && config == other.config &&
tokenBilling == other.tokenBilling && tokenBilling == other.tokenBilling &&
isTestMode == other.isTestMode &&
label == other.label && label == other.label &&
isChanged == other.isChanged && isChanged == other.isChanged &&
createdAt == other.createdAt && createdAt == other.createdAt &&
@ -821,17 +835,17 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
$jc( $jc(
$jc( $jc(
$jc( $jc(
$jc($jc($jc(0, gatewayId.hashCode), acceptedCreditCards.hashCode), $jc($jc($jc($jc(0, gatewayId.hashCode), acceptedCreditCards.hashCode), showBillingAddress.hashCode),
showBillingAddress.hashCode), showShippingAddress.hashCode),
showShippingAddress.hashCode), updateDetails.hashCode),
updateDetails.hashCode), feesAndLimitsMap.hashCode),
feesAndLimitsMap.hashCode), customValue1.hashCode),
customValue1.hashCode), customValue2.hashCode),
customValue2.hashCode), customValue3.hashCode),
customValue3.hashCode), customValue4.hashCode),
customValue4.hashCode), config.hashCode),
config.hashCode), tokenBilling.hashCode),
tokenBilling.hashCode), isTestMode.hashCode),
label.hashCode), label.hashCode),
isChanged.hashCode), isChanged.hashCode),
createdAt.hashCode), createdAt.hashCode),
@ -858,6 +872,7 @@ class _$CompanyGatewayEntity extends CompanyGatewayEntity {
..add('customValue4', customValue4) ..add('customValue4', customValue4)
..add('config', config) ..add('config', config)
..add('tokenBilling', tokenBilling) ..add('tokenBilling', tokenBilling)
..add('isTestMode', isTestMode)
..add('label', label) ..add('label', label)
..add('isChanged', isChanged) ..add('isChanged', isChanged)
..add('createdAt', createdAt) ..add('createdAt', createdAt)
@ -931,6 +946,10 @@ class CompanyGatewayEntityBuilder
String get tokenBilling => _$this._tokenBilling; String get tokenBilling => _$this._tokenBilling;
set tokenBilling(String tokenBilling) => _$this._tokenBilling = tokenBilling; set tokenBilling(String tokenBilling) => _$this._tokenBilling = tokenBilling;
bool _isTestMode;
bool get isTestMode => _$this._isTestMode;
set isTestMode(bool isTestMode) => _$this._isTestMode = isTestMode;
String _label; String _label;
String get label => _$this._label; String get label => _$this._label;
set label(String label) => _$this._label = label; set label(String label) => _$this._label = label;
@ -985,6 +1004,7 @@ class CompanyGatewayEntityBuilder
_customValue4 = _$v.customValue4; _customValue4 = _$v.customValue4;
_config = _$v.config; _config = _$v.config;
_tokenBilling = _$v.tokenBilling; _tokenBilling = _$v.tokenBilling;
_isTestMode = _$v.isTestMode;
_label = _$v.label; _label = _$v.label;
_isChanged = _$v.isChanged; _isChanged = _$v.isChanged;
_createdAt = _$v.createdAt; _createdAt = _$v.createdAt;
@ -1030,6 +1050,7 @@ class CompanyGatewayEntityBuilder
customValue4: customValue4, customValue4: customValue4,
config: config, config: config,
tokenBilling: tokenBilling, tokenBilling: tokenBilling,
isTestMode: isTestMode,
label: label, label: label,
isChanged: isChanged, isChanged: isChanged,
createdAt: createdAt, createdAt: createdAt,

View File

@ -73,7 +73,10 @@ class CompanyGatewayListItem extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text( child: Text(
companyGateway.label, companyGateway.label +
(companyGateway.isTestMode
? ' [${AppLocalization.of(context).testMode}]'
: ''),
style: Theme.of(context).textTheme.headline6, style: Theme.of(context).textTheme.headline6,
), ),
), ),

View File

@ -15,6 +15,7 @@ mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = { static final Map<String, Map<String, String>> _localizedValues = {
'en': { 'en': {
// STARTER: lang key - do not remove comment // STARTER: lang key - do not remove comment
'test_mode': 'Test Mode',
'opened': 'opened', 'opened': 'opened',
'payment_reconciliation_failure': 'Reconciliation Failure', 'payment_reconciliation_failure': 'Reconciliation Failure',
'payment_reconciliation_success': 'Reconciliation Success', 'payment_reconciliation_success': 'Reconciliation Success',
@ -4464,6 +4465,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
String get opened => _localizedValues[localeCode]['opened'] ?? ''; String get opened => _localizedValues[localeCode]['opened'] ?? '';
String get testMode => _localizedValues[localeCode]['test_mode'] ?? '';
String lookup(String key) { String lookup(String key) {
final lookupKey = toSnakeCase(key); final lookupKey = toSnakeCase(key);