v5.0.2 - updates

This commit is contained in:
Anthony Gordon 2021-04-17 18:53:07 +01:00
parent 40f3ebb6ac
commit d08d1b0fe3
19 changed files with 75 additions and 66 deletions

View File

@ -34,6 +34,8 @@ PAYPAL_ACCOUNT_EMAIL="mystore@business.com"
# Your PayPal account email e.g. mystore@business.com # Your PayPal account email e.g. mystore@business.com
PAYPAL_LIVE_MODE="false" PAYPAL_LIVE_MODE="false"
# Change to 'true' for live payments # 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/
# *<! ------ EXTRAS ------!>* # *<! ------ EXTRAS ------!>*

View File

@ -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 ## [5.0.1] - 2020-04-13
* Update to app_payment_gateways * Update to app_payment_gateways

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.0.1 ### Label StoreMax - v5.0.2
[Official WooSignal WooCommerce App](https://woosignal.com) [Official WooSignal WooCommerce App](https://woosignal.com)

View File

@ -179,8 +179,8 @@
"Dark Mode": "Modo oscuro", "Dark Mode": "Modo oscuro",
"PayPal Checkout": "Pago con PayPal", "PayPal Checkout": "Pago con PayPal",
"Processing Payment": "Procesando el pago", "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.", "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 automáticamente a PayPal en 5 segundos", "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", "Payment Cancelled": "Pago cancelado",
"The payment has been cancelled": "El pago ha sido cancelado", "The payment has been cancelled": "El pago ha sido cancelado",
"Must have": "Debe tener", "Must have": "Debe tener",

View File

@ -179,8 +179,8 @@
"Dark Mode": "Mode sombre", "Dark Mode": "Mode sombre",
"PayPal Checkout": "Paiement PayPal", "PayPal Checkout": "Paiement PayPal",
"Processing Payment": "Traitement du paiement", "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.", "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'êtes pas automatiquement redirigé vers PayPal dans les 5 secondes", "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é", "Payment Cancelled": "Paiement annulé",
"The payment has been cancelled": "Le paiement a été annulé", "The payment has been cancelled": "Le paiement a été annulé",
"Must have": "Doit avoir", "Must have": "Doit avoir",

View File

@ -179,7 +179,7 @@
"Dark Mode": "Modalità scura", "Dark Mode": "Modalità scura",
"PayPal Checkout": "Pagamento PayPal", "PayPal Checkout": "Pagamento PayPal",
"Processing Payment": "Pagamento in elaborazione", "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", "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", "Payment Cancelled": "Pagamento annullato",
"The payment has been cancelled": "Il pagamento è stato annullato", "The payment has been cancelled": "Il pagamento è stato annullato",

View File

@ -179,8 +179,8 @@
"Dark Mode": "Modo escuro", "Dark Mode": "Modo escuro",
"PayPal Checkout": "PayPal Checkout", "PayPal Checkout": "PayPal Checkout",
"Processing Payment": "Processando o pagamento", "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.", "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 você não for redirecionado automaticamente para o PayPal em 5 segundos", "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", "Payment Cancelled": "Pagamento Cancelado",
"The payment has been cancelled": "O pagamento foi cancelado", "The payment has been cancelled": "O pagamento foi cancelado",
"Must have": "Deve ter", "Must have": "Deve ter",

View File

@ -33,8 +33,7 @@ cashOnDeliveryPay(context,
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans(context, "Error"),
description: trans(context, description: trans(context, "Something went wrong, please contact our store"),
trans(context, "Something went wrong, please contact our store")),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }
@ -42,8 +41,7 @@ cashOnDeliveryPay(context,
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans(context, "Error"),
description: trans(context, description: trans(context, "Something went wrong, please contact our store"),
trans(context, "Something went wrong, please contact our store")),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }

View File

@ -53,8 +53,7 @@ examplePay(context,
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans(context, "Error"),
description: trans(context, description: trans(context, "Something went wrong, please contact our store"),
trans(context, "Something went wrong, please contact our store")),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }

View File

@ -28,7 +28,7 @@ payPalPay(context,
await checkout(taxRate, (total, billingDetails, cart) async { await checkout(taxRate, (total, billingDetails, cart) async {
List<CartLineItem> cartLineItems = await cart.getCart(); List<CartLineItem> cartLineItems = await cart.getCart();
String description = await cart.cartShortDesc(); String description = await cart.cartShortDesc();
state.reloadState(showLoader: true);
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -36,43 +36,43 @@ payPalPay(context,
description: description, description: description,
amount: total, amount: total,
cartLineItems: cartLineItems))).then((value) async { cartLineItems: cartLineItems))).then((value) async {
if (value is Map<String, dynamic>) { if (!(value is Map<String, dynamic>)) {
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") { if (value.containsKey("status") && value["status"] == "success") {
OrderWC orderWC = OrderWC orderWC =
await buildOrderWC(taxRate: taxRate, markPaid: true); await buildOrderWC(taxRate: taxRate, markPaid: true);
Order order = await appWooSignal((api) => api.createOrder(orderWC)); Order order = await appWooSignal((api) => api.createOrder(orderWC));
if (order != null) { if (order == null) {
Navigator.pushNamed(context, "/checkout-status", arguments: order);
} else {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans(context, "Error"),
description: trans( description: trans(context,
context, "Something went wrong, please contact our store"),
trans(context,
"Something went wrong, please contact our store")),
); );
state.reloadState(showLoader: false); return;
} }
Navigator.pushNamed(context, "/checkout-status", arguments: order);
return;
} else { } else {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Payment Cancelled"), title: trans(context, "Payment Cancelled"),
description: trans( description: trans(context, "The payment has been cancelled"),
context, trans(context, "The payment has been cancelled")), );
}
}
); );
state.reloadState(showLoader: false); 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);
}
});
}); });
} }

View File

@ -38,10 +38,7 @@ razorPay(context,
} else { } else {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Error"), title: trans(context, "Error"),
description: trans( description: trans(context, "Something went wrong, please contact our store"),
context,
trans(context, "Something went wrong, please contact our store"),
),
style: ToastNotificationStyleType.WARNING); style: ToastNotificationStyleType.WARNING);
razorPay.clear(); razorPay.clear();
state.reloadState(showLoader: false); state.reloadState(showLoader: false);

View File

@ -91,10 +91,8 @@ stripePay(context,
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Error"), title: trans(context, "Error"),
description: trans( description: trans(context,
context, "Something went wrong, please contact our store"),
trans(context,
"Something went wrong, please contact our store")),
); );
state.reloadState(showLoader: false); state.reloadState(showLoader: false);
} }

View File

@ -51,7 +51,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
_getTaxes(); _getTaxes();
} }
reloadState({bool showLoader}) { reloadState({@required bool showLoader}) {
setState(() { setState(() {
_showFullLoader = showLoader ?? false; _showFullLoader = showLoader ?? false;
}); });

View File

@ -323,11 +323,8 @@ class _CheckoutDetailsPageState extends State<CheckoutDetailsPage> {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops"), title: trans(context, "Oops"),
description: trans( description: trans(context,
context,
trans(context,
"Invalid shipping address, please check your shipping details"), "Invalid shipping address, please check your shipping details"),
),
style: ToastNotificationStyleType.WARNING, style: ToastNotificationStyleType.WARNING,
); );
return; return;

View File

@ -13,6 +13,7 @@ import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/bootstrap/helpers.dart'; import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:nylo_framework/helpers/helper.dart'; import 'package:nylo_framework/helpers/helper.dart';
import 'package:woosignal/models/response/woosignal_app.dart';
class NoConnectionPage extends StatefulWidget { class NoConnectionPage extends StatefulWidget {
NoConnectionPage(); NoConnectionPage();
@ -62,14 +63,17 @@ class _NoConnectionPageState extends State<NoConnectionPage> {
} }
_retry() async { _retry() async {
AppHelper.instance.appConfig = await appWooSignal((api) => api.getApp()); WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp());
if (AppHelper.instance.appConfig != null) { if (wooSignalApp == null) {
Navigator.pushNamed(context, "/home");
return;
}
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans(context, "Oops"),
description: trans(context, "Retry later")); description: trans(context, "Retry later"));
return;
}
AppHelper.instance.appConfig = wooSignalApp;
AppHelper.instance.themeType = wooSignalApp.theme;
Navigator.pushNamed(context, "/home");
} }
} }

View File

@ -115,16 +115,21 @@ class WebViewState extends NyState<PayPalCheckout> {
} }
String _loadHTML() { 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 ''' return '''
<html><head><title>${trans(context, "Processing Payment")}...</title></head> <html><head><title>$strProcessingPayment...</title></head>
<body onload="document.forms['paypal_form'].submit();"> <body onload="document.forms['paypal_form'].submit();">
<div style="text-align:center;"> <div style="text-align:center;">
<img src="https://woosignal.com/images/paypal_logo.png" height="50" /> <img src="https://woosignal.com/images/paypal_logo.png" height="50" />
</div> </div>
<center><h4>${trans(context, "Please wait, your order is being processed and you will be redirected to the PayPal website.")}</h4></center> <center><h4>$strPleaseWait</h4></center>
<form method="post" name="paypal_form" action="${getPayPalUrl()}"> <form method="post" name="paypal_form" action="${getPayPalUrl()}">
<input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="amount" value="${widget.amount}"> <input type="hidden" name="amount" value="${widget.amount}">
<input type="hidden" name="lc" value="${getEnv('PAYPAL_LOCALE', defaultValue: 'en-GB')}">
<input type="hidden" name="currency_code" value="${_wooSignalApp.currencyMeta.code}"> <input type="hidden" name="currency_code" value="${_wooSignalApp.currencyMeta.code}">
<input type="hidden" name="business" value="${getEnv('PAYPAL_ACCOUNT_EMAIL')}"> <input type="hidden" name="business" value="${getEnv('PAYPAL_ACCOUNT_EMAIL')}">
<input type="hidden" name="return" value="https://woosignal.com/paypal/payment~success"> <input type="hidden" name="return" value="https://woosignal.com/paypal/payment~success">
@ -133,10 +138,10 @@ class WebViewState extends NyState<PayPalCheckout> {
<input type="hidden" name="custom" value="${getPayPalPaymentType()}"> <input type="hidden" name="custom" value="${getPayPalPaymentType()}">
<input type="hidden" name="address_override" value="1"> <input type="hidden" name="address_override" value="1">
$formCheckoutShippingAddress $formCheckoutShippingAddress
<center><br><br>${trans(context, "If you are not automatically redirected to PayPal within 5 seconds")}...<br><br> <center><br><br>$strRedirectMessage...<br><br>
<input type="submit" value="Click Here"></center> <input type="submit" value="Click Here"></center>
</form></body></html> </form></body></html>
'''; '''.toString();
} }
@override @override

View File

@ -151,14 +151,17 @@ class _NoticHomeWidgetState extends State<NoticHomeWidget> {
height: MediaQuery.of(context).size.height / 2.5, height: MediaQuery.of(context).size.height / 2.5,
), ),
Container( Container(
height: 80, height: 100,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(trans(context, "Must have")), Text(trans(context, "Must have")),
Text( Flexible(
child: Text(
trans(context, "Our selection of new items"), trans(context, "Our selection of new items"),
style: Theme.of(context).textTheme.headline4, style: Theme.of(context).textTheme.headline4,
maxLines: 2, overflow: TextOverflow.ellipsis,
),
) )
], ],
), ),

View File

@ -1,7 +1,7 @@
# Official WooSignal App Template for WooCommerce # Official WooSignal App Template for WooCommerce
# Label StoreMax # Label StoreMax
# Version: 5.0.1 # Version: 5.0.2
# Author: Anthony Gordon # Author: Anthony Gordon
# Homepage: https://woosignal.com # Homepage: https://woosignal.com
# Documentation: https://woosignal.com/docs/app/ios/label-storemax # Documentation: https://woosignal.com/docs/app/ios/label-storemax

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.0.1 ### Label StoreMax - v5.0.2
[Official WooSignal WooCommerce App](https://woosignal.com) [Official WooSignal WooCommerce App](https://woosignal.com)