예제 #1
0
        /// <summary>
        /// Check the [EPayRequest] with the given ApiKey and Token.
        /// </summary>
        /// <param name="apiKey"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public EPayRequestCheckResult CheckEPayRequest(string apiKey, string token)
        {
            var client = new HttpRestClient <string, EPayRequestCheckResult>(_httpClient, ENDPOINT_CheckEpayRequest);

            client.WithApiKey(apiKey);

            try {
                return(client.PostJson(token));
            }
            catch (Exception ex) {
                return(SeptaOperationResult.FailWith <EPayRequestCheckResult>(ex));
            }
        }
예제 #2
0
        /// <summary>
        /// Create an [EpayRequest] with the given model and return payment's token and Url.
        /// </summary>
        /// <param name="terminalId">Terminal access key</param>
        /// <param name="apiKey">Your [ApiKey]</param>
        /// <param name="request">[EPayRequest] model to create.</param>
        /// <returns>Payment Url and Payment Token.</returns>
        public EPayRequestResult CreateEpayRequest(Guid terminalId, string apiKey, EPayRequest request)
        {
            var client = new HttpRestClient <EPayRequest, EPayRequestResult>(_httpClient, ENDPOINT_NewEpayRequest);

            client.WithApiKey(apiKey);
            client.WithTerminalId(terminalId);

            try {
                return(client.PostJson(request));
            }
            catch (Exception ex) {
                return(SeptaOperationResult.FailWith <EPayRequestResult>(ex));
            }
        }
예제 #3
0
        /// <summary>
        /// Unblock amount of an [EPayRequest]
        /// </summary>
        /// <param name="apiKey">Divider User [ApiKey]</param>
        /// <param name="request">Divide Unblock amount request model</param>
        /// <returns></returns>
        public UnblockAmountResult UnblockAmount(string apiKey, UnblockAmountRequest request)
        {
            apiKey.CheckArgumentIsNull(nameof(apiKey));
            request.CheckArgumentIsNull(nameof(request));

            var client = new HttpRestClient <UnblockAmountRequest, UnblockAmountResult>
                             (_httpClient, ENDPOINT_UnblockAmount);

            client.WithApiKey(apiKey);

            try {
                var svcResult = client.PostJson(request);
                return(UnblockAmountResult.Ok(svcResult.UnblockedAmount));
            }
            catch (Exception ex) {
                return(SeptaOperationResult.FailWith <UnblockAmountResult>(ex));
            }
        }
예제 #4
0
        /// <summary>
        /// Create a Divided [EPayRequest] with the given model.
        /// </summary>
        /// <param name="terminalId">Terminal access key</param>
        /// <param name="apiKey">User's (Divider) [ApiKey]</param>
        /// <param name="request">[EPayRequest] model to create</param>
        /// <returns>Payment Token and Url</returns>
        public EPayRequestResult CreateDivideEPayRequest(Guid terminalId,
                                                         string apiKey,
                                                         DividedEPayRequest request)
        {
            request.CheckArgumentIsNull(nameof(request));
            apiKey.CheckArgumentIsNull(nameof(apiKey));

            var client = new HttpRestClient <DividedEPayRequest, EPayRequestResult>
                             (_httpClient, ENDPOINT_NewDivideEpayRequest);

            client.WithApiKey(apiKey);
            client.WithTerminalId(terminalId);

            try {
                return(client.PostJson(request));
            }
            catch (Exception ex) {
                return(SeptaOperationResult.FailWith <EPayRequestResult>(ex));
            }
        }