Exemplo n.º 1
0
        public override async Task <RaveApiResponse <CardResponseData> > Charge(IChargeParams chargeParams, bool isRecurring = false)
        {
            var encryptedKey  = PaymentDataEncryption.GetEncryptionKey(Config.SecretKey);
            var encryptedData = PaymentDataEncryption.EncryptData(encryptedKey, JsonConvert.SerializeObject(chargeParams));

            var content = new StringContent(JsonConvert.SerializeObject(new { PBFPubKey = chargeParams.PbfPubKey, client = encryptedData, alg = "3DES-24" }), Encoding.UTF8, "application/json");

            var requestMessage = new HttpRequestMessage(HttpMethod.Post, Enpoints.CardCharge)
            {
                Content = content
            };
            var result = await ApiRequest.Request(requestMessage);

            // try to get the auth mode used. expected values are: "PIN","VBVSECURECODE", "AVS_VBVSECURECODE"
            return(result);
        }
Exemplo n.º 2
0
        public override async Task <RaveApiResponse <TokenChargeResponseData> > Charge(IChargeParams chargeParams, bool isRecurring = false)
        {
            var content = new StringContent(JsonConvert.SerializeObject(chargeParams), Encoding.UTF8, "application/json");

            var requestMessage = new HttpRequestMessage(HttpMethod.Post, Enpoints.TokenizeCharge)
            {
                Content = content
            };
            var result = await ApiRequest.Request(requestMessage);

            return(result);
        }
Exemplo n.º 3
0
 public abstract Task <T1> Charge(IChargeParams chargeParams, bool isRecurring = false);