An Invoice represents a single payment request. Before initiating a payment, you must create an invoice and set its amount and metadata. You can use the detail method to attach arbitrary key-value pairs to the invoice.
Available Invoice Methods:
amount($amount): Sets the amount to be paid.getAmount(): Retrieves the invoice amount.detail($key, $value) or detail(['key' => 'value']): Adds metadata/details to the invoice.getDetails(): Retrieves all attached details.uuid(): Sets a unique identifier for the invoice.getUuid(): Retrieves the invoice UUID.transactionId($id): Sets the transaction ID.getTransactionId(): Retrieves the transaction ID.via($driver): Specifies the driver to be used for this invoice.getDriver(): Retrieves the selected driver.
use Shetabit//
use Shetabit\Multipay\Invoice;
// Create new invoice.
$invoice = new Invoice;
// Set invoice amount.
$invoice->amount(1000);
// Add invoice details (multiple syntax options available)
$invoice->detail(['detailName' => 'your detail goes here']);
$invoice->detail('detailName', 'your detail goes here');
$invoice->detail(['name1' => 'detail1', 'name2' => 'detail2']);
$invoice->detail('detailName1', 'detail1')->detail('detailName2', 'detail2');