diff --git a/assets/images/payment_types/ach.png b/assets/images/payment_types/ach.png new file mode 100644 index 000000000..16cf86bdb Binary files /dev/null and b/assets/images/payment_types/ach.png differ diff --git a/assets/images/payment_types/amex.png b/assets/images/payment_types/amex.png new file mode 100644 index 000000000..492d40aff Binary files /dev/null and b/assets/images/payment_types/amex.png differ diff --git a/assets/images/payment_types/carteblanche.png b/assets/images/payment_types/carteblanche.png new file mode 100644 index 000000000..0b8f49aa7 Binary files /dev/null and b/assets/images/payment_types/carteblanche.png differ diff --git a/assets/images/payment_types/dinerscard.png b/assets/images/payment_types/dinerscard.png new file mode 100644 index 000000000..72e1808fb Binary files /dev/null and b/assets/images/payment_types/dinerscard.png differ diff --git a/assets/images/payment_types/discover.png b/assets/images/payment_types/discover.png new file mode 100644 index 000000000..7e36dd715 Binary files /dev/null and b/assets/images/payment_types/discover.png differ diff --git a/assets/images/payment_types/jcb.png b/assets/images/payment_types/jcb.png new file mode 100644 index 000000000..9bb0cbafd Binary files /dev/null and b/assets/images/payment_types/jcb.png differ diff --git a/assets/images/payment_types/laser.png b/assets/images/payment_types/laser.png new file mode 100644 index 000000000..2f2417942 Binary files /dev/null and b/assets/images/payment_types/laser.png differ diff --git a/assets/images/payment_types/maestro.png b/assets/images/payment_types/maestro.png new file mode 100644 index 000000000..38fdb4b7d Binary files /dev/null and b/assets/images/payment_types/maestro.png differ diff --git a/assets/images/payment_types/mastercard.png b/assets/images/payment_types/mastercard.png new file mode 100644 index 000000000..af9b1d701 Binary files /dev/null and b/assets/images/payment_types/mastercard.png differ diff --git a/assets/images/payment_types/other.png b/assets/images/payment_types/other.png new file mode 100644 index 000000000..0b8f49aa7 Binary files /dev/null and b/assets/images/payment_types/other.png differ diff --git a/assets/images/payment_types/paypal.png b/assets/images/payment_types/paypal.png new file mode 100644 index 000000000..4fad9d864 Binary files /dev/null and b/assets/images/payment_types/paypal.png differ diff --git a/assets/images/payment_types/solo.png b/assets/images/payment_types/solo.png new file mode 100644 index 000000000..c236ecc0f Binary files /dev/null and b/assets/images/payment_types/solo.png differ diff --git a/assets/images/payment_types/switch.png b/assets/images/payment_types/switch.png new file mode 100644 index 000000000..6ff522c6c Binary files /dev/null and b/assets/images/payment_types/switch.png differ diff --git a/assets/images/payment_types/unionpay.png b/assets/images/payment_types/unionpay.png new file mode 100644 index 000000000..0aa7031c2 Binary files /dev/null and b/assets/images/payment_types/unionpay.png differ diff --git a/assets/images/payment_types/visa.png b/assets/images/payment_types/visa.png new file mode 100644 index 000000000..ffd17c5a2 Binary files /dev/null and b/assets/images/payment_types/visa.png differ diff --git a/lib/ui/app/gateways/token_meta.dart b/lib/ui/app/gateways/token_meta.dart new file mode 100644 index 000000000..2e20a4384 --- /dev/null +++ b/lib/ui/app/gateways/token_meta.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:invoiceninja_flutter/data/models/gateway_token_model.dart'; + +class TokenMeta extends StatelessWidget { + const TokenMeta({this.meta}); + + final GatewayTokenMetaEntity meta; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Image.asset( + 'assets/images/payment_types/${meta.brand}.png', + height: 16, + ), + SizedBox(width: 8), + Text('•••• ${meta.last4} ${meta.expMonth}/${meta.expYear}'), + ], + ); + } +} diff --git a/lib/ui/client/view/client_view_overview.dart b/lib/ui/client/view/client_view_overview.dart index d1e738cae..5bb22ac37 100644 --- a/lib/ui/client/view/client_view_overview.dart +++ b/lib/ui/client/view/client_view_overview.dart @@ -14,6 +14,7 @@ import 'package:invoiceninja_flutter/redux/task/task_selectors.dart'; import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart'; import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart'; import 'package:invoiceninja_flutter/ui/app/entity_header.dart'; +import 'package:invoiceninja_flutter/ui/app/gateways/token_meta.dart'; import 'package:invoiceninja_flutter/ui/app/icon_message.dart'; import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart'; import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart'; @@ -129,7 +130,14 @@ class ClientOverview extends StatelessWidget { ListTile( title: Text( '${localization.token} › ${gatewayMap[customerReference].gateway.name}'), - subtitle: Text(customerReference), + subtitle: Column( + mainAxisSize: MainAxisSize.min, + children: tokenMap[customerReference] + .map((token) => TokenMeta( + meta: token.meta, + )) + .toList(), + ), onTap: linkMap.containsKey(customerReference) ? () => launch(linkMap[customerReference]) : null, diff --git a/pubspec.yaml b/pubspec.yaml index 78f93e7ae..5c4b654cd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -68,6 +68,7 @@ flutter: assets: - assets/images/logo.png - assets/images/google-icon.png + - assets/images/payment_types/ fonts: - family: Roboto