-
Notifications
You must be signed in to change notification settings - Fork 82
Invoice Builder
Sina Soltani edited this page Jan 29, 2022
·
23 revisions
The Invoice Builder helps you to create and customize an invoice.
- Requesting a payment
- Using Auto Increment Tracking Number
- Using Auto Random Tracking Number
- Requesting a payment with a specific account
- Gateways Specific Functions
A simple payment request is something like:
var result = _onlinePayment.Request("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/")
.SetGateway("Mellat"); // Gateway name is NOT case sensitive. "Mellat" = "mellat" = "MELLAT"
// OR
.UseMellat();
});
The gateways names are:
- Mellat
- Melli
- Saman
- Parsian
- Pasargad
- IranKish
- Sepehr
- ZarinPal
- PayIr
- IdPay
- YekPay
- ParbadVirtual
- PayPing
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 randomly a tracking number which doesn't exist in Parbad Storage.
var result = _onlinePayment.Request(invoice =>
{
invoice.UseAccount("Account 1");
});
See also Adding multiple accounts