شما باید یه کنترلر داشته باشین که بتونین اطلاعاتتون رو در جداولتون ذخیره کنید.در اخر که میخایین اطلاعاتتون رو پاس بدین از کد زیر استفاده کنین:
// redirect to ...
var zarinpal = new ZarinPal.PaymentGatewayImplementationServicePortTy peClient();
string result = "";
int code = zarinpal.PaymentRequest("---merchant id khodetun-", Convert.ToInt32(factor.SumPrice), factor.Description, factor.Email, factor.Mobile, "http://" + Request.Url.Authority + "/Home/Verify?Factor=" + factorId.ToString().Encrypt().UrlEncode(), out result);
if (code == 100)
{
return Redirect("https://www.zarinpal.com/pg/StartPay/" + result);
}
else
{
ViewBag.Message = "خطا هنگام اتصال به درگاه بانکی";
}
و بعد هم یه کنترلر لازم دارین که بهش میگن verify:
public ActionResult Verify(string Factor, string Status, string Authority)
{
if (string.IsNullOrEmpty(Status) == false && string.IsNullOrEmpty(Authority) == false && string.IsNullOrEmpty(Factor) == false && Status.ToLower() == "ok")
{
FactorRepository blFactor = new FactorRepository();
var fact = blFactor.Find(Convert.ToInt32(Factor.Decrypt()));
long refId = 0;
System.Net.ServicePointManager.Expect100Continue = false;
ZarinPal.PaymentGatewayImplementationServicePortTy peClient zarinPal = new ZarinPal.PaymentGatewayImplementationServicePortTy peClient();
int _status = zarinPal.PaymentVerification("merchant id", Authority, Convert.ToInt32(fact.SumPrice), out refId);
switch (_status)
{
case -1:
ViewBag.Message = "اطلاعات ارسال شده ناقص است.";
break;
case -11:
ViewBag.Message = "درخواست مورد نظر یافت نشد.";
break;
case -22:
ViewBag.Message = "تراکنش ناموفق می باشد.";
break;
case -33:
ViewBag.Message = "مبلغ تراکنش با مبلغ پرداخت شده مطابقت ندارد.";
break;
case 100:
case 101:
//Success
fact.IsFinish = true;
fact.FllowCode = refId.ToString();
blFactor.Update(fact);
ViewBag.Message2 = "تراکنش با موفقیت انجام شد. کد رهگیری : " + refId.ToString();
break;
}
}
else
{
ViewBag.Message = "مقدار ورودی نا معتبر است";
}
return View();
}
تو خود سایت زرین هم هست