Skip to content

Instantly share code, notes, and snippets.

@meDavid meDavid/CreateCardGuardListener.php Secret
Last active Mar 28, 2017

What would you like to do?
Create Card Guard listener
class CreateCardGuardListener implements EventSubscriberInterface
public function guardCreateCard(GuardEvent $event) {
/** @var CardApplication $cardApplication */
$cardApplication = $event->getSubject();
// By default block this transition.
// Only allow this transition if the requested limit is less then $100 or we have an approved credit limit.
if ($cardApplication->getRequestedCreditLimit() < 200 || $cardApplication->getRequestedCreditLimit() <= $cardApplication->getAppprovedCreditLimit()) {
* Returns the events to which this class has subscribed.
* @return array
public static function getSubscribedEvents() {
return [
'workflow.creditcard_application_flow.guard.create_card' => array('guardCreateCard'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.