Esempio n. 1
0
        private RestRequest buildAuthorizeRequest(
            string amount,
            string currency,
            MobilePayOnlineInfo mpoInfo,
            string pares,
            AuthorizationRequestOptions opts)
        {
            var restRequest = buildRestRequest("authorizations/");

            restRequest.AddParameter("amount", amount);
            restRequest.AddParameter("currency", currency);
            restRequest.AddParameters(mpoInfo.GetArgs());

            if (!string.IsNullOrWhiteSpace(pares))
            {
                restRequest.AddParameter("mobilepayonline[pares]", pares);
            }

            if (opts != null)
            {
                restRequest.AddParameters(opts.GetArgs());
            }

            return(restRequest);
        }
Esempio n. 2
0
        /*
         * AUTHORIZATION IMPLEMENTATION
         */

        // Build an authorization request using a credit card.
        private RestRequest buildAuthorizeRequest(
            string amount,
            string currency,
            Card cc,
            string pares,
            AuthorizationRequestOptions opts)
        {
            var restRequest = buildRestRequest("authorizations/");

            restRequest.AddParameter("amount", amount);
            restRequest.AddParameter("currency", currency);
            restRequest.AddParameters(cc.GetArgs());

            if (!string.IsNullOrWhiteSpace(pares))
            {
                restRequest.AddParameter("card[pares]", pares);
            }

            if (opts != null)
            {
                restRequest.AddParameters(opts.GetArgs());
            }

            return(restRequest);
        }
Esempio n. 3
0
        private RestRequest buildAuthorizeRequest(
            string amount,
            string currency,
            ApplePayInfo apInfo,
            AuthorizationRequestOptions opts)
        {
            var restRequest = buildRestRequest("authorizations/");

            restRequest.AddParameter("amount", amount);
            restRequest.AddParameter("currency", currency);
            restRequest.AddParameters(apInfo.GetArgs());

            if (opts != null)
            {
                restRequest.AddParameters(opts.GetArgs());
            }

            return(restRequest);
        }