public RPGClient(string merchantKey, string serviceUri, HttpMessageHandler httpMessageHandler) { this.client = new HttpClient(httpMessageHandler); this.client.DefaultRequestHeaders.Accept.Clear(); this.client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); this.client.BaseAddress = new Uri(serviceUri); this.client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes(merchantKey + ":"))); this.tokenSingle = new TokenSingleAPI(this.client); this.tokenMulti = new TokenMultiAPI(this.client); this.payment = new PaymentAPI(this.client); }
public RPGClient(IPaymentAPI paymentApi, ITokenSingleAPI tokenSingleApi, ITokenMultiAPI tokenMultiApi) { this.payment = paymentApi; this.tokenSingle = tokenSingleApi; this.tokenMulti = tokenMultiApi; }