diff --git a/LabelStoreMax/.env b/LabelStoreMax/.env index cabea80..b5c7f3e 100644 --- a/LabelStoreMax/.env +++ b/LabelStoreMax/.env @@ -34,6 +34,8 @@ PAYPAL_ACCOUNT_EMAIL="mystore@business.com" # Your PayPal account email e.g. mystore@business.com PAYPAL_LIVE_MODE="false" # Change to 'true' for live payments +PAYPAL_LOCALE="en-GB" +# Use BCP-47 code from this link https://developer.paypal.com/docs/api/reference/locale-codes/ # ** diff --git a/LabelStoreMax/CHANGELOG.md b/LabelStoreMax/CHANGELOG.md index cd4ceac..637611c 100644 --- a/LabelStoreMax/CHANGELOG.md +++ b/LabelStoreMax/CHANGELOG.md @@ -1,3 +1,9 @@ +## [5.0.2] - 2020-04-17 + +* Fix issue with PayPal checkout when using different locales +* Fix nested `trans` methods +* PAYPAL_LOCALE added to .env file + ## [5.0.1] - 2020-04-13 * Update to app_payment_gateways diff --git a/LabelStoreMax/README.md b/LabelStoreMax/README.md index 7fd916c..2998346 100644 --- a/LabelStoreMax/README.md +++ b/LabelStoreMax/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v5.0.1 +### Label StoreMax - v5.0.2 [Official WooSignal WooCommerce App](https://woosignal.com) diff --git a/LabelStoreMax/lang/es.json b/LabelStoreMax/lang/es.json index 6ba0f8a..ed9c20e 100644 --- a/LabelStoreMax/lang/es.json +++ b/LabelStoreMax/lang/es.json @@ -179,8 +179,8 @@ "Dark Mode": "Modo oscuro", "PayPal Checkout": "Pago con PayPal", "Processing Payment": "Procesando el pago", - "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Espere, su pedido se está procesando y será redirigido al sitio web de PayPal.", - "If you are not automatically redirected to PayPal within 5 seconds": "Si no se le redirige automáticamente a PayPal en 5 segundos", + "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Espere, su pedido se esta procesando y sera redirigido al sitio web de PayPal.", + "If you are not automatically redirected to PayPal within 5 seconds": "Si no se le redirige automaticamente a PayPal en 5 segundos", "Payment Cancelled": "Pago cancelado", "The payment has been cancelled": "El pago ha sido cancelado", "Must have": "Debe tener", diff --git a/LabelStoreMax/lang/fr.json b/LabelStoreMax/lang/fr.json index 27c236d..d4f552a 100644 --- a/LabelStoreMax/lang/fr.json +++ b/LabelStoreMax/lang/fr.json @@ -179,8 +179,8 @@ "Dark Mode": "Mode sombre", "PayPal Checkout": "Paiement PayPal", "Processing Payment": "Traitement du paiement", - "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Veuillez patienter, votre commande est en cours de traitement et vous serez redirigé vers le site PayPal.", - "If you are not automatically redirected to PayPal within 5 seconds": "Si vous n'êtes pas automatiquement redirigé vers PayPal dans les 5 secondes", + "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Veuillez patienter, votre commande est en cours de traitement et vous serez redirige vers le site PayPal.", + "If you are not automatically redirected to PayPal within 5 seconds": "Si vous n'etes pas automatiquement redirige vers PayPal dans les 5 secondes", "Payment Cancelled": "Paiement annulé", "The payment has been cancelled": "Le paiement a été annulé", "Must have": "Doit avoir", diff --git a/LabelStoreMax/lang/it.json b/LabelStoreMax/lang/it.json index ca3cbd2..e1be4bb 100644 --- a/LabelStoreMax/lang/it.json +++ b/LabelStoreMax/lang/it.json @@ -179,7 +179,7 @@ "Dark Mode": "Modalità scura", "PayPal Checkout": "Pagamento PayPal", "Processing Payment": "Pagamento in elaborazione", - "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Attendi, il tuo ordine è in fase di elaborazione e verrai reindirizzato al sito web di PayPal.", + "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Attendi, verrai reindirizzato al sito web di PayPal.", "If you are not automatically redirected to PayPal within 5 seconds": "Se non vieni reindirizzato automaticamente a PayPal entro 5 secondi", "Payment Cancelled": "Pagamento annullato", "The payment has been cancelled": "Il pagamento è stato annullato", diff --git a/LabelStoreMax/lang/pt.json b/LabelStoreMax/lang/pt.json index ddff628..877f449 100644 --- a/LabelStoreMax/lang/pt.json +++ b/LabelStoreMax/lang/pt.json @@ -179,8 +179,8 @@ "Dark Mode": "Modo escuro", "PayPal Checkout": "PayPal Checkout", "Processing Payment": "Processando o pagamento", - "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Aguarde, seu pedido está sendo processado e você será redirecionado para o site do PayPal.", - "If you are not automatically redirected to PayPal within 5 seconds": "Se você não for redirecionado automaticamente para o PayPal em 5 segundos", + "Please wait, your order is being processed and you will be redirected to the PayPal website.": "Aguarde, seu pedido esta sendo processado e voce sera redirecionado para o site do PayPal.", + "If you are not automatically redirected to PayPal within 5 seconds": "Se voce nao for redirecionado automaticamente para o PayPal em 5 segundos", "Payment Cancelled": "Pagamento Cancelado", "The payment has been cancelled": "O pagamento foi cancelado", "Must have": "Deve ter", diff --git a/LabelStoreMax/lib/app/providers/cash_on_delivery.dart b/LabelStoreMax/lib/app/providers/cash_on_delivery.dart index 8bc5935..6f9e571 100644 --- a/LabelStoreMax/lib/app/providers/cash_on_delivery.dart +++ b/LabelStoreMax/lib/app/providers/cash_on_delivery.dart @@ -33,8 +33,7 @@ cashOnDeliveryPay(context, showToastNotification( context, title: trans(context, "Error"), - description: trans(context, - trans(context, "Something went wrong, please contact our store")), + description: trans(context, "Something went wrong, please contact our store"), ); state.reloadState(showLoader: false); } @@ -42,8 +41,7 @@ cashOnDeliveryPay(context, showToastNotification( context, title: trans(context, "Error"), - description: trans(context, - trans(context, "Something went wrong, please contact our store")), + description: trans(context, "Something went wrong, please contact our store"), ); state.reloadState(showLoader: false); } diff --git a/LabelStoreMax/lib/app/providers/example_pay.dart b/LabelStoreMax/lib/app/providers/example_pay.dart index 4656368..337b731 100644 --- a/LabelStoreMax/lib/app/providers/example_pay.dart +++ b/LabelStoreMax/lib/app/providers/example_pay.dart @@ -53,8 +53,7 @@ examplePay(context, showToastNotification( context, title: trans(context, "Error"), - description: trans(context, - trans(context, "Something went wrong, please contact our store")), + description: trans(context, "Something went wrong, please contact our store"), ); state.reloadState(showLoader: false); } diff --git a/LabelStoreMax/lib/app/providers/paypal_pay.dart b/LabelStoreMax/lib/app/providers/paypal_pay.dart index 6e75908..67d3841 100644 --- a/LabelStoreMax/lib/app/providers/paypal_pay.dart +++ b/LabelStoreMax/lib/app/providers/paypal_pay.dart @@ -28,7 +28,7 @@ payPalPay(context, await checkout(taxRate, (total, billingDetails, cart) async { List cartLineItems = await cart.getCart(); String description = await cart.cartShortDesc(); - state.reloadState(showLoader: true); + await Navigator.push( context, MaterialPageRoute( @@ -36,43 +36,43 @@ payPalPay(context, description: description, amount: total, cartLineItems: cartLineItems))).then((value) async { - if (value is Map) { + if (!(value is Map)) { + showToastNotification( + context, + title: trans(context, "Payment Cancelled"), + description: + trans(context, "The payment has been cancelled"), + ); + state.reloadState(showLoader: false); + return; + } + + state.reloadState(showLoader: true); if (value.containsKey("status") && value["status"] == "success") { OrderWC orderWC = await buildOrderWC(taxRate: taxRate, markPaid: true); Order order = await appWooSignal((api) => api.createOrder(orderWC)); - if (order != null) { - Navigator.pushNamed(context, "/checkout-status", arguments: order); - } else { + if (order == null) { showToastNotification( context, title: trans(context, "Error"), - description: trans( - context, - trans(context, - "Something went wrong, please contact our store")), + description: trans(context, + "Something went wrong, please contact our store"), ); - state.reloadState(showLoader: false); + return; } + Navigator.pushNamed(context, "/checkout-status", arguments: order); + return; } else { showToastNotification( context, title: trans(context, "Payment Cancelled"), - description: trans( - context, trans(context, "The payment has been cancelled")), + description: trans(context, "The payment has been cancelled"), ); - state.reloadState(showLoader: false); } - } else { - showToastNotification( - context, - title: trans(context, "Payment Cancelled"), - description: - trans(context, trans(context, "The payment has been cancelled")), - ); - state.reloadState(showLoader: false); } - }); + ); + state.reloadState(showLoader: false); }); } diff --git a/LabelStoreMax/lib/app/providers/razor_pay.dart b/LabelStoreMax/lib/app/providers/razor_pay.dart index 069490e..80b1266 100644 --- a/LabelStoreMax/lib/app/providers/razor_pay.dart +++ b/LabelStoreMax/lib/app/providers/razor_pay.dart @@ -38,10 +38,7 @@ razorPay(context, } else { showToastNotification(context, title: trans(context, "Error"), - description: trans( - context, - trans(context, "Something went wrong, please contact our store"), - ), + description: trans(context, "Something went wrong, please contact our store"), style: ToastNotificationStyleType.WARNING); razorPay.clear(); state.reloadState(showLoader: false); diff --git a/LabelStoreMax/lib/app/providers/stripe_pay.dart b/LabelStoreMax/lib/app/providers/stripe_pay.dart index 17e6719..2a9afb2 100644 --- a/LabelStoreMax/lib/app/providers/stripe_pay.dart +++ b/LabelStoreMax/lib/app/providers/stripe_pay.dart @@ -91,10 +91,8 @@ stripePay(context, showToastNotification( context, title: trans(context, "Error"), - description: trans( - context, - trans(context, - "Something went wrong, please contact our store")), + description: trans(context, + "Something went wrong, please contact our store"), ); state.reloadState(showLoader: false); } diff --git a/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart b/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart index fa5d819..1576906 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_confirmation.dart @@ -51,7 +51,7 @@ class CheckoutConfirmationPageState extends State { _getTaxes(); } - reloadState({bool showLoader}) { + reloadState({@required bool showLoader}) { setState(() { _showFullLoader = showLoader ?? false; }); diff --git a/LabelStoreMax/lib/resources/pages/checkout_details.dart b/LabelStoreMax/lib/resources/pages/checkout_details.dart index a13ead4..ed47564 100644 --- a/LabelStoreMax/lib/resources/pages/checkout_details.dart +++ b/LabelStoreMax/lib/resources/pages/checkout_details.dart @@ -323,11 +323,8 @@ class _CheckoutDetailsPageState extends State { showToastNotification( context, title: trans(context, "Oops"), - description: trans( - context, - trans(context, - "Invalid shipping address, please check your shipping details"), - ), + description: trans(context, + "Invalid shipping address, please check your shipping details"), style: ToastNotificationStyleType.WARNING, ); return; diff --git a/LabelStoreMax/lib/resources/pages/no_connection_page.dart b/LabelStoreMax/lib/resources/pages/no_connection_page.dart index 8c1b205..7502f73 100644 --- a/LabelStoreMax/lib/resources/pages/no_connection_page.dart +++ b/LabelStoreMax/lib/resources/pages/no_connection_page.dart @@ -13,6 +13,7 @@ import 'package:flutter_app/bootstrap/app_helper.dart'; import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:nylo_framework/helpers/helper.dart'; +import 'package:woosignal/models/response/woosignal_app.dart'; class NoConnectionPage extends StatefulWidget { NoConnectionPage(); @@ -62,14 +63,17 @@ class _NoConnectionPageState extends State { } _retry() async { - AppHelper.instance.appConfig = await appWooSignal((api) => api.getApp()); + WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp()); - if (AppHelper.instance.appConfig != null) { - Navigator.pushNamed(context, "/home"); + if (wooSignalApp == null) { + showToastNotification(context, + title: trans(context, "Oops"), + description: trans(context, "Retry later")); return; } - showToastNotification(context, - title: trans(context, "Oops"), - description: trans(context, "Retry later")); + + AppHelper.instance.appConfig = wooSignalApp; + AppHelper.instance.themeType = wooSignalApp.theme; + Navigator.pushNamed(context, "/home"); } } diff --git a/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart b/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart index 2e468b3..9fc0799 100644 --- a/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart +++ b/LabelStoreMax/lib/resources/widgets/checkout_paypal.dart @@ -115,16 +115,21 @@ class WebViewState extends NyState { } String _loadHTML() { + final String strProcessingPayment = trans(context, "Processing Payment"); + final String strPleaseWait = trans(context, "Please wait, your order is being processed and you will be redirected to the PayPal website."); + final String strRedirectMessage = trans(context, "If you are not automatically redirected to PayPal within 5 seconds"); + return ''' - ${trans(context, "Processing Payment")}... + $strProcessingPayment...
-

${trans(context, "Please wait, your order is being processed and you will be redirected to the PayPal website.")}

+

$strPleaseWait

+ @@ -133,10 +138,10 @@ class WebViewState extends NyState { $formCheckoutShippingAddress -


${trans(context, "If you are not automatically redirected to PayPal within 5 seconds")}...

+


$strRedirectMessage...

-'''; +'''.toString(); } @override diff --git a/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart b/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart index b7465a9..8e3f7ab 100644 --- a/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart +++ b/LabelStoreMax/lib/resources/widgets/notic_home_widget.dart @@ -151,14 +151,17 @@ class _NoticHomeWidgetState extends State { height: MediaQuery.of(context).size.height / 2.5, ), Container( - height: 80, + height: 100, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(trans(context, "Must have")), - Text( - trans(context, "Our selection of new items"), - style: Theme.of(context).textTheme.headline4, + Flexible( + child: Text( + trans(context, "Our selection of new items"), + style: Theme.of(context).textTheme.headline4, + maxLines: 2, overflow: TextOverflow.ellipsis, + ), ) ], ), diff --git a/LabelStoreMax/pubspec.yaml b/LabelStoreMax/pubspec.yaml index 7c879ff..55272ff 100644 --- a/LabelStoreMax/pubspec.yaml +++ b/LabelStoreMax/pubspec.yaml @@ -1,7 +1,7 @@ # Official WooSignal App Template for WooCommerce # Label StoreMax -# Version: 5.0.1 +# Version: 5.0.2 # Author: Anthony Gordon # Homepage: https://woosignal.com # Documentation: https://woosignal.com/docs/app/ios/label-storemax diff --git a/README.md b/README.md index 323fd03..278523a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # WooCommerce App: Label StoreMax -### Label StoreMax - v5.0.1 +### Label StoreMax - v5.0.2 [Official WooSignal WooCommerce App](https://woosignal.com)