v5.3.0 - Ability to update payment providers via WooSignal Dashboard, Pubspec.yaml dependency updates

This commit is contained in:
Anthony 2021-11-02 21:16:28 +00:00
parent 4b306053c4
commit 5bd16b945a
24 changed files with 128 additions and 90 deletions

View File

@ -10,7 +10,7 @@ ASSET_PATH_IMAGES="public/assets/images"
TIMEZONE="UTC" TIMEZONE="UTC"
# *<! ------ Language ------!>* # *<! ------ Language ------!>*
DEFAULT_LOCALE="en" DEFAULT_LOCALE=null
# supports: "en" (English), "es" (Spanish), "fr" (French), "hi" (Hindi), "it" (Italian), "pt" (Portuguese) or "zh" (Simplified Chinese) # supports: "en" (English), "es" (Spanish), "fr" (French), "hi" (Hindi), "it" (Italian), "pt" (Portuguese) or "zh" (Simplified Chinese)
# *<! ------ WooSignal Config ------!>* # *<! ------ WooSignal Config ------!>*
@ -20,10 +20,10 @@ APP_KEY="your app key"
# *<! ------ STRIPE (OPTIONAL) ------!>* # *<! ------ STRIPE (OPTIONAL) ------!>*
STRIPE_ACCOUNT="Stripe account key from WooSignal" STRIPE_ACCOUNT=null
# Stripe account key from WooSignal https://woosignal.com/dashboard # Stripe account key from WooSignal https://woosignal.com/dashboard
STRIPE_COUNTRY_CODE="GB" STRIPE_COUNTRY_CODE=null
# Alpha-2 country code list: https://www.iban.com/country-codes # Alpha-2 country code list: https://www.iban.com/country-codes
STRIPE_LIVE_MODE=null STRIPE_LIVE_MODE=null
@ -31,11 +31,11 @@ STRIPE_LIVE_MODE=null
# *<! ------ PAYPAL (OPTIONAL) ------!>* # *<! ------ PAYPAL (OPTIONAL) ------!>*
PAYPAL_ACCOUNT_EMAIL="mystore@business.com" PAYPAL_ACCOUNT_EMAIL=null
# 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=null
# Change to 'true' for live payments # Change to 'true' for live payments
PAYPAL_LOCALE="en-GB" PAYPAL_LOCALE=null
# Use BCP-47 code from this link https://developer.paypal.com/docs/api/reference/locale-codes/ # Use BCP-47 code from this link https://developer.paypal.com/docs/api/reference/locale-codes/
# *<! ------ EXTRAS ------!>* # *<! ------ EXTRAS ------!>*

View File

@ -1,8 +1,13 @@
## [5.2.1] - 2020-10-13 ## [5.3.0] - 2021-11-02
* Ability to update payment providers via WooSignal Dashboard
* Pubspec.yaml dependency updates
## [5.2.1] - 2021-10-13
* Bug fixes * Bug fixes
## [5.2.0] - 2020-10-12 ## [5.2.0] - 2021-10-12
* Migrate to Nylo 2.1.0 * Migrate to Nylo 2.1.0
* Use flutter_stripe library for payments * Use flutter_stripe library for payments
@ -11,47 +16,47 @@
* Android compileSdkVersion 30 * Android compileSdkVersion 30
* Bug fixes * Bug fixes
## [5.1.0] - 2020-07-19 ## [5.1.0] - 2021-07-19
* Add support for simplified Chinese locale (zh) * Add support for simplified Chinese locale (zh)
* Add ability to change language from WooSignal dashboard * Add ability to change language from WooSignal dashboard
## [5.0.7] - 2020-07-08 ## [5.0.7] - 2021-07-08
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
## [5.0.6] - 2020-07-08 ## [5.0.6] - 2021-07-08
* Refactor project to use Nylo v1.0.0 * Refactor project to use Nylo v1.0.0
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
## [5.0.5] - 2020-05-03 ## [5.0.5] - 2021-05-03
* Add NSCameraUsageDescription meta to plist for IOS * Add NSCameraUsageDescription meta to plist for IOS
## [5.0.4] - 2020-04-30 ## [5.0.4] - 2021-04-30
* Fix IOS build failing with Stripe * Fix IOS build failing with Stripe
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
## [5.0.3] - 2020-04-27 ## [5.0.3] - 2021-04-27
* Fix issue account page when logged in for Notic theme * Fix issue account page when logged in for Notic theme
* Small tweak to helpers.dart * Small tweak to helpers.dart
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
## [5.0.2] - 2020-04-17 ## [5.0.2] - 2021-04-17
* Fix issue with PayPal checkout when using different locales * Fix issue with PayPal checkout when using different locales
* Fix nested `trans` methods * Fix nested `trans` methods
* PAYPAL_LOCALE added to .env file * PAYPAL_LOCALE added to .env file
## [5.0.1] - 2020-04-13 ## [5.0.1] - 2021-04-13
* Update to app_payment_gateways * Update to app_payment_gateways
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
## [5.0.0] - 2020-04-11 ## [5.0.0] - 2021-04-11
* Major release * Major release
* Null safety libraries added * Null safety libraries added
@ -62,7 +67,7 @@
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
* Bug fixes * Bug fixes
## [4.0.0] - 2020-03-28 ## [4.0.0] - 2021-03-28
* Major release * Major release
* New config structure * New config structure
@ -74,7 +79,7 @@
* Dart code formatted * Dart code formatted
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
## [3.0.0] - 2020-03-08 ## [3.0.0] - 2021-03-08
* Major release * Major release
* Flutter 2.0.0+ support * Flutter 2.0.0+ support
@ -82,14 +87,14 @@
* Code tidy up * Code tidy up
* Bug fixes * Bug fixes
## [2.6.0] - 2020-02-24 ## [2.6.0] - 2021-02-24
* Ability to manage affiliate products * Ability to manage affiliate products
* Refreshed design for checkout details screen * Refreshed design for checkout details screen
* New logic to manage shipping better * New logic to manage shipping better
* Bug fixes * Bug fixes
## [2.5.1] - 2020-02-21 ## [2.5.1] - 2021-02-21
* Pubspec.yaml dependency updates * Pubspec.yaml dependency updates
* Bug fixes * Bug fixes

View File

@ -4,7 +4,7 @@
# WooCommerce App: Label StoreMax # WooCommerce App: Label StoreMax
### Label StoreMax - v5.2.1 ### Label StoreMax - v5.3.0
[Official WooSignal WooCommerce App](https://woosignal.com) [Official WooSignal WooCommerce App](https://woosignal.com)
@ -35,7 +35,7 @@ You can also upload the app to the IOS app store and Google play store using Flu
2. Sign up for free on [WooSignal](https://woosignal.com) and link your WooCommerce store 2. Sign up for free on [WooSignal](https://woosignal.com) and link your WooCommerce store
3. Add your app key into the **.env** file and hit play (with Android Studio) to build the app 🥳 3. Add your app key into the **.env** file and hit play (with Android Studio) to build the app 🥳
Full documentation this available [here](https://woosignal.com/docs/app/ios/label-storemax) Full documentation this available [here](https://woosignal.com/docs/app/label-storemax)
## Some features integrated ## Some features integrated

View File

@ -185,5 +185,6 @@
"The payment has been cancelled": "Die Zahlung wurde storniert", "The payment has been cancelled": "Die Zahlung wurde storniert",
"Must have": "Haben müssen", "Must have": "Haben müssen",
"Our selection of new items": "Unsere Auswahl an Neuheiten", "Our selection of new items": "Unsere Auswahl an Neuheiten",
"Register": "Registrieren" "Register": "Registrieren",
"No payment methods are available": "Es sind keine Zahlungsmethoden verfügbar"
} }

View File

@ -185,5 +185,6 @@
"The payment has been cancelled": "The payment has been cancelled", "The payment has been cancelled": "The payment has been cancelled",
"Must have": "Must have", "Must have": "Must have",
"Our selection of new items": "Our selection of new items", "Our selection of new items": "Our selection of new items",
"Register": "Register" "Register": "Register",
"No payment methods are available": "No payment methods are available"
} }

View File

@ -185,5 +185,6 @@
"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",
"Our selection of new items": "Nuestra selección de novedades", "Our selection of new items": "Nuestra selección de novedades",
"Register": "Registrarse" "Register": "Registrarse",
"No payment methods are available": "No hay métodos de pago disponibles."
} }

View File

@ -185,5 +185,6 @@
"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",
"Our selection of new items": "Notre sélection de nouveautés", "Our selection of new items": "Notre sélection de nouveautés",
"Register": "S'inscrire" "Register": "S'inscrire",
"No payment methods are available": "Aucun mode de paiement n'est disponible"
} }

View File

@ -185,5 +185,6 @@
"The payment has been cancelled": "bhugataan radd kar diya gaya hai", "The payment has been cancelled": "bhugataan radd kar diya gaya hai",
"Must have": "hona aavashyak hai", "Must have": "hona aavashyak hai",
"Our selection of new items": "naee vastuon ka hamaara chayan", "Our selection of new items": "naee vastuon ka hamaara chayan",
"Register": "rajistar karen" "Register": "rajistar karen",
"No payment methods are available": "koee bhugataan vidhiyaan upalabdh nahin hain"
} }

View File

@ -185,5 +185,6 @@
"The payment has been cancelled": "Il pagamento è stato annullato", "The payment has been cancelled": "Il pagamento è stato annullato",
"Must have": "Deve avere", "Must have": "Deve avere",
"Our selection of new items": "La nostra selezione di nuovi articoli", "Our selection of new items": "La nostra selezione di nuovi articoli",
"Register": "Registrati" "Register": "Registrati",
"No payment methods are available": "Non sono disponibili metodi di pagamento"
} }

View File

@ -185,5 +185,6 @@
"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",
"Our selection of new items": "Nossa seleção de novos itens", "Our selection of new items": "Nossa seleção de novos itens",
"Register": "Registro" "Register": "Registro",
"No payment methods are available": "Nenhum método de pagamento disponível"
} }

View File

@ -185,5 +185,6 @@
"The payment has been cancelled": "付款已取消", "The payment has been cancelled": "付款已取消",
"Must have": "一定有", "Must have": "一定有",
"Our selection of new items": "我们精选的新品", "Our selection of new items": "我们精选的新品",
"Register": "登记" "Register": "登记",
"No payment methods are available": "没有可用的付款方式"
} }

View File

@ -34,8 +34,15 @@ stripePay(context,
: getEnv('STRIPE_LIVE_MODE', defaultValue: false); : getEnv('STRIPE_LIVE_MODE', defaultValue: false);
// CONFIGURE STRIPE // CONFIGURE STRIPE
Stripe.stripeAccountId = getEnv('STRIPE_ACCOUNT'); Stripe.stripeAccountId = getEnv('STRIPE_ACCOUNT') == null ? wooSignalApp.stripeAccount : getEnv('STRIPE_ACCOUNT');
Stripe.publishableKey = liveMode ? "pk_live_IyS4Vt86L49jITSfaUShumzi" : "pk_test_0jMmpBntJ6UkizPkfiB8ZJxH"; // Don't change this value Stripe.publishableKey = liveMode ? "pk_live_IyS4Vt86L49jITSfaUShumzi" : "pk_test_0jMmpBntJ6UkizPkfiB8ZJxH"; // Don't change this value
await Stripe.instance.applySettings();
if (Stripe.stripeAccountId == '') {
NyLogger.error('You need to connect your Stripe account to WooSignal via the dashboard https://woosignal.com/dashboard');
return;
}
try { try {
dynamic rsp = {}; dynamic rsp = {};
@ -77,8 +84,8 @@ stripePay(context,
googlePay: false, googlePay: false,
style: Theme.of(state.context).brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark, style: Theme.of(state.context).brightness == Brightness.light ? ThemeMode.light : ThemeMode.dark,
testEnv: liveMode, testEnv: liveMode,
merchantCountryCode: getEnv('STRIPE_COUNTRY_CODE', defaultValue: 'GB'), merchantCountryCode: envVal('STRIPE_COUNTRY_CODE', defaultValue: wooSignalApp.stripeCountryCode),
merchantDisplayName: getEnv('APP_NAME'), merchantDisplayName: envVal('APP_NAME', defaultValue: wooSignalApp.appName),
paymentIntentClientSecret: rsp['client_secret'], paymentIntentClientSecret: rsp['client_secret'],
)); ));
@ -103,6 +110,9 @@ stripePay(context,
Navigator.pushNamed(context, "/checkout-status", arguments: order); Navigator.pushNamed(context, "/checkout-status", arguments: order);
} on StripeException catch(e) { } on StripeException catch(e) {
if (getEnv('APP_DEBUG', defaultValue: true)) {
NyLogger.error(e.error.message);
}
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Oops!"), title: trans(context, "Oops!"),

View File

@ -52,24 +52,41 @@ appWooSignal(Function(WooSignal) api) async {
return await api(wooSignal); return await api(wooSignal);
} }
List<PaymentType> getPaymentTypes() => List<PaymentType> getPaymentTypes() {
paymentTypeList.where((v) => v != null).toList(); List<PaymentType> paymentTypes = [];
app_payment_gateways.forEach((element) {
if (paymentTypes.firstWhere((paymentType) => paymentType.name != element, orElse: () => null) == null) {
paymentTypes.add(paymentTypeList.firstWhere((paymentTypeList) => paymentTypeList.name == element, orElse: () => null));
}
});
if (!app_payment_gateways.contains('Stripe') && AppHelper.instance.appConfig.stripeEnabled == true) {
paymentTypes.add(paymentTypeList.firstWhere((element) => element.name == "Stripe", orElse: () => null));
}
if (!app_payment_gateways.contains('PayPal') && AppHelper.instance.appConfig.paypalEnabled == true) {
paymentTypes.add(paymentTypeList.firstWhere((element) => element.name == "PayPal", orElse: () => null));
}
if (!app_payment_gateways.contains('CashOnDelivery') && AppHelper.instance.appConfig.codEnabled == true) {
paymentTypes.add(paymentTypeList.firstWhere((element) => element.name == "CashOnDelivery", orElse: () => null));
}
return paymentTypes.where((v) => v != null).toList();
}
dynamic envVal(String envVal, {dynamic defaultValue}) => (getEnv(envVal) == null ? defaultValue : getEnv(envVal));
PaymentType addPayment( PaymentType addPayment(
{@required int id, {@required int id,
@required String name, @required String name,
@required String desc, @required String desc,
@required String assetImage, @required String assetImage,
@required Function pay}) => @required Function pay}) => PaymentType(
app_payment_gateways.contains(name)
? PaymentType(
id: id, id: id,
name: name, name: name,
desc: desc, desc: desc,
assetImage: assetImage, assetImage: assetImage,
pay: pay, pay: pay,
) );
: null;
showStatusAlert(context, showStatusAlert(context,
{@required String title, String subtitle, IconData icon, int duration}) { {@required String title, String subtitle, IconData icon, int duration}) {

View File

@ -5,15 +5,10 @@ import 'package:flutter/cupertino.dart';
| APP LOCALE | APP LOCALE
| |
| Configure the language by setting the locale. | Configure the language by setting the locale.
|
| e.g. Change app_locale = Locale('es'); for Spanish.
| You can only use one of the supported locales below in app_locales_supported. | You can only use one of the supported locales below in app_locales_supported.
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
const Locale app_locale = null; // by default it will use the "DEFAULT_LOCALE" value from the /.env
// const Locale app_locale = Locale('en'); // uncomment to change the locale here too.
const List<Locale> app_locales_supported = [ const List<Locale> app_locales_supported = [
Locale('en'), Locale('en'),
Locale('es'), Locale('es'),

View File

@ -13,7 +13,7 @@ import 'package:flutter_app/bootstrap/helpers.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
const app_payment_gateways = ["Stripe", "CashOnDelivery", "PayPal"]; const app_payment_gateways = [];
// Available: "Stripe", "CashOnDelivery", "PayPal" // Available: "Stripe", "CashOnDelivery", "PayPal"
// e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery. // e.g. app_payment_gateways = ["Stripe", "CashOnDelivery"]; will only use Stripe and Cash on Delivery.

View File

@ -16,7 +16,7 @@ import 'package:google_fonts/google_fonts.dart';
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
*/ */
final TextStyle appThemeFont = GoogleFonts.overpass(); final TextStyle appThemeFont = GoogleFonts.poppins();
// e.g. custom font in pubspec.yaml - https://flutter.dev/docs/cookbook/design/fonts // e.g. custom font in pubspec.yaml - https://flutter.dev/docs/cookbook/design/fonts
// final TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo"); // final TextStyle appThemeFont = TextStyle(fontFamily: "ZenTokyoZoo");

View File

@ -23,7 +23,7 @@ void main() async {
String initialRoute = '/no-connection'; String initialRoute = '/no-connection';
WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp()); WooSignalApp wooSignalApp = await appWooSignal((api) => api.getApp());
Locale locale = app_locale; Locale locale;
if (wooSignalApp != null) { if (wooSignalApp != null) {
initialRoute = "/home"; initialRoute = "/home";
@ -38,11 +38,7 @@ void main() async {
); );
} }
if (locale == null && wooSignalApp.locale != null) { locale = Locale((getEnv('DEFAULT_LOCALE', defaultValue: null) == null && wooSignalApp.locale != null) ? wooSignalApp.locale : envVal('DEFAULT_LOCALE', defaultValue: 'en'));
locale = Locale(wooSignalApp.locale);
} else {
locale = Locale(getEnv('DEFAULT_LOCALE', defaultValue: 'en'));
}
} }
runApp( runApp(

View File

@ -44,19 +44,19 @@ class _CartPageState extends State<CartPage> {
_cartCheck() async { _cartCheck() async {
List<CartLineItem> cart = await Cart.getInstance.getCart(); List<CartLineItem> cart = await Cart.getInstance.getCart();
if (cart.length <= 0) { if (cart.length == 0) {
setState(() { setState(() {
_isLoading = false; _isLoading = false;
_isCartEmpty = (cart.length <= 0) ? true : false; _isCartEmpty = true;
}); });
return []; return;
} }
List<Map<String, dynamic>> cartJSON = cart.map((c) => c.toJson()).toList(); List<Map<String, dynamic>> cartJSON = cart.map((c) => c.toJson()).toList();
List<dynamic> cartRes = List<dynamic> cartRes =
await appWooSignal((api) => api.cartCheck(cartJSON)); await appWooSignal((api) => api.cartCheck(cartJSON));
if (cartRes.length <= 0) { if (cartRes.length == 0) {
Cart.getInstance.saveCartToPref(cartLineItems: []); Cart.getInstance.saveCartToPref(cartLineItems: []);
setState(() { setState(() {
_isCartEmpty = true; _isCartEmpty = true;
@ -80,7 +80,7 @@ class _CartPageState extends State<CartPage> {
return; return;
} }
if (cartLineItems.length <= 0) { if (cartLineItems.length == 0) {
showToastNotification( showToastNotification(
context, context,
title: trans(context, "Cart"), title: trans(context, "Cart"),

View File

@ -443,7 +443,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
_isProcessingPayment = true; _isProcessingPayment = true;
}); });
CheckoutSession.getInstance.paymentType await CheckoutSession.getInstance.paymentType
.pay(context, state: this, taxRate: _taxRate); .pay(context, state: this, taxRate: _taxRate);
Future.delayed(Duration(milliseconds: 5000), () { Future.delayed(Duration(milliseconds: 5000), () {

View File

@ -16,6 +16,7 @@ import 'package:flutter_app/bootstrap/helpers.dart';
import 'package:flutter_app/config/app_theme.dart'; import 'package:flutter_app/config/app_theme.dart';
import 'package:flutter_app/resources/widgets/buttons.dart'; import 'package:flutter_app/resources/widgets/buttons.dart';
import 'package:flutter_app/resources/widgets/woosignal_ui.dart'; import 'package:flutter_app/resources/widgets/woosignal_ui.dart';
import 'package:nylo_framework/nylo_framework.dart';
import 'package:nylo_support/helpers/helper.dart'; import 'package:nylo_support/helpers/helper.dart';
class CheckoutPaymentTypePage extends StatefulWidget { class CheckoutPaymentTypePage extends StatefulWidget {
@ -42,7 +43,10 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
List<PaymentType> paymentTypes = getPaymentTypes();
if (paymentTypes.length == 0 && getEnv('APP_DEBUG', defaultValue: false) == true) {
NyLogger.info('You have no payment methods set. Visit the WooSignal dashboard (https://woosignal.com/dashboard) to set a payment method.');
}
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
@ -75,11 +79,14 @@ class _CheckoutPaymentTypePageState extends State<CheckoutPaymentTypePage> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: ListView.separated( child: paymentTypes.length == 0 ? Container(
itemCount: getPaymentTypes().length, padding: EdgeInsets.only(top: 20),
child: Text(trans(context, "No payment methods are available"), style: Theme.of(context).textTheme.bodyText1,),
) : ListView.separated(
itemCount: paymentTypes.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
PaymentType paymentType = PaymentType paymentType =
getPaymentTypes()[index]; paymentTypes[index];
return ListTile( return ListTile(
contentPadding: EdgeInsets.only( contentPadding: EdgeInsets.only(
top: 10, top: 10,

View File

@ -148,6 +148,7 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
} }
_modalBottomSheetAttributes() { _modalBottomSheetAttributes() {
WS.ProductVariation productVariation = findProductVariation();
wsModalBottom( wsModalBottom(
context, context,
title: trans(context, "Options"), title: trans(context, "Options"),
@ -182,18 +183,18 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Text( Text(
(findProductVariation() != null (productVariation != null
? "${trans(context, "Price")}: ${formatStringCurrency(total: findProductVariation().price)}" ? "${trans(context, "Price")}: ${formatStringCurrency(total: productVariation.price)}"
: (((_product.attributes.length == : (((_product.attributes.length ==
_tmpAttributeObj.values.length) && _tmpAttributeObj.values.length) &&
findProductVariation() == null) productVariation == null)
? trans(context, "This variation is unavailable") ? trans(context, "This variation is unavailable")
: trans(context, "Choose your options"))), : trans(context, "Choose your options"))),
style: Theme.of(context).textTheme.subtitle1, style: Theme.of(context).textTheme.subtitle1,
), ),
Text( Text(
(findProductVariation() != null (productVariation != null
? findProductVariation().stockStatus != "instock" ? productVariation.stockStatus != "instock"
? trans(context, "Out of stock") ? trans(context, "Out of stock")
: "" : ""
: ""), : ""),
@ -212,7 +213,6 @@ class _ProductDetailState extends NyState<ProductDetailPage> {
return; return;
} }
WS.ProductVariation productVariation = findProductVariation();
if (productVariation == null) { if (productVariation == null) {
showToastNotification(context, showToastNotification(context,
title: trans(context, "Oops"), title: trans(context, "Oops"),

View File

@ -77,7 +77,7 @@ class WebViewState extends NyState<PayPalCheckout> {
} }
String getPayPalUrl() { String getPayPalUrl() {
bool liveMode = getEnv('PAYPAL_LIVE_MODE', defaultValue: false); bool liveMode = envVal('PAYPAL_LIVE_MODE', defaultValue: _wooSignalApp.paypalLiveMode);
return liveMode == true return liveMode == true
? "https://www.paypal.com/cgi-bin/webscr" ? "https://www.paypal.com/cgi-bin/webscr"
: "https://www.sandbox.paypal.com/cgi-bin/webscr"; : "https://www.sandbox.paypal.com/cgi-bin/webscr";
@ -115,9 +115,9 @@ class WebViewState extends NyState<PayPalCheckout> {
<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="lc" value="${envVal('PAYPAL_LOCALE', defaultValue: _wooSignalApp.paypalLocale)}">
<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="${envVal('PAYPAL_ACCOUNT_EMAIL', defaultValue: _wooSignalApp.paypalEmail)}">
<input type="hidden" name="return" value="https://woosignal.com/paypal/payment~success"> <input type="hidden" name="return" value="https://woosignal.com/paypal/payment~success">
<input type="hidden" name="cancel_return" value="https://woosignal.com/paypal/payment~failure"> <input type="hidden" name="cancel_return" value="https://woosignal.com/paypal/payment~failure">
<input type="hidden" name="item_name" value="${getPayPalItemName()}"> <input type="hidden" name="item_name" value="${getPayPalItemName()}">

View File

@ -49,7 +49,7 @@ packages:
name: auto_size_text name: auto_size_text
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "3.0.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -168,7 +168,7 @@ packages:
name: dio name: dio
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.1"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -276,7 +276,7 @@ packages:
name: flutter_stripe name: flutter_stripe
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.1"
flutter_styled_toast: flutter_styled_toast:
dependency: "direct main" dependency: "direct main"
description: description:
@ -573,7 +573,7 @@ packages:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.7" version: "2.0.8"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
@ -732,7 +732,7 @@ packages:
name: uuid name: uuid
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.4" version: "3.0.5"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -788,7 +788,7 @@ packages:
name: woosignal name: woosignal
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.2.1"
wp_json_api: wp_json_api:
dependency: "direct main" dependency: "direct main"
description: description:
@ -818,5 +818,5 @@ packages:
source: hosted source: hosted
version: "3.1.0" version: "3.1.0"
sdks: sdks:
dart: ">=2.14.0 <3.0.0" dart: ">=2.14.4 <3.0.0"
flutter: ">=2.5.0" flutter: ">=2.5.0"

View File

@ -1,10 +1,10 @@
# Official WooSignal App Template for WooCommerce # Official WooSignal App Template for WooCommerce
# Label StoreMax # Label StoreMax
# Version: 5.2.1 # Version: 5.3.0
# 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/label-storemax
### Change App Icon ### Change App Icon
# 1 Replace: public/assets/icon/appicon.png (1024px1024px icon size) # 1 Replace: public/assets/icon/appicon.png (1024px1024px icon size)
@ -30,8 +30,8 @@ dependencies:
intl: ^0.17.0 intl: ^0.17.0
page_transition: ^2.0.4 page_transition: ^2.0.4
nylo_framework: ^2.0.4 nylo_framework: ^2.0.4
woosignal: ^2.1.0 woosignal: ^2.2.1
flutter_stripe: ^2.0.0 flutter_stripe: ^2.0.1
wp_json_api: ^3.1.3 wp_json_api: ^3.1.3
cached_network_image: ^3.1.0 cached_network_image: ^3.1.0
package_info: ^2.0.2 package_info: ^2.0.2
@ -48,7 +48,7 @@ dependencies:
math_expressions: ^2.2.0 math_expressions: ^2.2.0
hexcolor: ^2.0.5 hexcolor: ^2.0.5
flutter_spinkit: ^5.1.0 flutter_spinkit: ^5.1.0
auto_size_text: ^2.1.0 auto_size_text: ^3.0.0
html: ^0.15.0 html: ^0.15.0
flutter_staggered_grid_view: ^0.4.1 flutter_staggered_grid_view: ^0.4.1
flutter: flutter: