Skip to content
Code-Schnipsel Gruppen Projekte
Commit 7c8b0420 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

refactor: browser type checking for browser payment types

Übergeordneter a6331f0c
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
werden angezeigt mit 43 Ergänzungen und 23 Löschungen
...@@ -54,7 +54,11 @@ public static function onPaymentsCanUsedInOrder(Payment $Payment, OrderInterface ...@@ -54,7 +54,11 @@ public static function onPaymentsCanUsedInOrder(Payment $Payment, OrderInterface
$B = new \Browser(); $B = new \Browser();
if (!$B->isMobile() || $PaymentType->getBrowserType() !== $B->getBrowser()) { if (!$B->isMobile()) {
throw new PaymentCanNotBeUsedException();
}
if (!\in_array($B->getBrowser(), $PaymentType->getBrowserTypes())) {
throw new PaymentCanNotBeUsedException(); throw new PaymentCanNotBeUsedException();
} }
} }
......
...@@ -34,9 +34,9 @@ public function getIcon() ...@@ -34,9 +34,9 @@ public function getIcon()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
abstract public function getBrowserType(); abstract public function getBrowserTypes();
/** /**
* Get type string of Stripe PaymentMethod * Get type string of Stripe PaymentMethod
......
...@@ -73,11 +73,15 @@ public function getPaymentStepInfo() ...@@ -73,11 +73,15 @@ public function getPaymentStepInfo()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
public function getBrowserType() public function getBrowserTypes()
{ {
return \Browser::BROWSER_SAFARI; return [
\Browser::BROWSER_IPHONE,
\Browser::BROWSER_IPAD,
\Browser::BROWSER_SAFARI
];
} }
/** /**
......
...@@ -73,11 +73,13 @@ public function getPaymentStepInfo() ...@@ -73,11 +73,13 @@ public function getPaymentStepInfo()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
public function getBrowserType() public function getBrowserTypes()
{ {
return \Browser::BROWSER_CHROME; return [
\Browser::BROWSER_CHROME
];
} }
/** /**
......
...@@ -73,11 +73,13 @@ public function getPaymentStepInfo() ...@@ -73,11 +73,13 @@ public function getPaymentStepInfo()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
public function getBrowserType() public function getBrowserTypes()
{ {
return \Browser::BROWSER_EDGE; return [
\Browser::BROWSER_EDGE
];
} }
/** /**
......
...@@ -14,9 +14,9 @@ abstract class AbstractRecurringBrowserPay extends AbstractBaseRecurringPayment ...@@ -14,9 +14,9 @@ abstract class AbstractRecurringBrowserPay extends AbstractBaseRecurringPayment
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
abstract public function getBrowserType(); abstract public function getBrowserTypes();
/** /**
* Get type string of Stripe PaymentMethod * Get type string of Stripe PaymentMethod
......
...@@ -73,11 +73,15 @@ public function getPaymentStepInfo() ...@@ -73,11 +73,15 @@ public function getPaymentStepInfo()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
public function getBrowserType() public function getBrowserTypes()
{ {
return \Browser::BROWSER_SAFARI; return [
\Browser::BROWSER_IPHONE,
\Browser::BROWSER_IPAD,
\Browser::BROWSER_SAFARI
];
} }
/** /**
......
...@@ -73,11 +73,13 @@ public function getPaymentStepInfo() ...@@ -73,11 +73,13 @@ public function getPaymentStepInfo()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
public function getBrowserType() public function getBrowserTypes()
{ {
return \Browser::BROWSER_CHROME; return [
\Browser::BROWSER_CHROME
];
} }
/** /**
......
...@@ -73,11 +73,13 @@ public function getPaymentStepInfo() ...@@ -73,11 +73,13 @@ public function getPaymentStepInfo()
/** /**
* Get type of Browser this BrowserPay works with * Get type of Browser this BrowserPay works with
* *
* @return string * @return string[]
*/ */
public function getBrowserType() public function getBrowserTypes()
{ {
return \Browser::BROWSER_EDGE; return [
\Browser::BROWSER_EDGE
];
} }
/** /**
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren