PayPal\Api\WebhookEvent::resend PHP Method

resend() public method

Resends a webhook event notification, by ID. Any pending notifications are not resent.
public resend ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : WebhookEvent
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return WebhookEvent
    public function resend($apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($this->getId(), "Id");
        $payLoad = "";
        $json = self::executeCall("/v1/notifications/webhooks-events/{$this->getId()}/resend", "POST", $payLoad, null, $apiContext, $restCall);
        $this->fromJson($json);
        return $this;
    }

Usage Example

 /**
  * @dataProvider mockProvider
  * @param WebhookEvent $obj
  */
 public function testResend($obj, $mockApiContext)
 {
     $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson()));
     $result = $obj->resend($mockApiContext, $mockPayPalRestCall);
     $this->assertNotNull($result);
 }