Add webhook simulation

This commit is contained in:
Alex P 2021-09-22 17:13:38 +03:00
parent 0268524261
commit ea2f728cd8
14 changed files with 896 additions and 20 deletions

View file

@ -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 );
},
);