1 | <?php |
||
10 | class PurchaseRequest extends AbstractRequest |
||
11 | { |
||
12 | /** @var string */ |
||
13 | protected $liveEndpoint = 'https://secureacceptance.cybersource.com/pay'; |
||
14 | /** @var string */ |
||
15 | protected $testEndpoint = 'https://testsecureacceptance.cybersource.com/pay'; |
||
16 | /** @var string Override this if using inherited class for additional transaction types */ |
||
17 | protected $transactionType = 'sale'; |
||
18 | |||
19 | /** |
||
20 | * Get the profile ID for the merchant account |
||
21 | * |
||
22 | * @return string |
||
23 | */ |
||
24 | 6 | public function getProfileId() |
|
28 | |||
29 | /** |
||
30 | * Set the profile ID for the merchant account |
||
31 | * |
||
32 | * @param string $value ASCII Alphanumeric + punctuation string, maximum 36 characters |
||
33 | * |
||
34 | * @return AbstractRequest |
||
35 | */ |
||
36 | 16 | public function setProfileId($value) |
|
40 | |||
41 | /** |
||
42 | * Get the secret key for the merchant account |
||
43 | * |
||
44 | * @return string |
||
45 | */ |
||
46 | 8 | public function getSecretKey() |
|
50 | |||
51 | /** |
||
52 | * Set the secret key for the merchant account |
||
53 | * |
||
54 | * @param string $value Alphanumeric string, maximum 32 characters |
||
55 | * |
||
56 | * @return AbstractRequest |
||
57 | */ |
||
58 | 16 | public function setSecretKey($value) |
|
62 | |||
63 | /** |
||
64 | * Get the access key for the merchant account |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | 6 | public function getAccessKey() |
|
72 | |||
73 | /** |
||
74 | * Set the access key for the merchant account |
||
75 | * |
||
76 | * @param string $value Alphanumeric string, maximum 32 characters |
||
77 | * |
||
78 | * @return AbstractRequest |
||
79 | */ |
||
80 | 16 | public function setAccessKey($value) |
|
84 | |||
85 | /** |
||
86 | * Optional merchant sale reference number, falls back to using the transaction ID if not set |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | 5 | public function getReferenceNumber() |
|
95 | |||
96 | /** |
||
97 | * Set the unique merchant-generated order reference or tracking number for each transaction. |
||
98 | * |
||
99 | * @param string $value Reference to use |
||
100 | */ |
||
101 | 1 | public function setReferenceNumber($value) |
|
105 | |||
106 | /** |
||
107 | * Get the locale set for this request, falls back to using 'en' if not set |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | 5 | public function getLocale() |
|
116 | |||
117 | /** |
||
118 | * Set the locale for this request |
||
119 | * |
||
120 | * @param string $value ISO formatted string indicating language and country e.g. en-nz |
||
121 | */ |
||
122 | 1 | public function setLocale($value) |
|
126 | |||
127 | /** |
||
128 | * Get the transaction type |
||
129 | * |
||
130 | * Can be one of: |
||
131 | * - authorization |
||
132 | * - authorization,create_payment_token |
||
133 | * - authorization,update_payment_token |
||
134 | * - sale |
||
135 | * - sale,create_payment_token |
||
136 | * - sale,update_payment_token |
||
137 | * - create_payment_token |
||
138 | * - update_payment_token |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | 4 | public function getTransactionType() |
|
146 | |||
147 | 4 | public function getData() |
|
258 | |||
259 | 1 | public function sendData($data) |
|
269 | |||
270 | 2 | public function getEndpoint() |
|
274 | } |
||
275 |