@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | * @param Merchant $merchant |
37 | 37 | * @param $transaction_id |
38 | 38 | */ |
39 | - public function __construct( Merchant $merchant, $transaction_id ) { |
|
40 | - parent::__construct( self::NAME ); |
|
39 | + public function __construct(Merchant $merchant, $transaction_id) { |
|
40 | + parent::__construct(self::NAME); |
|
41 | 41 | |
42 | 42 | $this->merchant = $merchant; |
43 | 43 | $this->transaction_id = $transaction_id; |
@@ -52,20 +52,20 @@ discard block |
||
52 | 52 | $document = parent::get_document(); |
53 | 53 | |
54 | 54 | // Merchant |
55 | - $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' ); |
|
55 | + $merchant = XML_Util::add_element($document, $document->documentElement, 'merchant'); |
|
56 | 56 | |
57 | - XML_Util::add_elements( $document, $merchant, array( |
|
57 | + XML_Util::add_elements($document, $merchant, array( |
|
58 | 58 | 'account' => $this->merchant->account, |
59 | 59 | 'site_id' => $this->merchant->site_id, |
60 | 60 | 'site_secure_code' => $this->merchant->site_secure_code, |
61 | - ) ); |
|
61 | + )); |
|
62 | 62 | |
63 | 63 | // Transaction |
64 | - $transaction = XML_Util::add_element( $document, $document->documentElement, 'transaction' ); |
|
64 | + $transaction = XML_Util::add_element($document, $document->documentElement, 'transaction'); |
|
65 | 65 | |
66 | - XML_Util::add_elements( $document, $transaction, array( |
|
66 | + XML_Util::add_elements($document, $transaction, array( |
|
67 | 67 | 'id' => $this->transaction_id, |
68 | - ) ); |
|
68 | + )); |
|
69 | 69 | |
70 | 70 | return $document; |
71 | 71 | } |
@@ -45,22 +45,22 @@ |
||
45 | 45 | * |
46 | 46 | * @return DirectTransactionResponseMessage |
47 | 47 | */ |
48 | - public static function parse( SimpleXMLElement $xml ) { |
|
48 | + public static function parse(SimpleXMLElement $xml) { |
|
49 | 49 | // Message |
50 | 50 | $message = new DirectTransactionResponseMessage(); |
51 | 51 | |
52 | 52 | // Result |
53 | - $message->result = Security::filter( $xml['result'] ); |
|
53 | + $message->result = Security::filter($xml['result']); |
|
54 | 54 | |
55 | 55 | // Transaction |
56 | - $message->transaction = TransactionParser::parse( $xml->transaction ); |
|
56 | + $message->transaction = TransactionParser::parse($xml->transaction); |
|
57 | 57 | |
58 | 58 | // Gateway info |
59 | - if ( $xml->gatewayinfo ) { |
|
59 | + if ($xml->gatewayinfo) { |
|
60 | 60 | $message->gateway_info = new GatewayInfo(); |
61 | - $message->gateway_info->redirect_url = Security::filter( $xml->gatewayinfo->redirecturl ); |
|
62 | - $message->gateway_info->ext_var = Security::filter( $xml->gatewayinfo->extvar ); |
|
63 | - $message->gateway_info->issuer_id = Security::filter( $xml->gatewayinfo->issuerid ); |
|
61 | + $message->gateway_info->redirect_url = Security::filter($xml->gatewayinfo->redirecturl); |
|
62 | + $message->gateway_info->ext_var = Security::filter($xml->gatewayinfo->extvar); |
|
63 | + $message->gateway_info->issuer_id = Security::filter($xml->gatewayinfo->issuerid); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $message; |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * Constructs and initialize an directory response message |
28 | 28 | */ |
29 | - public function __construct( $merchant, $customer, $transaction ) { |
|
30 | - parent::__construct( self::NAME ); |
|
29 | + public function __construct($merchant, $customer, $transaction) { |
|
30 | + parent::__construct(self::NAME); |
|
31 | 31 | |
32 | 32 | $this->merchant = $merchant; |
33 | 33 | $this->customer = $customer; |
@@ -43,9 +43,9 @@ discard block |
||
43 | 43 | $document = parent::get_document(); |
44 | 44 | |
45 | 45 | // Merchant |
46 | - $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' ); |
|
46 | + $merchant = XML_Util::add_element($document, $document->documentElement, 'merchant'); |
|
47 | 47 | |
48 | - XML_Util::add_elements( $document, $merchant, array( |
|
48 | + XML_Util::add_elements($document, $merchant, array( |
|
49 | 49 | 'account' => $this->merchant->account, |
50 | 50 | 'site_id' => $this->merchant->site_id, |
51 | 51 | 'site_secure_code' => $this->merchant->site_secure_code, |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | 'redirect_url' => $this->merchant->redirect_url, |
54 | 54 | 'cancel_url' => $this->merchant->cancel_url, |
55 | 55 | 'close_window' => $this->merchant->close_window, |
56 | - ) ); |
|
56 | + )); |
|
57 | 57 | |
58 | 58 | // Customer |
59 | - $customer = XML_Util::add_element( $document, $document->documentElement, 'customer' ); |
|
59 | + $customer = XML_Util::add_element($document, $document->documentElement, 'customer'); |
|
60 | 60 | |
61 | - XML_Util::add_elements( $document, $customer, array( |
|
61 | + XML_Util::add_elements($document, $customer, array( |
|
62 | 62 | 'locale' => $this->customer->locale, |
63 | 63 | 'ipaddress' => $this->customer->ip_address, |
64 | 64 | 'forwardedip' => $this->customer->forwarded_ip, |
@@ -72,15 +72,15 @@ discard block |
||
72 | 72 | 'country' => $this->customer->country, |
73 | 73 | 'phone' => $this->customer->phone, |
74 | 74 | 'email' => $this->customer->email, |
75 | - ) ); |
|
75 | + )); |
|
76 | 76 | |
77 | 77 | // Transaction |
78 | - $transaction = XML_Util::add_element( $document, $document->documentElement, 'transaction' ); |
|
78 | + $transaction = XML_Util::add_element($document, $document->documentElement, 'transaction'); |
|
79 | 79 | |
80 | - XML_Util::add_elements( $document, $transaction, array( |
|
80 | + XML_Util::add_elements($document, $transaction, array( |
|
81 | 81 | 'id' => $this->transaction->id, |
82 | 82 | 'currency' => $this->transaction->currency, |
83 | - 'amount' => Pay_Util::amount_to_cents( $this->transaction->amount ), |
|
83 | + 'amount' => Pay_Util::amount_to_cents($this->transaction->amount), |
|
84 | 84 | 'description' => $this->transaction->description, |
85 | 85 | 'var1' => $this->transaction->var1, |
86 | 86 | 'var2' => $this->transaction->var2, |
@@ -89,10 +89,10 @@ discard block |
||
89 | 89 | 'manual' => $this->transaction->manual, |
90 | 90 | 'gateway' => $this->transaction->gateway, |
91 | 91 | 'daysactive' => $this->transaction->days_active, |
92 | - ) ); |
|
92 | + )); |
|
93 | 93 | |
94 | 94 | // Signature |
95 | - XML_Util::add_element( $document, $document->documentElement, 'signature', $this->signature ); |
|
95 | + XML_Util::add_element($document, $document->documentElement, 'signature', $this->signature); |
|
96 | 96 | |
97 | 97 | return $document; |
98 | 98 | } |
@@ -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 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | * @param Transaction $transaction |
43 | 43 | * @param GatewayInfo $gateway_info |
44 | 44 | */ |
45 | - public function __construct( Merchant $merchant, Customer $customer, Transaction $transaction, GatewayInfo $gateway_info = null ) { |
|
46 | - parent::__construct( self::NAME ); |
|
45 | + public function __construct(Merchant $merchant, Customer $customer, Transaction $transaction, GatewayInfo $gateway_info = null) { |
|
46 | + parent::__construct(self::NAME); |
|
47 | 47 | |
48 | 48 | $this->merchant = $merchant; |
49 | 49 | $this->customer = $customer; |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $document = parent::get_document(); |
61 | 61 | |
62 | 62 | // Merchant |
63 | - $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' ); |
|
63 | + $merchant = XML_Util::add_element($document, $document->documentElement, 'merchant'); |
|
64 | 64 | |
65 | - XML_Util::add_elements( $document, $merchant, array( |
|
65 | + XML_Util::add_elements($document, $merchant, array( |
|
66 | 66 | 'account' => $this->merchant->account, |
67 | 67 | 'site_id' => $this->merchant->site_id, |
68 | 68 | 'site_secure_code' => $this->merchant->site_secure_code, |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | 'redirect_url' => $this->merchant->redirect_url, |
71 | 71 | 'cancel_url' => $this->merchant->cancel_url, |
72 | 72 | 'close_window' => $this->merchant->close_window, |
73 | - ) ); |
|
73 | + )); |
|
74 | 74 | |
75 | 75 | // Customer |
76 | - $customer = XML_Util::add_element( $document, $document->documentElement, 'customer' ); |
|
76 | + $customer = XML_Util::add_element($document, $document->documentElement, 'customer'); |
|
77 | 77 | |
78 | - XML_Util::add_elements( $document, $customer, array( |
|
78 | + XML_Util::add_elements($document, $customer, array( |
|
79 | 79 | 'locale' => $this->customer->locale, |
80 | 80 | 'ipaddress' => $this->customer->ip_address, |
81 | 81 | 'forwardedip' => $this->customer->forwarded_ip, |
@@ -89,15 +89,15 @@ discard block |
||
89 | 89 | 'country' => $this->customer->country, |
90 | 90 | 'phone' => $this->customer->phone, |
91 | 91 | 'email' => $this->customer->email, |
92 | - ) ); |
|
92 | + )); |
|
93 | 93 | |
94 | 94 | // Transaction |
95 | - $transaction = XML_Util::add_element( $document, $document->documentElement, 'transaction' ); |
|
95 | + $transaction = XML_Util::add_element($document, $document->documentElement, 'transaction'); |
|
96 | 96 | |
97 | - XML_Util::add_elements( $document, $transaction, array( |
|
97 | + XML_Util::add_elements($document, $transaction, array( |
|
98 | 98 | 'id' => $this->transaction->id, |
99 | 99 | 'currency' => $this->transaction->currency, |
100 | - 'amount' => Core_Util::amount_to_cents( $this->transaction->amount ), |
|
100 | + 'amount' => Core_Util::amount_to_cents($this->transaction->amount), |
|
101 | 101 | 'description' => $this->transaction->description, |
102 | 102 | 'var1' => $this->transaction->var1, |
103 | 103 | 'var2' => $this->transaction->var2, |
@@ -106,19 +106,19 @@ discard block |
||
106 | 106 | 'manual' => $this->transaction->manual, |
107 | 107 | 'gateway' => $this->transaction->gateway, |
108 | 108 | 'daysactive' => $this->transaction->days_active, |
109 | - ) ); |
|
109 | + )); |
|
110 | 110 | |
111 | 111 | // Gateway info |
112 | - if ( $this->gateway_info ) { |
|
113 | - $gateway_info = XML_Util::add_element( $document, $document->documentElement, 'gatewayinfo' ); |
|
112 | + if ($this->gateway_info) { |
|
113 | + $gateway_info = XML_Util::add_element($document, $document->documentElement, 'gatewayinfo'); |
|
114 | 114 | |
115 | - XML_Util::add_elements( $document, $gateway_info, array( |
|
115 | + XML_Util::add_elements($document, $gateway_info, array( |
|
116 | 116 | 'issuerid' => $this->gateway_info->issuer_id, |
117 | - ) ); |
|
117 | + )); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | // Signature |
121 | - XML_Util::add_element( $document, $document->documentElement, 'signature', $this->signature ); |
|
121 | + XML_Util::add_element($document, $document->documentElement, 'signature', $this->signature); |
|
122 | 122 | |
123 | 123 | return $document; |
124 | 124 | } |
@@ -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 | } |