mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-10 18:26:47 +08:00
catch exception
This commit is contained in:
parent
85944d392a
commit
3a4b942663
1 changed files with 60 additions and 43 deletions
|
@ -5,6 +5,7 @@ namespace Inpsyde\PayPalCommerce\Onboarding\Render;
|
|||
|
||||
|
||||
use Inpsyde\PayPalCommerce\ApiClient\Endpoint\PartnerReferrals;
|
||||
use Inpsyde\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
|
||||
class OnboardingRenderer
|
||||
{
|
||||
|
@ -16,6 +17,7 @@ class OnboardingRenderer
|
|||
}
|
||||
|
||||
public function render() {
|
||||
try {
|
||||
$url = add_query_arg(
|
||||
[
|
||||
'displayMode' => 'minibrowser',
|
||||
|
@ -59,5 +61,20 @@ class OnboardingRenderer
|
|||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} catch(RuntimeException $exception) {
|
||||
?>
|
||||
<tr valign="top">
|
||||
<th scope="row" class="titledesc">
|
||||
<?php echo esc_html_e('Connect to PayPal', 'woocommerce-paypal-commerce-gateway'); ?>
|
||||
</th>
|
||||
<td>
|
||||
<?php echo esc_html_e(
|
||||
'We could not properly connect to PayPal. Please reload the page to continue',
|
||||
'woocommerce-paypal-commerce-gateway'
|
||||
); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue