|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Magium\Magento\Actions\Admin\Configuration\PaymentMethods; |
|
4
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
class CashOnDelivery extends AbstractPaymentMethod |
|
7
|
|
|
{ |
|
8
|
|
|
const NAME = 'Cash On Delivery Payment'; |
|
9
|
|
|
const ACTION = 'Admin\Configuration\PaymentMethods\CashOnDelivery'; |
|
10
|
|
|
|
|
11
|
|
|
protected $section = 'Payment Methods/' . self::NAME; |
|
12
|
|
|
|
|
13
|
|
|
protected $settings = [ |
|
14
|
|
|
'payment_cashondelivery_active' => 0, |
|
15
|
|
|
'payment_cashondelivery_title' => 'Cash On Delivery', |
|
16
|
|
|
'payment_cashondelivery_order_status' => null, |
|
17
|
|
|
'payment_cashondelivery_allowspecific' => null, |
|
18
|
|
|
'payment_cashondelivery_specificcountry' => null, |
|
19
|
|
|
'payment_cashondelivery_instructions' => null, |
|
20
|
|
|
'payment_cashondelivery_min_order_total' => null, |
|
21
|
|
|
'payment_cashondelivery_max_order_total' => null, |
|
22
|
|
|
'payment_cashondelivery_sort_order' => null |
|
23
|
|
|
]; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @param string $enabled |
|
27
|
|
|
*/ |
|
28
|
|
|
public function setEnabled($enabled) |
|
29
|
|
|
{ |
|
30
|
|
|
$this->settings['payment_cashondelivery_active'] = $enabled; |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param string $title |
|
35
|
|
|
*/ |
|
36
|
|
|
public function setTitle($title) |
|
37
|
|
|
{ |
|
38
|
|
|
$this->settings['payment_cashondelivery_title'] = $title; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @param string $order_status |
|
43
|
|
|
*/ |
|
44
|
|
|
public function setNewOrderStatus($order_status) |
|
45
|
|
|
{ |
|
46
|
|
|
$this->settings['payment_cashondelivery_order_status'] = $order_status; |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* @param string $allowspecific |
|
51
|
|
|
*/ |
|
52
|
|
|
public function setPaymentFromApplicableCountries($allowspecific) |
|
53
|
|
|
{ |
|
54
|
|
|
$this->settings['payment_cashondelivery_allowspecific'] = $allowspecific; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* @param string|array $specificcountry |
|
59
|
|
|
*/ |
|
60
|
|
|
public function setSpecificCountry($specificcountry) |
|
61
|
|
|
{ |
|
62
|
|
|
$this->settings['payment_cashondelivery_specificcountry'] = $specificcountry; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @param string $instructions |
|
67
|
|
|
*/ |
|
68
|
|
|
public function setInstructions($instructions) |
|
69
|
|
|
{ |
|
70
|
|
|
$this->settings['payment_cashondelivery_instructions'] = $instructions; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @param string $min_order_total |
|
75
|
|
|
*/ |
|
76
|
|
|
public function setMinOrderTotal($min_order_total) |
|
77
|
|
|
{ |
|
78
|
|
|
$this->settings['payment_cashondelivery_min_order_total'] = $min_order_total; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @param string $max_order_total |
|
83
|
|
|
*/ |
|
84
|
|
|
public function setMaxOrderTotal($max_order_total) |
|
85
|
|
|
{ |
|
86
|
|
|
$this->settings['payment_cashondelivery_max_order_total'] = $max_order_total; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @param string $sort_order |
|
91
|
|
|
*/ |
|
92
|
|
|
public function setSortOrder($sort_order) |
|
93
|
|
|
{ |
|
94
|
|
|
$this->settings['payment_cashondelivery_sort_order'] = $sort_order; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
|
|
98
|
|
|
} |