public function create(
        string $collectionId,
        ?string $email,
        ?string $mobile,
        string $name,
        $amount,
        $callbackUrl,
        string $description,
        array $optional = []
    ): Response {
        if (empty($email) && empty($mobile)) {
            throw new InvalidArgumentException('Either $email or $mobile should be present');
        }

        $body = \array_merge(
            \compact('email', 'mobile', 'name', 'amount', 'description'), $optional
        );

        $body['collection_id'] = $collectionId;

        $body = $this->parseRedirectAndCallbackUrlFromRequest($body, $callbackUrl);

        list($headers, $stream) = $this->prepareMultipartRequestPayloads([], $body);

        return $this->stream('POST', 'bills', $headers, $stream);
    }
public function create(
        string $collectionId,
        ?string $email,
        ?string $mobile,
        string $name,
        $amount,
        $callbackUrl,
        string $description,
        array $optional = []
    ): Response {
        if (empty($email) && empty($mobile)) {
            throw new InvalidArgumentException('Either $email or $mobile should be present');
        }

        $body = \array_merge(
            \compact('email', 'mobile', 'name', 'amount', 'description'), $optional
        );

        $body['collection_id'] = $collectionId;

        $body = $this->parseRedirectAndCallbackUrlFromRequest($body, $callbackUrl);

        list($headers, $stream) = $this->prepareMultipartRequestPayloads([], $body);

        return $this->stream('POST', 'bills', $headers, $stream);
    }
public function create ( string $ collectionId , ? string $ email , ? string $ mobile , string $ name , $ amount , $ callbackUrl , string $ description , array $ optional = [ ] ) : Response { if ( empty ( $ email ) && empty ( $ mobile ) ) { throw new InvalidArgumentException ( 'Either $email or $mobile should be present' ) ; } $ body = \ array_merge ( \ compact ( 'email' , 'mobile' , 'name' , 'amount' , 'description' ) , $ optional ) ; $ body [ 'collection_id' ] = $ collectionId ; $ body = $ this -> parseRedirectAndCallbackUrlFromRequest ( $ body , $ callbackUrl ) ; list ( $ headers , $ stream ) = $ this -> prepareMultipartRequestPayloads ( [ ] , $ body ) ; return $ this -> stream ( 'POST' , 'bills' , $ headers , $ stream ) ; }
Create a new bill.

@param  string  $collectionId
@param  string|null  $email
@param  string|null  $mobile
@param  string  $name
@param  \Money\Money|\Duit\MYR|int  $amount
@param  array|string  $callbackUrl
@param  string  $description
@param  array  $optional

@throws \InvalidArgumentException

@return \Laravie\Codex\Contracts\Response
Create a new bill .