@@ -30,16 +30,16 @@ |
||
30 | 30 | * |
31 | 31 | * @return GatewaysResponseMessage |
32 | 32 | */ |
33 | - public static function parse( SimpleXMLElement $xml ) { |
|
33 | + public static function parse(SimpleXMLElement $xml) { |
|
34 | 34 | $message = new GatewaysResponseMessage(); |
35 | 35 | |
36 | 36 | $message->gateways = array(); |
37 | 37 | |
38 | - foreach ( $xml->gateways->gateway as $gateway ) { |
|
39 | - $id = Security::filter( $gateway->id ); |
|
40 | - $description = Security::filter( $gateway->description ); |
|
38 | + foreach ($xml->gateways->gateway as $gateway) { |
|
39 | + $id = Security::filter($gateway->id); |
|
40 | + $description = Security::filter($gateway->description); |
|
41 | 41 | |
42 | - $message->gateways[ $id ] = $description; |
|
42 | + $message->gateways[$id] = $description; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return $message; |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | * @param Merchant $merchant |
31 | 31 | * @param Customer $customer |
32 | 32 | */ |
33 | - public function __construct( Merchant $merchant, Customer $customer ) { |
|
34 | - parent::__construct( self::NAME ); |
|
33 | + public function __construct(Merchant $merchant, Customer $customer) { |
|
34 | + parent::__construct(self::NAME); |
|
35 | 35 | |
36 | 36 | $this->merchant = $merchant; |
37 | 37 | $this->customer = $customer; |
@@ -46,21 +46,21 @@ discard block |
||
46 | 46 | $document = parent::get_document(); |
47 | 47 | |
48 | 48 | // Merchant |
49 | - $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' ); |
|
49 | + $merchant = XML_Util::add_element($document, $document->documentElement, 'merchant'); |
|
50 | 50 | |
51 | - XML_Util::add_elements( $document, $merchant, array( |
|
51 | + XML_Util::add_elements($document, $merchant, array( |
|
52 | 52 | 'account' => $this->merchant->account, |
53 | 53 | 'site_id' => $this->merchant->site_id, |
54 | 54 | 'site_secure_code' => $this->merchant->site_secure_code, |
55 | - ) ); |
|
55 | + )); |
|
56 | 56 | |
57 | 57 | // Customer |
58 | - $customer = XML_Util::add_element( $document, $document->documentElement, 'customer' ); |
|
58 | + $customer = XML_Util::add_element($document, $document->documentElement, 'customer'); |
|
59 | 59 | |
60 | - XML_Util::add_elements( $document, $customer, array( |
|
60 | + XML_Util::add_elements($document, $customer, array( |
|
61 | 61 | 'country' => $this->customer->country, |
62 | 62 | 'locale' => $this->customer->locale, |
63 | - ) ); |
|
63 | + )); |
|
64 | 64 | |
65 | 65 | return $document; |
66 | 66 | } |
@@ -23,16 +23,16 @@ |
||
23 | 23 | * |
24 | 24 | * @return IDealIssuersResponseMessage |
25 | 25 | */ |
26 | - public static function parse( SimpleXMLElement $xml ) { |
|
26 | + public static function parse(SimpleXMLElement $xml) { |
|
27 | 27 | $message = new IDealIssuersResponseMessage(); |
28 | 28 | |
29 | 29 | $message->issuers = array(); |
30 | 30 | |
31 | - foreach ( $xml->issuers->issuer as $issuer ) { |
|
32 | - $code = Security::filter( $issuer->code ); |
|
33 | - $description = Security::filter( $issuer->description ); |
|
31 | + foreach ($xml->issuers->issuer as $issuer) { |
|
32 | + $code = Security::filter($issuer->code); |
|
33 | + $description = Security::filter($issuer->description); |
|
34 | 34 | |
35 | - $message->issuers[ $code ] = $description; |
|
35 | + $message->issuers[$code] = $description; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return $message; |
@@ -24,11 +24,11 @@ |
||
24 | 24 | * |
25 | 25 | * @return Transaction |
26 | 26 | */ |
27 | - public static function parse( SimpleXMLElement $xml ) { |
|
27 | + public static function parse(SimpleXMLElement $xml) { |
|
28 | 28 | $transaction = new Transaction(); |
29 | 29 | |
30 | - $transaction->id = Security::filter( $xml->id ); |
|
31 | - $transaction->payment_url = Security::filter( $xml->payment_url ); |
|
30 | + $transaction->id = Security::filter($xml->id); |
|
31 | + $transaction->payment_url = Security::filter($xml->payment_url); |
|
32 | 32 | |
33 | 33 | return $transaction; |
34 | 34 | } |
@@ -59,68 +59,68 @@ |
||
59 | 59 | * |
60 | 60 | * @return StatusResponseMessage |
61 | 61 | */ |
62 | - public static function parse( SimpleXMLElement $xml ) { |
|
62 | + public static function parse(SimpleXMLElement $xml) { |
|
63 | 63 | $message = new StatusResponseMessage(); |
64 | 64 | |
65 | - $message->result = Security::filter( $xml['result'] ); |
|
65 | + $message->result = Security::filter($xml['result']); |
|
66 | 66 | |
67 | 67 | // E-wallet |
68 | - if ( $xml->ewallet ) { |
|
68 | + if ($xml->ewallet) { |
|
69 | 69 | $ewallet = new stdClass(); |
70 | 70 | |
71 | - $ewallet->id = Security::filter( $xml->ewallet->id ); |
|
72 | - $ewallet->status = Security::filter( $xml->ewallet->status ); |
|
73 | - $ewallet->created = Security::filter( $xml->ewallet->created ); |
|
74 | - $ewallet->modified = Security::filter( $xml->ewallet->modified ); |
|
75 | - $ewallet->reason_code = Security::filter( $xml->ewallet->reasoncode ); |
|
76 | - $ewallet->reason = Security::filter( $xml->ewallet->reason ); |
|
71 | + $ewallet->id = Security::filter($xml->ewallet->id); |
|
72 | + $ewallet->status = Security::filter($xml->ewallet->status); |
|
73 | + $ewallet->created = Security::filter($xml->ewallet->created); |
|
74 | + $ewallet->modified = Security::filter($xml->ewallet->modified); |
|
75 | + $ewallet->reason_code = Security::filter($xml->ewallet->reasoncode); |
|
76 | + $ewallet->reason = Security::filter($xml->ewallet->reason); |
|
77 | 77 | |
78 | 78 | $message->ewallet = $ewallet; |
79 | 79 | } |
80 | 80 | |
81 | 81 | // Customer |
82 | - if ( $xml->customer ) { |
|
82 | + if ($xml->customer) { |
|
83 | 83 | $customer = new stdClass(); |
84 | 84 | |
85 | - $customer->currency = Security::filter( $xml->customer->currency ); |
|
86 | - $customer->amount = Security::filter( $xml->customer->amount ); |
|
87 | - $customer->exchange_rate = Security::filter( $xml->customer->exchange_rate ); |
|
88 | - $customer->first_name = Security::filter( $xml->customer->firstname ); |
|
89 | - $customer->last_name = Security::filter( $xml->customer->lastname ); |
|
90 | - $customer->last_name = Security::filter( $xml->customer->lastname ); |
|
91 | - $customer->city = Security::filter( $xml->customer->city ); |
|
92 | - $customer->state = Security::filter( $xml->customer->state ); |
|
93 | - $customer->country = Security::filter( $xml->customer->country ); |
|
85 | + $customer->currency = Security::filter($xml->customer->currency); |
|
86 | + $customer->amount = Security::filter($xml->customer->amount); |
|
87 | + $customer->exchange_rate = Security::filter($xml->customer->exchange_rate); |
|
88 | + $customer->first_name = Security::filter($xml->customer->firstname); |
|
89 | + $customer->last_name = Security::filter($xml->customer->lastname); |
|
90 | + $customer->last_name = Security::filter($xml->customer->lastname); |
|
91 | + $customer->city = Security::filter($xml->customer->city); |
|
92 | + $customer->state = Security::filter($xml->customer->state); |
|
93 | + $customer->country = Security::filter($xml->customer->country); |
|
94 | 94 | |
95 | 95 | $message->customer = $customer; |
96 | 96 | } |
97 | 97 | |
98 | 98 | // Transaction |
99 | - if ( $xml->transaction ) { |
|
99 | + if ($xml->transaction) { |
|
100 | 100 | $transaction = new stdClass(); |
101 | 101 | |
102 | - $transaction->id = Security::filter( $xml->transaction->id ); |
|
103 | - $transaction->currency = Security::filter( $xml->transaction->currency ); |
|
104 | - $transaction->amount = Security::filter( $xml->transaction->amount ); |
|
105 | - $transaction->description = Security::filter( $xml->transaction->description ); |
|
106 | - $transaction->var1 = Security::filter( $xml->transaction->var1 ); |
|
107 | - $transaction->var2 = Security::filter( $xml->transaction->var2 ); |
|
108 | - $transaction->var3 = Security::filter( $xml->transaction->var3 ); |
|
109 | - $transaction->items = Security::filter( $xml->transaction->items ); |
|
102 | + $transaction->id = Security::filter($xml->transaction->id); |
|
103 | + $transaction->currency = Security::filter($xml->transaction->currency); |
|
104 | + $transaction->amount = Security::filter($xml->transaction->amount); |
|
105 | + $transaction->description = Security::filter($xml->transaction->description); |
|
106 | + $transaction->var1 = Security::filter($xml->transaction->var1); |
|
107 | + $transaction->var2 = Security::filter($xml->transaction->var2); |
|
108 | + $transaction->var3 = Security::filter($xml->transaction->var3); |
|
109 | + $transaction->items = Security::filter($xml->transaction->items); |
|
110 | 110 | |
111 | 111 | $message->transaction = $transaction; |
112 | 112 | } |
113 | 113 | |
114 | 114 | // Payment details |
115 | - if ( $xml->paymentdetails ) { |
|
115 | + if ($xml->paymentdetails) { |
|
116 | 116 | $payment_details = new stdClass(); |
117 | 117 | |
118 | - $payment_details->type = Security::filter( $xml->paymentdetails->type ); |
|
119 | - $payment_details->account_iban = Security::filter( $xml->paymentdetails->accountiban ); |
|
120 | - $payment_details->account_bic = Security::filter( $xml->paymentdetails->accountbic ); |
|
121 | - $payment_details->account_id = Security::filter( $xml->paymentdetails->accountid ); |
|
122 | - $payment_details->account_holder_name = Security::filter( $xml->paymentdetails->accountholdername ); |
|
123 | - $payment_details->external_transaction_id = Security::filter( $xml->paymentdetails->externaltransactionid ); |
|
118 | + $payment_details->type = Security::filter($xml->paymentdetails->type); |
|
119 | + $payment_details->account_iban = Security::filter($xml->paymentdetails->accountiban); |
|
120 | + $payment_details->account_bic = Security::filter($xml->paymentdetails->accountbic); |
|
121 | + $payment_details->account_id = Security::filter($xml->paymentdetails->accountid); |
|
122 | + $payment_details->account_holder_name = Security::filter($xml->paymentdetails->accountholdername); |
|
123 | + $payment_details->external_transaction_id = Security::filter($xml->paymentdetails->externaltransactionid); |
|
124 | 124 | |
125 | 125 | $message->payment_details = $payment_details; |
126 | 126 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @return DOMDocument |
43 | 43 | */ |
44 | 44 | protected function get_document() { |
45 | - $document = new DOMDocument( parent::XML_VERSION, parent::XML_ENCODING ); |
|
45 | + $document = new DOMDocument(parent::XML_VERSION, parent::XML_ENCODING); |
|
46 | 46 | |
47 | 47 | // We can't disable preserve white space and format the output |
48 | 48 | // this is causing 'Invalid electronic signature' errors |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | $document->formatOutput = true; |
51 | 51 | |
52 | 52 | // Root |
53 | - $root = $document->createElement( $this->get_name() ); |
|
53 | + $root = $document->createElement($this->get_name()); |
|
54 | 54 | |
55 | - $document->appendChild( $root ); |
|
55 | + $document->appendChild($root); |
|
56 | 56 | |
57 | 57 | return $document; |
58 | 58 | } |
@@ -37,11 +37,11 @@ |
||
37 | 37 | * |
38 | 38 | * @return RedirectTransactionResponseMessage |
39 | 39 | */ |
40 | - public static function parse( SimpleXMLElement $xml ) { |
|
40 | + public static function parse(SimpleXMLElement $xml) { |
|
41 | 41 | $message = new RedirectTransactionResponseMessage(); |
42 | 42 | |
43 | - $message->result = Security::filter( $xml['result'] ); |
|
44 | - $message->transaction = TransactionParser::parse( $xml->transaction ); |
|
43 | + $message->result = Security::filter($xml['result']); |
|
44 | + $message->transaction = TransactionParser::parse($xml->transaction); |
|
45 | 45 | |
46 | 46 | return $message; |
47 | 47 | } |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * Constructs and initialize an directory response message |
27 | 27 | */ |
28 | - public function __construct( $merchant, $customer, $transaction ) { |
|
29 | - parent::__construct( self::NAME ); |
|
28 | + public function __construct($merchant, $customer, $transaction) { |
|
29 | + parent::__construct(self::NAME); |
|
30 | 30 | |
31 | 31 | $this->merchant = $merchant; |
32 | 32 | $this->customer = $customer; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | $document = parent::get_document(); |
43 | 43 | |
44 | 44 | // Merchant |
45 | - $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' ); |
|
45 | + $merchant = XML_Util::add_element($document, $document->documentElement, 'merchant'); |
|
46 | 46 | |
47 | - XML_Util::add_elements( $document, $merchant, array( |
|
47 | + XML_Util::add_elements($document, $merchant, array( |
|
48 | 48 | 'account' => $this->merchant->account, |
49 | 49 | 'site_id' => $this->merchant->site_id, |
50 | 50 | 'site_secure_code' => $this->merchant->site_secure_code, |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | 'redirect_url' => $this->merchant->redirect_url, |
53 | 53 | 'cancel_url' => $this->merchant->cancel_url, |
54 | 54 | 'close_window' => $this->merchant->close_window, |
55 | - ) ); |
|
55 | + )); |
|
56 | 56 | |
57 | 57 | // Customer |
58 | - $customer = XML_Util::add_element( $document, $document->documentElement, 'customer' ); |
|
58 | + $customer = XML_Util::add_element($document, $document->documentElement, 'customer'); |
|
59 | 59 | |
60 | - XML_Util::add_elements( $document, $customer, array( |
|
60 | + XML_Util::add_elements($document, $customer, array( |
|
61 | 61 | 'locale' => $this->customer->locale, |
62 | 62 | 'ipaddress' => $this->customer->ip_address, |
63 | 63 | 'forwardedip' => $this->customer->forwarded_ip, |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | 'country' => $this->customer->country, |
72 | 72 | 'phone' => $this->customer->phone, |
73 | 73 | 'email' => $this->customer->email, |
74 | - ) ); |
|
74 | + )); |
|
75 | 75 | |
76 | 76 | // Transaction |
77 | - $transaction = XML_Util::add_element( $document, $document->documentElement, 'transaction' ); |
|
77 | + $transaction = XML_Util::add_element($document, $document->documentElement, 'transaction'); |
|
78 | 78 | |
79 | - XML_Util::add_elements( $document, $transaction, array( |
|
79 | + XML_Util::add_elements($document, $transaction, array( |
|
80 | 80 | 'id' => $this->transaction->id, |
81 | 81 | 'currency' => $this->transaction->currency, |
82 | 82 | 'amount' => $this->transaction->amount, |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | 'manual' => $this->transaction->manual, |
89 | 89 | 'gateway' => $this->transaction->gateway, |
90 | 90 | 'daysactive' => $this->transaction->days_active, |
91 | - ) ); |
|
91 | + )); |
|
92 | 92 | |
93 | 93 | // Signature |
94 | - XML_Util::add_element( $document, $document->documentElement, 'signature', $this->signature ); |
|
94 | + XML_Util::add_element($document, $document->documentElement, 'signature', $this->signature); |
|
95 | 95 | |
96 | 96 | return $document; |
97 | 97 | } |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | * @param Transaction $transaction |
42 | 42 | * @param GatewayInfo $gateway_info |
43 | 43 | */ |
44 | - public function __construct( Merchant $merchant, Customer $customer, Transaction $transaction, GatewayInfo $gateway_info = null ) { |
|
45 | - parent::__construct( self::NAME ); |
|
44 | + public function __construct(Merchant $merchant, Customer $customer, Transaction $transaction, GatewayInfo $gateway_info = null) { |
|
45 | + parent::__construct(self::NAME); |
|
46 | 46 | |
47 | 47 | $this->merchant = $merchant; |
48 | 48 | $this->customer = $customer; |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | $document = parent::get_document(); |
60 | 60 | |
61 | 61 | // Merchant |
62 | - $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' ); |
|
62 | + $merchant = XML_Util::add_element($document, $document->documentElement, 'merchant'); |
|
63 | 63 | |
64 | - XML_Util::add_elements( $document, $merchant, array( |
|
64 | + XML_Util::add_elements($document, $merchant, array( |
|
65 | 65 | 'account' => $this->merchant->account, |
66 | 66 | 'site_id' => $this->merchant->site_id, |
67 | 67 | 'site_secure_code' => $this->merchant->site_secure_code, |
@@ -69,12 +69,12 @@ discard block |
||
69 | 69 | 'redirect_url' => $this->merchant->redirect_url, |
70 | 70 | 'cancel_url' => $this->merchant->cancel_url, |
71 | 71 | 'close_window' => $this->merchant->close_window, |
72 | - ) ); |
|
72 | + )); |
|
73 | 73 | |
74 | 74 | // Customer |
75 | - $customer = XML_Util::add_element( $document, $document->documentElement, 'customer' ); |
|
75 | + $customer = XML_Util::add_element($document, $document->documentElement, 'customer'); |
|
76 | 76 | |
77 | - XML_Util::add_elements( $document, $customer, array( |
|
77 | + XML_Util::add_elements($document, $customer, array( |
|
78 | 78 | 'locale' => $this->customer->locale, |
79 | 79 | 'ipaddress' => $this->customer->ip_address, |
80 | 80 | 'forwardedip' => $this->customer->forwarded_ip, |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | 'country' => $this->customer->country, |
89 | 89 | 'phone' => $this->customer->phone, |
90 | 90 | 'email' => $this->customer->email, |
91 | - ) ); |
|
91 | + )); |
|
92 | 92 | |
93 | 93 | // Transaction |
94 | - $transaction = XML_Util::add_element( $document, $document->documentElement, 'transaction' ); |
|
94 | + $transaction = XML_Util::add_element($document, $document->documentElement, 'transaction'); |
|
95 | 95 | |
96 | - XML_Util::add_elements( $document, $transaction, array( |
|
96 | + XML_Util::add_elements($document, $transaction, array( |
|
97 | 97 | 'id' => $this->transaction->id, |
98 | 98 | 'currency' => $this->transaction->currency, |
99 | 99 | 'amount' => $this->transaction->amount, |
@@ -105,19 +105,19 @@ discard block |
||
105 | 105 | 'manual' => $this->transaction->manual, |
106 | 106 | 'gateway' => $this->transaction->gateway, |
107 | 107 | 'daysactive' => $this->transaction->days_active, |
108 | - ) ); |
|
108 | + )); |
|
109 | 109 | |
110 | 110 | // Gateway info |
111 | - if ( $this->gateway_info ) { |
|
112 | - $gateway_info = XML_Util::add_element( $document, $document->documentElement, 'gatewayinfo' ); |
|
111 | + if ($this->gateway_info) { |
|
112 | + $gateway_info = XML_Util::add_element($document, $document->documentElement, 'gatewayinfo'); |
|
113 | 113 | |
114 | - XML_Util::add_elements( $document, $gateway_info, array( |
|
114 | + XML_Util::add_elements($document, $gateway_info, array( |
|
115 | 115 | 'issuerid' => $this->gateway_info->issuer_id, |
116 | - ) ); |
|
116 | + )); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // Signature |
120 | - XML_Util::add_element( $document, $document->documentElement, 'signature', $this->signature ); |
|
120 | + XML_Util::add_element($document, $document->documentElement, 'signature', $this->signature); |
|
121 | 121 | |
122 | 122 | return $document; |
123 | 123 | } |