Skip to content
This repository was archived by the owner on Jan 10, 2022. It is now read-only.

Commit 96d8476

Browse files
committed
Handle all exceptions during payment start.
1 parent 37858ae commit 96d8476

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Gateways/Gateway.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function submit() {
215215
// @todo Build payment inside try/catch block.
216216

217217
$payment = Plugin::start_payment( $payment );
218-
} catch ( \Pronamic\WordPress\Pay\PayException $e ) {
218+
} catch ( \Exception $e ) {
219219
$error = $e;
220220
}
221221

@@ -228,8 +228,8 @@ public function submit() {
228228
$payment->set_meta( 'wpsc_session_id', $this->cart_data['session_id'] );
229229
}
230230

231-
if ( $error instanceof \Pronamic\WordPress\Pay\PayException ) {
232-
$e->render();
231+
if ( $error instanceof \Exception ) {
232+
Plugin::render_exception( $error );
233233

234234
return;
235235
}

0 commit comments

Comments
 (0)