1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Acquirer status request message. |
4
|
|
|
* |
5
|
|
|
* @author Pronamic <[email protected]> |
6
|
|
|
* @copyright 2005-2021 Pronamic |
7
|
|
|
* @license GPL-3.0-or-later |
8
|
|
|
* @package Pronamic\WordPress\Pay |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\XML; |
12
|
|
|
|
13
|
|
|
use DOMDocument; |
14
|
|
|
use Pronamic\WordPress\Pay\Gateways\IDealAdvancedV3\Transaction; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Title: iDEAL status request XML message |
18
|
|
|
* Description: |
19
|
|
|
* Copyright: 2005-2021 Pronamic |
20
|
|
|
* Company: Pronamic |
21
|
|
|
* |
22
|
|
|
* @author Remco Tolsma |
23
|
|
|
* @version 2.0.0 |
24
|
|
|
*/ |
25
|
|
|
class AcquirerStatusReqMessage extends RequestMessage { |
26
|
|
|
/** |
27
|
|
|
* The document element name |
28
|
|
|
* |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
const NAME = 'AcquirerStatusReq'; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Transaction |
35
|
|
|
* |
36
|
|
|
* @var Transaction |
37
|
|
|
*/ |
38
|
|
|
public $transaction; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Constructs and initialize an status request message |
42
|
|
|
*/ |
43
|
|
|
public function __construct() { |
44
|
|
|
parent::__construct( self::NAME ); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Get document |
49
|
|
|
* |
50
|
|
|
* @return DOMDocument |
51
|
|
|
*/ |
52
|
|
|
public function get_document() { |
53
|
|
|
$document = parent::get_document(); |
54
|
|
|
|
55
|
|
|
$document_element = $document->documentElement; |
56
|
|
|
|
57
|
|
|
if ( null !== $document_element ) { |
58
|
|
|
// Merchant. |
59
|
|
|
$merchant = $this->get_merchant(); |
60
|
|
|
|
61
|
|
|
$element = self::add_element( $document, $document_element, 'Merchant' ); |
62
|
|
|
|
63
|
|
|
self::add_elements( |
64
|
|
|
$document, |
65
|
|
|
$element, |
66
|
|
|
array( |
67
|
|
|
'merchantID' => $merchant->get_id(), |
68
|
|
|
'subID' => $merchant->get_sub_id(), |
69
|
|
|
) |
70
|
|
|
); |
71
|
|
|
|
72
|
|
|
// Transaction. |
73
|
|
|
$transaction = $this->transaction; |
74
|
|
|
|
75
|
|
|
$element = self::add_element( $document, $document_element, 'Transaction' ); |
76
|
|
|
|
77
|
|
|
self::add_element( $document, $element, 'transactionID', $transaction->get_id() ); |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
return $document; |
81
|
|
|
} |
82
|
|
|
} |
83
|
|
|
|