public override async Task <RaveResponse <ValidateAccountChargeResponse> > ValidateCharge(IValidateParams validateChargeParams) { var requestBody = new StringContent(JsonConvert.SerializeObject(validateChargeParams), Encoding.UTF8, "application/json"); var requestMessage = new HttpRequestMessage(HttpMethod.Post, Endpoints.ValidateCharge) { Content = requestBody }; var result = await RaveApiRequest.Request(requestMessage); return(result); }
public async Task <RaveResponse <ExchangeRateRes> > GetExchangeRate(CurrencyType originalCurrency, CurrencyType destinationCurrency, decimal amount) { var payload = new { SECKEY = Config.SecretKey, origin_currency = Util.GetCurrencyStr(originalCurrency), destination_currency = Util.GetCurrencyStr(destinationCurrency), amount }; var requestBody = new HttpRequestMessage(HttpMethod.Post, Endpoints.ExchangeRates) { Content = new StringContent(JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json") }; return(await RaveApiRequest.Request(requestBody)); }
//Cahrge error..check later public override async Task <RaveResponse <ResponseData> > Charge(IParams Params, bool isRecurring = false) { var encryptedKey = PayDataEncrypt.GetEncryptionKey(Config.SecretKey); var encryptedData = PayDataEncrypt.EncryptData(encryptedKey, JsonConvert.SerializeObject(Params)); var content = new StringContent(JsonConvert.SerializeObject(new { PBFPubKey = Params.PbfPubKey, client = encryptedData, alg = "3DES-24" }), Encoding.UTF8, "application/json"); var requestMessage = new HttpRequestMessage(HttpMethod.Post, Endpoints.CardCharge) { Content = content }; var result = await RaveApiRequest.Request(requestMessage); // try to get the auth mode used. expected values are: "PIN","VBVSECURECODE", "AVS_VBVSECURECODE" return(result); }