Skip to content

Commit d08d1b0

Browse files
committed
v5.0.2 - updates
1 parent 40f3ebb commit d08d1b0

19 files changed

+75
-66
lines changed

LabelStoreMax/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ PAYPAL_ACCOUNT_EMAIL="[email protected]"
3434
# Your PayPal account email e.g. [email protected]
3535
PAYPAL_LIVE_MODE="false"
3636
# Change to 'true' for live payments
37+
PAYPAL_LOCALE="en-GB"
38+
# Use BCP-47 code from this link https://developer.paypal.com/docs/api/reference/locale-codes/
3739

3840
# *<! ------ EXTRAS ------!>*
3941

LabelStoreMax/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [5.0.2] - 2020-04-17
2+
3+
* Fix issue with PayPal checkout when using different locales
4+
* Fix nested `trans` methods
5+
* PAYPAL_LOCALE added to .env file
6+
17
## [5.0.1] - 2020-04-13
28

39
* Update to app_payment_gateways

LabelStoreMax/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# WooCommerce App: Label StoreMax
66

7-
### Label StoreMax - v5.0.1
7+
### Label StoreMax - v5.0.2
88

99

1010
[Official WooSignal WooCommerce App](https://woosignal.com)

LabelStoreMax/lang/es.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@
179179
"Dark Mode": "Modo oscuro",
180180
"PayPal Checkout": "Pago con PayPal",
181181
"Processing Payment": "Procesando el pago",
182-
"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.",
183-
"If you are not automatically redirected to PayPal within 5 seconds": "Si no se le redirige automáticamente a PayPal en 5 segundos",
182+
"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.",
183+
"If you are not automatically redirected to PayPal within 5 seconds": "Si no se le redirige automaticamente a PayPal en 5 segundos",
184184
"Payment Cancelled": "Pago cancelado",
185185
"The payment has been cancelled": "El pago ha sido cancelado",
186186
"Must have": "Debe tener",

LabelStoreMax/lang/fr.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@
179179
"Dark Mode": "Mode sombre",
180180
"PayPal Checkout": "Paiement PayPal",
181181
"Processing Payment": "Traitement du paiement",
182-
"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.",
183-
"If you are not automatically redirected to PayPal within 5 seconds": "Si vous n'êtes pas automatiquement redirigé vers PayPal dans les 5 secondes",
182+
"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.",
183+
"If you are not automatically redirected to PayPal within 5 seconds": "Si vous n'etes pas automatiquement redirige vers PayPal dans les 5 secondes",
184184
"Payment Cancelled": "Paiement annulé",
185185
"The payment has been cancelled": "Le paiement a été annulé",
186186
"Must have": "Doit avoir",

LabelStoreMax/lang/it.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
"Dark Mode": "Modalità scura",
180180
"PayPal Checkout": "Pagamento PayPal",
181181
"Processing Payment": "Pagamento in elaborazione",
182-
"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.",
182+
"Please wait, your order is being processed and you will be redirected to the PayPal website.": "Attendi, verrai reindirizzato al sito web di PayPal.",
183183
"If you are not automatically redirected to PayPal within 5 seconds": "Se non vieni reindirizzato automaticamente a PayPal entro 5 secondi",
184184
"Payment Cancelled": "Pagamento annullato",
185185
"The payment has been cancelled": "Il pagamento è stato annullato",

LabelStoreMax/lang/pt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@
179179
"Dark Mode": "Modo escuro",
180180
"PayPal Checkout": "PayPal Checkout",
181181
"Processing Payment": "Processando o pagamento",
182-
"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.",
183-
"If you are not automatically redirected to PayPal within 5 seconds": "Se você não for redirecionado automaticamente para o PayPal em 5 segundos",
182+
"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.",
183+
"If you are not automatically redirected to PayPal within 5 seconds": "Se voce nao for redirecionado automaticamente para o PayPal em 5 segundos",
184184
"Payment Cancelled": "Pagamento Cancelado",
185185
"The payment has been cancelled": "O pagamento foi cancelado",
186186
"Must have": "Deve ter",

LabelStoreMax/lib/app/providers/cash_on_delivery.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,15 @@ cashOnDeliveryPay(context,
3333
showToastNotification(
3434
context,
3535
title: trans(context, "Error"),
36-
description: trans(context,
37-
trans(context, "Something went wrong, please contact our store")),
36+
description: trans(context, "Something went wrong, please contact our store"),
3837
);
3938
state.reloadState(showLoader: false);
4039
}
4140
} catch (_) {
4241
showToastNotification(
4342
context,
4443
title: trans(context, "Error"),
45-
description: trans(context,
46-
trans(context, "Something went wrong, please contact our store")),
44+
description: trans(context, "Something went wrong, please contact our store"),
4745
);
4846
state.reloadState(showLoader: false);
4947
}

LabelStoreMax/lib/app/providers/example_pay.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ examplePay(context,
5353
showToastNotification(
5454
context,
5555
title: trans(context, "Error"),
56-
description: trans(context,
57-
trans(context, "Something went wrong, please contact our store")),
56+
description: trans(context, "Something went wrong, please contact our store"),
5857
);
5958
state.reloadState(showLoader: false);
6059
}

LabelStoreMax/lib/app/providers/paypal_pay.dart

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,51 +28,51 @@ payPalPay(context,
2828
await checkout(taxRate, (total, billingDetails, cart) async {
2929
List<CartLineItem> cartLineItems = await cart.getCart();
3030
String description = await cart.cartShortDesc();
31-
state.reloadState(showLoader: true);
31+
3232
await Navigator.push(
3333
context,
3434
MaterialPageRoute(
3535
builder: (_) => PayPalCheckout(
3636
description: description,
3737
amount: total,
3838
cartLineItems: cartLineItems))).then((value) async {
39-
if (value is Map<String, dynamic>) {
39+
if (!(value is Map<String, dynamic>)) {
40+
showToastNotification(
41+
context,
42+
title: trans(context, "Payment Cancelled"),
43+
description:
44+
trans(context, "The payment has been cancelled"),
45+
);
46+
state.reloadState(showLoader: false);
47+
return;
48+
}
49+
50+
state.reloadState(showLoader: true);
4051
if (value.containsKey("status") && value["status"] == "success") {
4152
OrderWC orderWC =
4253
await buildOrderWC(taxRate: taxRate, markPaid: true);
4354
Order order = await appWooSignal((api) => api.createOrder(orderWC));
4455

45-
if (order != null) {
46-
Navigator.pushNamed(context, "/checkout-status", arguments: order);
47-
} else {
56+
if (order == null) {
4857
showToastNotification(
4958
context,
5059
title: trans(context, "Error"),
51-
description: trans(
52-
context,
53-
trans(context,
54-
"Something went wrong, please contact our store")),
60+
description: trans(context,
61+
"Something went wrong, please contact our store"),
5562
);
56-
state.reloadState(showLoader: false);
63+
return;
5764
}
65+
Navigator.pushNamed(context, "/checkout-status", arguments: order);
66+
return;
5867
} else {
5968
showToastNotification(
6069
context,
6170
title: trans(context, "Payment Cancelled"),
62-
description: trans(
63-
context, trans(context, "The payment has been cancelled")),
71+
description: trans(context, "The payment has been cancelled"),
6472
);
65-
state.reloadState(showLoader: false);
6673
}
67-
} else {
68-
showToastNotification(
69-
context,
70-
title: trans(context, "Payment Cancelled"),
71-
description:
72-
trans(context, trans(context, "The payment has been cancelled")),
73-
);
74-
state.reloadState(showLoader: false);
7574
}
76-
});
75+
);
76+
state.reloadState(showLoader: false);
7777
});
7878
}

0 commit comments

Comments
 (0)