Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PS_CHECKOUT_STATE_WAITING_PAYMENT PS8 #1078

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Order/State/OrderStateConfigurationKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ class OrderStateConfigurationKeys
const WAITING_CREDIT_CARD_PAYMENT = 'PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT';
const WAITING_LOCAL_PAYMENT = 'PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT';
const WAITING_PAYPAL_PAYMENT = 'PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT';
const WAITING_PAYMENT = 'PS_CHECKOUT_STATE_WAITING_PAYMENT';
}
4 changes: 1 addition & 3 deletions src/OrderStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ class OrderStates
const BLUE_HEXA_COLOR = '#3498D8';
const GREEN_HEXA_COLOR = '#01B887';
const ORDER_STATES = [
'PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT' => self::DARK_BLUE_HEXA_COLOR,
'PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT' => self::DARK_BLUE_HEXA_COLOR,
'PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT' => self::DARK_BLUE_HEXA_COLOR,
'PS_CHECKOUT_STATE_WAITING_PAYMENT' => self::DARK_BLUE_HEXA_COLOR,
'PS_CHECKOUT_STATE_AUTHORIZED' => self::BLUE_HEXA_COLOR,
'PS_CHECKOUT_STATE_PARTIAL_REFUND' => self::GREEN_HEXA_COLOR,
'PS_CHECKOUT_STATE_WAITING_CAPTURE' => self::BLUE_HEXA_COLOR,
Expand Down
46 changes: 11 additions & 35 deletions src/Translations/OrderStatesTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,15 @@
class OrderStatesTranslations
{
const STANDARD_ISO_CODE = 'en';
const PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT = [
'en' => 'Waiting for PayPal payment',
'fr' => 'En attente de paiement par PayPal',
'es' => 'Esperando el pago con PayPal',
'it' => 'In attesa di pagamento con PayPal',
'nl' => 'Wachten op PayPal-betaling',
'de' => 'Warten auf PayPal-Zahlung',
'pl' => 'Oczekiwanie na płatność PayPal',
'pt' => 'Aguardando pagamento pelo PayPal',
];
const PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT = [
'en' => 'Waiting for Credit Card Payment',
'fr' => 'En attente de paiement par Carte de Crédit',
'es' => 'Esperando el pago con tarjeta de crédito',
'it' => 'In attesa di pagamento con carta di credito',
'nl' => 'Wachten op creditcard-betaling',
'de' => 'Warten auf Kreditkartenzahlung',
'pl' => 'Oczekiwanie na płatność kartą kredytową',
'pt' => 'Aguardando pagamento por cartão de crédito',
];
const PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT = [
'en' => 'Waiting for Local Payment Method Payment',
'fr' => 'En attente de paiement par moyen de paiement local',
'es' => 'Esperando el pago con un método de pago local',
'it' => 'In attesa di pagamento con metodo di pagamento locale',
'nl' => 'Wachten op nlaatselijke betaling',
'de' => 'Warten auf Zahlung per lokaler Zahlungsmethode',
'pl' => 'Oczekiwanie na płatność lokalnym środkiem płatności',
'pt' => 'Aguardando pagamento pelo método de pagamento local',
const PS_CHECKOUT_STATE_WAITING_PAYMENT = [
'en' => 'Waiting for payment',
'fr' => 'En attente de paiement',
'es' => 'Esperando el pago',
'it' => 'In attesa di pagamento',
'nl' => 'Wachten op betaling',
'de' => 'Warten auf Zahlung',
'pl' => 'Oczekiwanie na płatność',
'pt' => 'Aguardando pagamento',
];
const PS_CHECKOUT_STATE_AUTHORIZED = [
'en' => 'Authorized. To be captured by merchant',
Expand Down Expand Up @@ -94,9 +74,7 @@ public function getTranslations($isoCode)
$isoCode = $this->confirmIsoCode($isoCode);

return [
'PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT' => self::PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT[$isoCode],
'PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT' => self::PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT[$isoCode],
'PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT' => self::PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT[$isoCode],
'PS_CHECKOUT_STATE_WAITING_PAYMENT' => self::PS_CHECKOUT_STATE_WAITING_PAYMENT[$isoCode],
'PS_CHECKOUT_STATE_AUTHORIZED' => self::PS_CHECKOUT_STATE_AUTHORIZED[$isoCode],
'PS_CHECKOUT_STATE_PARTIAL_REFUND' => self::PS_CHECKOUT_STATE_PARTIAL_REFUND[$isoCode],
'PS_CHECKOUT_STATE_WAITING_CAPTURE' => self::PS_CHECKOUT_STATE_WAITING_CAPTURE[$isoCode],
Expand All @@ -112,9 +90,7 @@ public function getTranslations($isoCode)
*/
private function confirmIsoCode($isoCode)
{
if (!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_WAITING_PAYPAL_PAYMENT) ||
!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_WAITING_CREDIT_CARD_PAYMENT) ||
!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_WAITING_LOCAL_PAYMENT) ||
if (!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_WAITING_PAYMENT) ||
!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_AUTHORIZED) ||
!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_PARTIAL_REFUND) ||
!array_key_exists($isoCode, self::PS_CHECKOUT_STATE_WAITING_CAPTURE)) {
Expand Down