public ActionResult BinServiceV1(string binNumber) { var model = new BINServicesResultModel(); BinV1Request request = new BinV1Request(); request.BIN = binNumber; request.MERCHANT = "OPU_TEST"; request.TIMESTAMP = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; Options options = new Options(); options.Url = "https://secure.payu.com.tr/api/card-info/v1/"; options.SecretKey = "SECRET_KEY"; model.Response = BinV1Request.Execute(request, options); //api çağrısının başlatıldığı kısmı temsil eder. return(View(model)); }
public ActionResult BinServiceV2(string nameSurname, string cardNumber, string cvc, string month, string year) { BINServicesResultModel model = new BINServicesResultModel(); BinV2Request request = new BinV2Request(); request.MERCHANT = "OPU_TEST"; request.DATETIME = DateTime.UtcNow.ToString("yyyy-MM-ddTHH\\:mm\\:ss+00:00"); request.EXTRAINFO = "true"; request.CC_CVV = cvc; request.CC_OWNER = nameSurname; request.EXP_YEAR = year; request.EXP_MONTH = month; request.CC_NUMBER = cardNumber; Options options = new Options(); options.Url = "https://secure.payu.com.tr/api/card-info/v2/"; options.SecretKey = "SECRET_KEY"; model.Response = BinV2Request.Execute(request, options); return(View(model)); }