string _name = "<Customer Name>";
string _email = "<Customer Email>";
string _mono = "<Customer Mobile Number>";
string _orderId = "ORD" + (new Random()).Next(111111111, 999999999).ToString(); // Order ID must be between 10 To 30 Characters and unique for all transactions
string _productName = "<Name of the product>";
//Your return success page url
string _successUrl = "<Success page url>"; //http://www.xyz.com/success
//Your return failed page url
string _failureUrl = "<Failure Url>"; //http://www.xyz.com/failed
PaykunPayment _payment = new Paykun.PaykunPayment("<Merhcant Id>", "<Access Token>", "<API Secret>", _isLive: true); // Change _isLive to false for sandbox mode, While using sandbox mode you will need to provide credintials for sandbox and not of live environment
_payment.InitOrder(_orderId, _amount, _productName, _successUrl, _failureUrl);
_payment.AddCustomer(_name, _email, _mono);
//Add here your shipping detail (Optional)
//If you want to ignore the shipping or billing address, just make all the params an empty string like
//_payment.AddShippingAddress("", "", "", "", "");
_payment.AddShippingAddress("<address>", "<country>", "<state>", "<city>", "<pincode>");
//Add here your billing detail (Optional)
//If you want to ignore the shipping or billing address, just make all the params an empty string like
//_payment.AddBillingAddress("", "", "", "", "");
_payment.AddBillingAddress("<address>", "<country>", "<state>", "<city>", "<pincode>");
//You can set your custom fields here. for ex. you can set order id for which this transaction is initiated
//You will get the same order id when you will call the method _payment.GetTransactionStatus(_reqId)
_payment.SetCustomField(_orderId, "", "", "", "");
* if you want to render your custom form then use _payment.getRequestData(), this will return you with all the require params for the request.
* create form from the 'PkCustomForm' object and make it auto submit or as per your requirements
//PkCustomForm requestData = _payment.getRequestData();
/*To render the direct form*/
string _res = _payment.Submit();
//_res => use this html to render default payment form. if you want custom form then
// uncomment this line of code and comment out submit method
//PkCustomForm requestData = _payment.getRequestData(); ==> For custom form