PayPal\Api\Invoice::create PHP Method

create() public method

Creates an invoice. Include invoice details including merchant information in the request.
public create ( ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Invoice
$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 Invoice
    public function create($apiContext = null, $restCall = null)
    {
        $payLoad = $this->toJSON();
        $json = self::executeCall("/v1/invoicing/invoices", "POST", $payLoad, null, $apiContext, $restCall);
        $this->fromJson($json);
        return $this;
    }

Usage Example

 public function testCreate()
 {
     $request = $this->operation['request']['body'];
     $obj = new Invoice($request);
     $result = $obj->create(null, $this->mockPayPalRestCall);
     $this->assertNotNull($result);
     self::$obj = $result;
     return $result;
 }
All Usage Examples Of PayPal\Api\Invoice::create