AbstractPaymentListener   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 44
ccs 0
cts 9
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
onPaymentCreated() 0 1 ?
onPaymentChargeback() 0 1 ?
onPaymentFailed() 0 1 ?
onPaymentRefundedEvent() 0 1 ?
A getSubscribedEvents() 0 9 1
1
<?php
2
3
namespace Speicher210\FastbillBundle\EventListener;
4
5
use Speicher210\FastbillBundle\Event\PaymentChargebackEvent;
6
use Speicher210\FastbillBundle\Event\PaymentCreatedEvent;
7
use Speicher210\FastbillBundle\Event\PaymentFailedEvent;
8
use Speicher210\FastbillBundle\Event\PaymentRefundedEvent;
9
use Speicher210\FastbillBundle\FastbillNotificationEvents;
10
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
11
12
/**
13
 * Event listener for incoming Fastbill payment notifications.
14
 */
15
abstract class AbstractPaymentListener implements EventSubscriberInterface
16
{
17
18
    /**
19
     * Handle creating a payment.
20
     *
21
     * @param PaymentCreatedEvent $event The raised event.
22
     */
23
    abstract public function onPaymentCreated(PaymentCreatedEvent $event);
24
25
    /**
26
     * Handle payment chargeback.
27
     *
28
     * @param PaymentChargebackEvent $event The raised event.
29
     */
30
    abstract public function onPaymentChargeback(PaymentChargebackEvent $event);
31
32
    /**
33
     * Handle failed payment.
34
     *
35
     * @param PaymentFailedEvent $event The raised event.
36
     */
37
    abstract public function onPaymentFailed(PaymentFailedEvent $event);
38
39
    /**
40
     * Handle refunded payment.
41
     *
42
     * @param PaymentRefundedEvent $event The raised event.
43
     */
44
    abstract public function onPaymentRefundedEvent(PaymentRefundedEvent $event);
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public static function getSubscribedEvents()
50
    {
51
        return array(
52
            FastbillNotificationEvents::INCOMING_PAYMENT_CREATED => 'onPaymentCreated',
53
            FastbillNotificationEvents::INCOMING_PAYMENT_CHARGEBACK => 'onPaymentChargeback',
54
            FastbillNotificationEvents::INCOMING_PAYMENT_FAILED => 'onPaymentFailed',
55
            FastbillNotificationEvents::INCOMING_PAYMENT_REFUNDED => 'onPaymentRefundedEvent'
56
        );
57
    }
58
}
59