Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
36 | public function onBeforeWrite() |
||
37 | { |
||
38 | parent::onBeforeWrite(); |
||
39 | if ($this->owner->SkipPayment) { |
||
40 | $money = Money::create(); |
||
41 | $money->setAmount($this->owner->TotalOutstanding()); |
||
42 | $payment = EcommercePayment::create(); |
||
43 | $payment->Status = 'Success'; |
||
44 | $payment->Amount = $money; |
||
45 | $payment->Message = 'This is a fake payment that has been created to allow the order to proceed to the next step, this order has not really been paid for.'; |
||
46 | $payment->write(); |
||
47 | $this->owner->Payments()->add($payment); |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.