Esempio n. 1
0
        public PaymentResource CreateLocalPayment(string merchantAccountId, LocalPayment localPayment)
        {
            ValidateParameters(merchantAccountId, localPayment);

            var clientConfiguration = clientTokenGateway.GetClientConfiguration(merchantAccountId);
            var localPaymentRequest = RequestFactory.CreateLocalPaymentRequest(localPayment, clientConfiguration);

            var response = webClient.Post <PaymentResourceResponse, LocalPaymentRequest>($"{clientConfiguration.ClientApiUrl}{paymentCreateEnpoint}", localPaymentRequest);

            return(response.PaymentResource);
        }
Esempio n. 2
0
        public async Task <PaymentResource> CreateLocalPaymentAsync(string merchantAccountId, LocalPayment localPayment)
        {
            ValidateParameters(merchantAccountId, localPayment);

            var clientConfiguration = await clientTokenGateway.GetClientConfigurationAsync(merchantAccountId)
                                      .ConfigureAwait(false);

            var localPaymentRequest = RequestFactory.CreateLocalPaymentRequest(localPayment, clientConfiguration);
            var response            = await httpClient.PostAsync <PaymentResourceResponse, LocalPaymentRequest>($"{clientConfiguration.ClientApiUrl}{paymentCreateEnpoint}", localPaymentRequest)
                                      .ConfigureAwait(false);

            return(response.PaymentResource);
        }