public void VerifyResult(int orderId, string SaleReferenceId) { try { BypassCertificateError(); MellatWebService.PaymentGatewayClient bp = new MellatWebService.PaymentGatewayClient(); var result = bp.bpVerifyRequestAsync( this.terminalId, this.userName, this.password, orderId, orderId, long.Parse(SaleReferenceId)).Result; string VerifyResult = result.Body.@return; if (VerifyResult != "0") { throw new Exception(TranslateMessage(VerifyResult)); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void SettleRequest(int orderId, string orderBankReference) { try { MellatWebService.PaymentGatewayClient bp = new MellatWebService.PaymentGatewayClient(); var result = bp.bpSettleRequestAsync( this.terminalId, this.userName, this.password, orderId, orderId, long.Parse(orderBankReference)).Result; string SettleResult = result.Body.@return; if (SettleResult != "0") { throw new Exception(TranslateMessage(SettleResult)); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public string PayRequest(int orderId, int orderPrice, string CallBackUrl) { try { BypassCertificateError(); MellatWebService.PaymentGatewayClient bp = new MellatWebService.PaymentGatewayClient(); var result = bp.bpPayRequestAsync( this.terminalId, this.userName, this.password, orderId, //order.id, orderPrice, //order.price * 10, DateTime.Now.ToString("yyyyMMdd"), DateTime.Now.ToString("HHMMSS"), "", CallBackUrl, 0).Result; ; string[] res = [email protected](','); if (res[0] == "0") { //refid return(res[1]); } else { return("-1"); //return "nok" + res[0]; } } catch (Exception ex) { return(ex.Message); } }