Completed
Push — feature/post-pay ( 4cda7d...b926bb )
by Remco
08:32
created
src/Util.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	 * $            Dollar
62 62
 	 */
63 63
 	public static function get_pattern() {
64
-		if ( null === self::$pattern ) {
64
+		if (null === self::$pattern) {
65 65
 			$characters = array(
66 66
 				'A-Z',
67 67
 				'a-z',
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			 * We use a # as a regex delimiter instead of a / so we don't have to escape the slash.
91 91
 			 * @see http://stackoverflow.com/q/12239424
92 92
 			 */
93
-			self::$pattern = '#[^' . implode( $characters ) . ']#';
93
+			self::$pattern = '#[^' . implode($characters) . ']#';
94 94
 		}
95 95
 
96 96
 		return self::$pattern;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @param string $string String to filter.
103 103
 	 * @return mixed
104 104
 	 */
105
-	public static function filter( $string ) {
106
-		return preg_replace( self::get_pattern(), '', $string );
105
+	public static function filter($string) {
106
+		return preg_replace(self::get_pattern(), '', $string);
107 107
 	}
108 108
 }
Please login to merge, or discard this patch.
src/Request.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 	 * @param string $parameter Parameter.
38 38
 	 * @return string|null
39 39
 	 */
40
-	public function get_parameter( $parameter ) {
41
-		if ( isset( $this->parameters[ $parameter ] ) ) {
42
-			return $this->parameters[ $parameter ];
40
+	public function get_parameter($parameter) {
41
+		if (isset($this->parameters[$parameter])) {
42
+			return $this->parameters[$parameter];
43 43
 		}
44 44
 
45 45
 		return null;
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	 * @param string $parameter Parameter.
52 52
 	 * @param string $value     Value.
53 53
 	 */
54
-	public function set_parameter( $parameter, $value ) {
55
-		$this->parameters[ $parameter ] = $value;
54
+	public function set_parameter($parameter, $value) {
55
+		$this->parameters[$parameter] = $value;
56 56
 	}
57 57
 
58 58
 	/**
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @param array $parameters Parameters.
71 71
 	 */
72
-	public function merge_parameters( $parameters ) {
73
-		$this->parameters = array_merge( $this->parameters, $parameters );
72
+	public function merge_parameters($parameters) {
73
+		$this->parameters = array_merge($this->parameters, $parameters);
74 74
 	}
75 75
 
76 76
 	/**
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 	 * @param string $merchant_key Merchant key.
89 89
 	 * @return string
90 90
 	 */
91
-	public function get_signature( $merchant_key ) {
91
+	public function get_signature($merchant_key) {
92 92
 		$data = $this->get_signature_data();
93 93
 
94 94
 		$data[] = $merchant_key;
95 95
 
96
-		$string = implode( '', $data );
96
+		$string = implode('', $data);
97 97
 
98
-		$signature = sha1( $string );
98
+		$signature = sha1($string);
99 99
 
100 100
 		return $signature;
101 101
 	}
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @param string $merchant_key Merchant key.
107 107
 	 */
108
-	public function sign( $merchant_key ) {
109
-		$signature = $this->get_signature( $merchant_key );
108
+	public function sign($merchant_key) {
109
+		$signature = $this->get_signature($merchant_key);
110 110
 
111
-		$this->set_parameter( 'sha1', $signature );
111
+		$this->set_parameter('sha1', $signature);
112 112
 	}
113 113
 }
Please login to merge, or discard this patch.
src/Error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	 * @param string $code    Code.
42 42
 	 * @param string $message Message.
43 43
 	 */
44
-	public function __construct( $code, $message ) {
44
+	public function __construct($code, $message) {
45 45
 		$this->code    = $code;
46 46
 		$this->message = $message;
47 47
 	}
Please login to merge, or discard this patch.
src/Methods.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -192,13 +192,13 @@
 block discarded – undo
192 192
 	 * @param string|null $default        Value to return if method could not be transformed.
193 193
 	 * @return string|null
194 194
 	 */
195
-	public static function transform( $payment_method, $default = null ) {
196
-		if ( ! is_scalar( $payment_method ) ) {
195
+	public static function transform($payment_method, $default = null) {
196
+		if ( ! is_scalar($payment_method)) {
197 197
 			return null;
198 198
 		}
199 199
 
200
-		if ( isset( self::$map[ $payment_method ] ) ) {
201
-			return self::$map[ $payment_method ];
200
+		if (isset(self::$map[$payment_method])) {
201
+			return self::$map[$payment_method];
202 202
 		}
203 203
 
204 204
 		return $default;
Please login to merge, or discard this patch.
src/XML/Parser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 	 *
29 29
 	 * @param SimpleXMLElement $xml XML element to parse.
30 30
 	 */
31
-	public static function parse( SimpleXMLElement $xml );
31
+	public static function parse(SimpleXMLElement $xml);
32 32
 }
Please login to merge, or discard this patch.
src/XML/TransactionParser.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -33,57 +33,57 @@
 block discarded – undo
33 33
 	 * @param SimpleXMLElement $xml XML element to parse.
34 34
 	 * @return Transaction
35 35
 	 */
36
-	public static function parse( SimpleXMLElement $xml ) {
36
+	public static function parse(SimpleXMLElement $xml) {
37 37
 		$transaction = new Transaction();
38 38
 
39 39
 		// Transaction request.
40
-		if ( isset( $xml->trxid ) ) {
41
-			$transaction->id = Security::filter( $xml->trxid );
40
+		if (isset($xml->trxid)) {
41
+			$transaction->id = Security::filter($xml->trxid);
42 42
 		}
43 43
 
44
-		if ( isset( $xml->issuerurl ) ) {
45
-			$transaction->issuer_url = urldecode( Security::filter( $xml->issuerurl ) );
44
+		if (isset($xml->issuerurl)) {
45
+			$transaction->issuer_url = urldecode(Security::filter($xml->issuerurl));
46 46
 		}
47 47
 
48 48
 		// Status response.
49
-		if ( isset( $xml->status ) ) {
50
-			$transaction->status = Security::filter( $xml->status );
49
+		if (isset($xml->status)) {
50
+			$transaction->status = Security::filter($xml->status);
51 51
 		}
52 52
 
53
-		if ( isset( $xml->amount ) ) {
54
-			$transaction->amount = Pay_Util::cents_to_amount( Security::filter( $xml->amount ) );
53
+		if (isset($xml->amount)) {
54
+			$transaction->amount = Pay_Util::cents_to_amount(Security::filter($xml->amount));
55 55
 		}
56 56
 
57
-		if ( isset( $xml->purchaseid ) ) {
58
-			$transaction->purchase_id = Security::filter( $xml->purchaseid );
57
+		if (isset($xml->purchaseid)) {
58
+			$transaction->purchase_id = Security::filter($xml->purchaseid);
59 59
 		}
60 60
 
61
-		if ( isset( $xml->description ) ) {
62
-			$transaction->description = Security::filter( $xml->description );
61
+		if (isset($xml->description)) {
62
+			$transaction->description = Security::filter($xml->description);
63 63
 		}
64 64
 
65
-		if ( isset( $xml->entrancecode ) ) {
66
-			$transaction->entrance_code = Security::filter( $xml->entrancecode );
65
+		if (isset($xml->entrancecode)) {
66
+			$transaction->entrance_code = Security::filter($xml->entrancecode);
67 67
 		}
68 68
 
69
-		if ( isset( $xml->issuerid ) ) {
70
-			$transaction->issuer_id = Security::filter( $xml->issuerid );
69
+		if (isset($xml->issuerid)) {
70
+			$transaction->issuer_id = Security::filter($xml->issuerid);
71 71
 		}
72 72
 
73
-		if ( isset( $xml->timestamp ) ) {
74
-			$transaction->timestamp = new DateTime( Security::filter( $xml->timestamp ) );
73
+		if (isset($xml->timestamp)) {
74
+			$transaction->timestamp = new DateTime(Security::filter($xml->timestamp));
75 75
 		}
76 76
 
77
-		if ( isset( $xml->consumername ) ) {
78
-			$transaction->consumer_name = Security::filter( $xml->consumername );
77
+		if (isset($xml->consumername)) {
78
+			$transaction->consumer_name = Security::filter($xml->consumername);
79 79
 		}
80 80
 
81
-		if ( isset( $xml->consumeraccount ) ) {
82
-			$transaction->consumer_account = Security::filter( $xml->consumeraccount );
81
+		if (isset($xml->consumeraccount)) {
82
+			$transaction->consumer_account = Security::filter($xml->consumeraccount);
83 83
 		}
84 84
 
85
-		if ( isset( $xml->consumercity ) ) {
86
-			$transaction->consumer_city = Security::filter( $xml->consumercity );
85
+		if (isset($xml->consumercity)) {
86
+			$transaction->consumer_city = Security::filter($xml->consumercity);
87 87
 		}
88 88
 
89 89
 		return $transaction;
Please login to merge, or discard this patch.
src/XML/ErrorParser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
 	 *
31 31
 	 * @param SimpleXMLElement $xml XML element to parse.
32 32
 	 */
33
-	public static function parse( SimpleXMLElement $xml ) {
33
+	public static function parse(SimpleXMLElement $xml) {
34 34
 		$error = new Sisow_Error(
35
-			Security::filter( $xml->errorcode ),
36
-			Security::filter( $xml->errormessage )
35
+			Security::filter($xml->errorcode),
36
+			Security::filter($xml->errormessage)
37 37
 		);
38 38
 
39 39
 		return $error;
Please login to merge, or discard this patch.
src/Settings.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 	 * Construct settings.
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_filter( 'pronamic_pay_gateway_sections', array( $this, 'sections' ) );
31
-		add_filter( 'pronamic_pay_gateway_fields', array( $this, 'fields' ) );
30
+		add_filter('pronamic_pay_gateway_sections', array($this, 'sections'));
31
+		add_filter('pronamic_pay_gateway_fields', array($this, 'fields'));
32 32
 	}
33 33
 
34 34
 	/**
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 	 * @param array $sections Sections.
38 38
 	 * @return array
39 39
 	 */
40
-	public function sections( array $sections ) {
40
+	public function sections(array $sections) {
41 41
 		// Sisow.
42 42
 		$sections['sisow'] = array(
43
-			'title'       => __( 'Sisow', 'pronamic_ideal' ),
44
-			'methods'     => array( 'sisow' ),
43
+			'title'       => __('Sisow', 'pronamic_ideal'),
44
+			'methods'     => array('sisow'),
45 45
 			'description' => sprintf(
46 46
 				/* translators: %s: Sisow */
47
-				__( 'Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal' ),
48
-				__( 'Sisow', 'pronamic_ideal' )
47
+				__('Account details are provided by %1$s after registration. These settings need to match with the %1$s dashboard.', 'pronamic_ideal'),
48
+				__('Sisow', 'pronamic_ideal')
49 49
 			),
50 50
 		);
51 51
 
@@ -58,55 +58,55 @@  discard block
 block discarded – undo
58 58
 	 * @param array $fields Fields.
59 59
 	 * @return array
60 60
 	 */
61
-	public function fields( array $fields ) {
61
+	public function fields(array $fields) {
62 62
 		// Merchant ID.
63 63
 		$fields[] = array(
64 64
 			'filter'   => FILTER_SANITIZE_STRING,
65 65
 			'section'  => 'sisow',
66
-			'methods'  => array( 'sisow' ),
66
+			'methods'  => array('sisow'),
67 67
 			'meta_key' => '_pronamic_gateway_sisow_merchant_id',
68
-			'title'    => _x( 'Merchant ID', 'sisow', 'pronamic_ideal' ),
68
+			'title'    => _x('Merchant ID', 'sisow', 'pronamic_ideal'),
69 69
 			'type'     => 'text',
70
-			'classes'  => array( 'code' ),
71
-			'tooltip'  => __( 'Merchant ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
70
+			'classes'  => array('code'),
71
+			'tooltip'  => __('Merchant ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
72 72
 		);
73 73
 
74 74
 		// Merchant Key.
75 75
 		$fields[] = array(
76 76
 			'filter'   => FILTER_SANITIZE_STRING,
77 77
 			'section'  => 'sisow',
78
-			'methods'  => array( 'sisow' ),
78
+			'methods'  => array('sisow'),
79 79
 			'meta_key' => '_pronamic_gateway_sisow_merchant_key',
80
-			'title'    => _x( 'Merchant Key', 'sisow', 'pronamic_ideal' ),
80
+			'title'    => _x('Merchant Key', 'sisow', 'pronamic_ideal'),
81 81
 			'type'     => 'text',
82
-			'classes'  => array( 'regular-text', 'code' ),
83
-			'tooltip'  => __( 'Merchant Key as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
82
+			'classes'  => array('regular-text', 'code'),
83
+			'tooltip'  => __('Merchant Key as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
84 84
 		);
85 85
 
86 86
 		// Shop ID.
87 87
 		$fields[] = array(
88 88
 			'filter'      => FILTER_SANITIZE_STRING,
89 89
 			'section'     => 'sisow',
90
-			'methods'     => array( 'sisow' ),
90
+			'methods'     => array('sisow'),
91 91
 			'meta_key'    => '_pronamic_gateway_sisow_shop_id',
92
-			'title'       => _x( 'Shop ID', 'sisow', 'pronamic_ideal' ),
92
+			'title'       => _x('Shop ID', 'sisow', 'pronamic_ideal'),
93 93
 			'type'        => 'text',
94
-			'classes'     => array( 'regular-text', 'code' ),
95
-			'tooltip'     => __( 'Shop ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal' ),
94
+			'classes'     => array('regular-text', 'code'),
95
+			'tooltip'     => __('Shop ID as mentioned at <strong>My Profile</strong> in the Sisow dashboard.', 'pronamic_ideal'),
96 96
 			/* translators: %s: 0 */
97
-			'description' => sprintf( __( 'Default: <code>%s</code>', 'pronamic_ideal' ), 0 ),
97
+			'description' => sprintf(__('Default: <code>%s</code>', 'pronamic_ideal'), 0),
98 98
 			'default'     => 0,
99 99
 		);
100 100
 
101 101
 		// Transaction feedback.
102 102
 		$fields[] = array(
103 103
 			'section' => 'sisow',
104
-			'methods' => array( 'sisow' ),
105
-			'title'   => __( 'Transaction feedback', 'pronamic_ideal' ),
104
+			'methods' => array('sisow'),
105
+			'title'   => __('Transaction feedback', 'pronamic_ideal'),
106 106
 			'type'    => 'description',
107 107
 			'html'    => sprintf(
108 108
 				'<span class="dashicons dashicons-yes"></span> %s',
109
-				__( 'Payment status updates will be processed without any additional configuration.', 'pronamic_ideal' )
109
+				__('Payment status updates will be processed without any additional configuration.', 'pronamic_ideal')
110 110
 			),
111 111
 		);
112 112
 
Please login to merge, or discard this patch.
src/Gateway.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -37,17 +37,17 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @param Config $config Config.
39 39
 	 */
40
-	public function __construct( Config $config ) {
41
-		parent::__construct( $config );
40
+	public function __construct(Config $config) {
41
+		parent::__construct($config);
42 42
 
43 43
 		$this->supports = array(
44 44
 			'payment_status_request',
45 45
 		);
46 46
 
47
-		$this->set_method( self::METHOD_HTTP_REDIRECT );
47
+		$this->set_method(self::METHOD_HTTP_REDIRECT);
48 48
 
49
-		$this->client = new Client( $config->merchant_id, $config->merchant_key );
50
-		$this->client->set_test_mode( self::MODE_TEST === $config->mode );
49
+		$this->client = new Client($config->merchant_id, $config->merchant_key);
50
+		$this->client->set_test_mode(self::MODE_TEST === $config->mode);
51 51
 	}
52 52
 
53 53
 	/**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 		$result = $this->client->get_directory();
62 62
 
63
-		if ( $result ) {
63
+		if ($result) {
64 64
 			$groups[] = array(
65 65
 				'options' => $result,
66 66
 			);
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
 	 *
112 112
 	 * @param Payment $payment Payment.
113 113
 	 */
114
-	public function start( Payment $payment ) {
114
+	public function start(Payment $payment) {
115 115
 		// Order and purchase ID.
116 116
 		$order_id    = $payment->get_order_id();
117
-		$purchase_id = strval( empty( $order_id ) ? $payment->get_id() : $order_id );
117
+		$purchase_id = strval(empty($order_id) ? $payment->get_id() : $order_id);
118 118
 
119 119
 		// Maximum length for purchase ID is 16 characters, otherwise an error will occur:
120 120
 		// ideal_sisow_error - purchaseid too long (16).
121
-		$purchase_id = substr( $purchase_id, 0, 16 );
121
+		$purchase_id = substr($purchase_id, 0, 16);
122 122
 
123 123
 		// New transaction request.
124 124
 		$request = new TransactionRequest();
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
 			array(
128 128
 				'merchantid'   => $this->config->merchant_id,
129 129
 				'shopid'       => $this->config->shop_id,
130
-				'payment'      => Methods::transform( $payment->get_method(), $payment->get_method() ),
131
-				'purchaseid'   => substr( $purchase_id, 0, 16 ),
130
+				'payment'      => Methods::transform($payment->get_method(), $payment->get_method()),
131
+				'purchaseid'   => substr($purchase_id, 0, 16),
132 132
 				'entrancecode' => $payment->get_entrance_code(),
133 133
 				'amount'       => $payment->get_amount()->get_cents(),
134
-				'description'  => substr( $payment->get_description(), 0, 32 ),
135
-				'testmode'     => ( self::MODE_TEST === $this->config->mode ) ? 'true' : 'false',
134
+				'description'  => substr($payment->get_description(), 0, 32),
135
+				'testmode'     => (self::MODE_TEST === $this->config->mode) ? 'true' : 'false',
136 136
 				'returnurl'    => $payment->get_return_url(),
137 137
 				'cancelurl'    => $payment->get_return_url(),
138 138
 				'notifyurl'    => $payment->get_return_url(),
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
 		);
145 145
 
146 146
 		// Payment method.
147
-		$this->set_payment_method( null === $payment->get_method() ? PaymentMethods::IDEAL : $payment->get_method() );
147
+		$this->set_payment_method(null === $payment->get_method() ? PaymentMethods::IDEAL : $payment->get_method());
148 148
 
149 149
 		// Additional parameters for payment method.
150
-		if ( PaymentMethods::IDEALQR === $payment->get_method() ) {
151
-			$request->set_parameter( 'qrcode', 'true' );
150
+		if (PaymentMethods::IDEALQR === $payment->get_method()) {
151
+			$request->set_parameter('qrcode', 'true');
152 152
 		}
153 153
 
154 154
 		// Billing address.
155
-		if ( null !== $payment->get_billing_address() ) {
155
+		if (null !== $payment->get_billing_address()) {
156 156
 			$address = $payment->get_billing_address();
157 157
 
158
-			if ( null !== $address->get_name() ) {
158
+			if (null !== $address->get_name()) {
159 159
 				$name = $address->get_name();
160 160
 
161 161
 				$request->merge_parameters(
@@ -183,10 +183,10 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		// Shipping address.
186
-		if ( null !== $payment->get_shipping_address() ) {
186
+		if (null !== $payment->get_shipping_address()) {
187 187
 			$address = $payment->get_shipping_address();
188 188
 
189
-			if ( null !== $address->get_name() ) {
189
+			if (null !== $address->get_name()) {
190 190
 				$name = $address->get_name();
191 191
 
192 192
 				$request->merge_parameters(
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 		}
214 214
 
215 215
 		// Customer.
216
-		if ( null !== $payment->get_customer() ) {
216
+		if (null !== $payment->get_customer()) {
217 217
 			$customer = $payment->get_customer();
218 218
 
219 219
 			$request->merge_parameters(
@@ -223,22 +223,22 @@  discard block
 block discarded – undo
223 223
 				)
224 224
 			);
225 225
 
226
-			if ( null !== $customer->get_birth_date() ) {
227
-				$request->set_parameter( 'birth_date', $customer->get_birth_date()->format( 'ddmmYYYY' ) );
226
+			if (null !== $customer->get_birth_date()) {
227
+				$request->set_parameter('birth_date', $customer->get_birth_date()->format('ddmmYYYY'));
228 228
 			}
229 229
 		}
230 230
 
231 231
 		// Lines.
232
-		if ( null !== $payment->get_lines() ) {
232
+		if (null !== $payment->get_lines()) {
233 233
 			$lines = $payment->get_lines();
234 234
 
235 235
 			$x = 1;
236 236
 
237
-			foreach ( $lines as $line ) {
238
-				$net_price = ( null === $line->get_unit_price() ) ? null : $line->get_unit_price()->get_cents();
239
-				$total     = ( null === $line->get_total_amount() ) ? null : $line->get_total_amount()->get_cents();
240
-				$tax       = ( null === $line->get_tax_amount() ) ? null : $line->get_tax_amount()->get_cents();
241
-				$net_total = ( $total - $tax );
237
+			foreach ($lines as $line) {
238
+				$net_price = (null === $line->get_unit_price()) ? null : $line->get_unit_price()->get_cents();
239
+				$total     = (null === $line->get_total_amount()) ? null : $line->get_total_amount()->get_cents();
240
+				$tax       = (null === $line->get_tax_amount()) ? null : $line->get_tax_amount()->get_cents();
241
+				$net_total = ($total - $tax);
242 242
 
243 243
 				$request->merge_parameters(
244 244
 					array(
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
 		}
259 259
 
260 260
 		// Create transaction.
261
-		$result = $this->client->create_transaction( $request );
261
+		$result = $this->client->create_transaction($request);
262 262
 
263
-		if ( false !== $result ) {
264
-			$payment->set_transaction_id( $result->id );
265
-			$payment->set_action_url( $result->issuer_url );
263
+		if (false !== $result) {
264
+			$payment->set_transaction_id($result->id);
265
+			$payment->set_action_url($result->issuer_url);
266 266
 		} else {
267 267
 			$this->error = $this->client->get_error();
268 268
 		}
@@ -273,28 +273,28 @@  discard block
 block discarded – undo
273 273
 	 *
274 274
 	 * @param Payment $payment Payment.
275 275
 	 */
276
-	public function update_status( Payment $payment ) {
277
-		$result = $this->client->get_status( $payment->get_transaction_id() );
276
+	public function update_status(Payment $payment) {
277
+		$result = $this->client->get_status($payment->get_transaction_id());
278 278
 
279
-		if ( $result instanceof Error ) {
279
+		if ($result instanceof Error) {
280 280
 			$this->error = $this->client->get_error();
281 281
 
282 282
 			return;
283 283
 		}
284 284
 
285
-		if ( false === $result ) {
285
+		if (false === $result) {
286 286
 			$this->error = $this->client->get_error();
287 287
 
288 288
 			return;
289 289
 		}
290 290
 
291
-		if ( $result instanceof Transaction ) {
291
+		if ($result instanceof Transaction) {
292 292
 			$transaction = $result;
293 293
 
294
-			$payment->set_status( $transaction->status );
295
-			$payment->set_consumer_name( $transaction->consumer_name );
296
-			$payment->set_consumer_account_number( $transaction->consumer_account );
297
-			$payment->set_consumer_city( $transaction->consumer_city );
294
+			$payment->set_status($transaction->status);
295
+			$payment->set_consumer_name($transaction->consumer_name);
296
+			$payment->set_consumer_account_number($transaction->consumer_account);
297
+			$payment->set_consumer_city($transaction->consumer_city);
298 298
 		}
299 299
 	}
300 300
 }
Please login to merge, or discard this patch.