mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Add webhook simulation
This commit is contained in:
parent
0268524261
commit
ea2f728cd8
14 changed files with 896 additions and 20 deletions
|
@ -43,6 +43,27 @@ return array(
|
|||
),
|
||||
);
|
||||
|
||||
$is_registered = $container->get( 'webhook.is-registered' );
|
||||
if ( $is_registered ) {
|
||||
$status_page_fields = array_merge(
|
||||
$status_page_fields,
|
||||
array(
|
||||
'webhooks_simulate' => array(
|
||||
'title' => __( 'Webhook simulation', 'woocommerce-paypal-payments' ),
|
||||
'type' => 'ppcp-text',
|
||||
'text' => '<button type="button" class="button ppcp-webhooks-simulate">' . esc_html__( 'Simulate', 'woocommerce-paypal-payments' ) . '</button>',
|
||||
'screens' => array(
|
||||
State::STATE_PROGRESSIVE,
|
||||
State::STATE_ONBOARDED,
|
||||
),
|
||||
'requirements' => array(),
|
||||
'gateway' => WebhooksStatusPage::ID,
|
||||
'description' => __( 'Click to request a sample webhook payload from PayPal, allowing to check that your server can successfully receive webhooks.', 'woocommerce-paypal-payments' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return array_merge( $fields, $status_page_fields );
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue