Skip to content

Commit

Permalink
add PS_CHECKOUT_STATE_WAITING_PAYMENT
Browse files Browse the repository at this point in the history
  • Loading branch information
sgodard authored and Matt75 committed Jul 13, 2023
1 parent e8c250d commit 4148785
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 38 deletions.
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

0 comments on commit 4148785

Please sign in to comment.