Completed
Push — master ( 110887...ff6c7f )
by Aimeos
10:07
created

PrePay::repay()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2012
6
 * @copyright Aimeos (aimeos.org), 2015-2017
7
 * @package MShop
8
 * @subpackage Service
9
 */
10
11
12
namespace Aimeos\MShop\Service\Provider\Payment;
13
14
15
/**
16
 * Payment provider for pre-paid orders.
17
 *
18
 * @package MShop
19
 * @subpackage Service
20
 */
21
class PrePay
22
	extends \Aimeos\MShop\Service\Provider\Payment\Base
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces between "Base" and comma; 1 found
Loading history...
23
	implements \Aimeos\MShop\Service\Provider\Payment\Iface
24
{
25
	/**
26
	 * Cancels the authorization for the given order if supported.
27
	 *
28
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice object
29
	 */
30
	public function cancel( \Aimeos\MShop\Order\Item\Iface $order )
31
	{
32
		$order->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_CANCELED );
33
		$this->saveOrder( $order );
34
35
		return $order;
36
	}
37
38
39
	/**
40
	 * Executes the payment again for the given order if supported.
41
	 * This requires support of the payment gateway and token based payment
42
	 *
43
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order invoice object
44
	 * @return void
45
	 */
46
	public function repay( \Aimeos\MShop\Order\Item\Iface $order )
47
	{
48
	}
49
50
51
	/**
52
	 * Updates the orders for whose status updates have been received by the confirmation page
53
	 *
54
	 * @param \Psr\Http\Message\ServerRequestInterface $request Request object with parameters and request body
55
	 * @param \Aimeos\MShop\Order\Item\Iface $order Order item that should be updated
56
	 * @return \Aimeos\MShop\Order\Item\Iface Updated order item
57
	 * @throws \Aimeos\MShop\Service\Exception If updating the orders failed
58
	 */
59
	public function updateSync( \Psr\Http\Message\ServerRequestInterface $request, \Aimeos\MShop\Order\Item\Iface $order )
60
	{
61
		$order->setPaymentStatus( \Aimeos\MShop\Order\Item\Base::PAY_PENDING );
62
		$this->saveOrder( $order );
63
64
		return $order;
65
	}
66
67
68
	/**
69
	 * Checks what features the payment provider implements.
70
	 *
71
	 * @param integer $what Constant from abstract class
72
	 * @return boolean True if feature is available in the payment provider, false if not
73
	 */
74
	public function isImplemented( $what )
75
	{
76
		return $what === \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_CANCEL;
77
	}
78
}