PayPal\Api\Invoice::remind PHP Method

remind() public method

Sends a reminder about a specific invoice, by ID, to a recipient. Include a notification object that defines the reminder subject and other details in the JSON request body.
public remind ( Notification $notification, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : boolean
$notification Notification
$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 boolean
    public function remind($notification, $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($this->getId(), "Id");
        ArgumentValidator::validate($notification, 'notification');
        $payLoad = $notification->toJSON();
        self::executeCall("/v1/invoicing/invoices/{$this->getId()}/remind", "POST", $payLoad, null, $apiContext, $restCall);
        return true;
    }

Usage Example

 /**
  * @dataProvider mockProvider
  * @param Invoice $obj
  */
 public function testRemind($obj, $mockApiContext)
 {
     $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(true));
     $notification = NotificationTest::getObject();
     $result = $obj->remind($notification, $mockApiContext, $mockPayPalRestCall);
     $this->assertNotNull($result);
 }