|
2 | 2 |
|
3 | 3 | namespace Omnipay\AuthorizeNet\Message; |
4 | 4 |
|
5 | | -use Omnipay\Common\Message\AbstractResponse; |
6 | | -use Omnipay\Common\Message\RedirectResponseInterface; |
7 | | - |
8 | 5 | /** |
9 | | - * Authorize.Net DPM Complete Authorize Response |
10 | | - * This is the result of handling the callback. |
11 | | - * The result will always be a HTML redirect snippet. This gets |
12 | | - * returned to the gateway, displayed in the user's browser, and a |
13 | | - * redirect is performed using JavaScript and meta refresh (for backup). |
14 | | - * We may want to return to the success page, the failed page or the retry |
15 | | - * page (so the user can correct the form to try again). |
| 6 | + * SIM and DPM both have identical needs when handling the notify request. |
16 | 7 | */ |
17 | | -class DPMCompleteResponse extends SIMCompleteAuthorizeResponse implements RedirectResponseInterface |
| 8 | +class DPMCompleteResponse extends SIMCompleteAuthorizeResponse |
18 | 9 | { |
19 | | - public function isSuccessful() |
20 | | - { |
21 | | - return isset($this->data['x_response_code']) |
22 | | - && static::RESPONSE_CODE_APPROVED === $this->data['x_response_code']; |
23 | | - } |
24 | | - |
25 | | - /** |
26 | | - * If there is an error in the form, then the user should be able to go back |
27 | | - * to the form and give it another shot. |
28 | | - */ |
29 | | - public function isError() |
30 | | - { |
31 | | - return isset($this->data['x_response_code']) |
32 | | - && static::RESPONSE_CODE_ERROR === $this->data['x_response_code']; |
33 | | - } |
34 | | - |
35 | | - /** |
36 | | - * We are in the callback, and we MUST return a HTML fragment to do a redirect. |
37 | | - * All headers we may return are discarded by the gateway, so we cannot use |
38 | | - * the "Location:" header. |
39 | | - */ |
40 | | - public function isRedirect() |
41 | | - { |
42 | | - return true; |
43 | | - } |
44 | | - |
45 | | - /** |
46 | | - * We set POST because the default redirect mechanism in Omnipay Common only |
47 | | - * generates a HTML snippet for POST and not for the GET method. |
48 | | - * The redirect method is actually "HTML", where a HTML page is supplied |
49 | | - * to do a redirect using any method it likes. |
50 | | - */ |
51 | | - public function getRedirectMethod() |
52 | | - { |
53 | | - return 'POST'; |
54 | | - } |
55 | | - |
56 | | - /** |
57 | | - * We probably do not require any redirect data, if the incomplete transaction |
58 | | - * is still in the user's session and we can inspect the results from the saved |
59 | | - * transaction in the database. We cannot send the result through the redirect |
60 | | - * unless it is hashed so the authorisation result cannot be faked. |
61 | | - */ |
62 | | - public function getRedirectData() |
63 | | - { |
64 | | - return array(); |
65 | | - } |
66 | | - |
67 | | - /** |
68 | | - * The cancel URL is never handled here - that is a direct link from the gateway. |
69 | | - */ |
70 | | - public function getRedirectUrl() |
71 | | - { |
72 | | - // Leave it for the applicatino to decide where to sent the user. |
73 | | - return; |
74 | | - } |
75 | 10 | } |
0 commit comments