/**
  * Returns an array of payment methods configured in the event
  *
  * @param Event $event
  * @return array
  */
 public function getRestrictedPaymentMethods($event)
 {
     $restrictedPaymentMethods = [];
     $allPaymentMethods = $this->getPaymentMethods();
     $selectedPaymentMethods = explode(',', $event->getSelectedPaymentMethods());
     foreach ($selectedPaymentMethods as $selectedPaymentMethod) {
         if (isset($allPaymentMethods[$selectedPaymentMethod])) {
             $restrictedPaymentMethods[$selectedPaymentMethod] = $allPaymentMethods[$selectedPaymentMethod];
         }
     }
     return $restrictedPaymentMethods;
 }
Beispiel #2
0
 /**
  * @test
  * @return void
  */
 public function setSelectedPaymentMethodsSetsSelectedPaymentMethodforString()
 {
     $this->subject->setSelectedPaymentMethods('invoice,transfer');
     $this->assertEquals('invoice,transfer', $this->subject->getSelectedPaymentMethods());
 }