-
Notifications
You must be signed in to change notification settings - Fork 86
Invoice Builder
Sina Soltani edited this page May 30, 2019
·
23 revisions
Invoice Builder helps you to create and customize an invoice.
- Requesting a payment
- Using Auto Increment Tracking Number
- Using Auto Random Tracking Number
- Using an specific account for payment
A simple payment request is something like:
var result = _onlinePayment.Request(Gateways.Mellat, 123, 25000, "http://www.mywebsite.com/foo/bar/");
You can make the same request by using the Invoice Builder like so:
var result = _onlinePayment.Request(invoice =>
{
invoice
.SetTrackingNumber(123)
.SetAmount(25000)
.SetCallbackUrl("http://www.mywebsite.com/foo/bar/")
.UseGateway(Gateways.Mellat);
});
var result = _onlinePayment.Request(invoice =>
{
invoice
.UseAutoIncrementTrackingNumber()
});
It generates automatically a new tracking number which is one unit greater than the latest number.
var result = _onlinePayment.Request(invoice =>
{
invoice
.UseAutoRandomTrackingNumber()
});
It generates automatically a new tracking number which is an Int64 number.
var result = _onlinePayment.Request(invoice =>
{
invoice
.UseAccount("Account 1");
});