Пример #1
0
        public virtual FinalizeAuthorizationResponse FinalizeAuthorization(FinalizeAuthorizationRequest request)
        {
            Ensure.That(request, "request").IsNotNull();

            var httpRequest  = FinalizeAuthorizationHttpRequestFactory.Create(request);
            var httpResponse = Connection.Send(httpRequest);

            return(ResponseFactory.Create <FinalizeAuthorizationResponse>(httpResponse));
        }
Пример #2
0
        public void When_order_id_is_not_specified_It_should_render_relative_url_with_transaction_id_and_amount()
        {
            var request = new FinalizeAuthorizationRequest(TransactionId, TotalAmount);

            var httpRequest = SUT.Create(request);

            httpRequest.ShouldBe().PostAgainst(
                "/transactions/{0}/finalize/{1}",
                TransactionId,
                _totalAmountString);
        }
Пример #3
0
        public override ApiInfo CapturePayment(Order order, IDictionary <string, string> settings)
        {
            ApiInfo apiInfo = null;

            try {
                order.MustNotBeNull("order");
                settings.MustNotBeNull("settings");

                FinalizeAuthorizationRequest  request  = new FinalizeAuthorizationRequest(order.TransactionInformation.TransactionId, order.TransactionInformation.AmountAuthorized.Value);
                FinalizeAuthorizationResponse response = GetClient(settings).FinalizeAuthorization(request);

                apiInfo = new ApiInfo(response.TransactionId, PaymentState.Captured);
            } catch (Exception exp) {
                LoggingService.Instance.Error <Paynova>("Paynova(" + order.OrderNumber + ") - Capture payment", exp);
            }

            return(apiInfo);
        }
Пример #4
0
        public override ApiInfo CapturePayment( Order order, IDictionary<string, string> settings )
        {
            ApiInfo apiInfo = null;

              try {
            order.MustNotBeNull( "order" );
            settings.MustNotBeNull( "settings" );

            FinalizeAuthorizationRequest request = new FinalizeAuthorizationRequest( order.TransactionInformation.TransactionId, order.TransactionInformation.AmountAuthorized.Value );
            FinalizeAuthorizationResponse response = GetClient( settings ).FinalizeAuthorization( request );

            apiInfo = new ApiInfo( response.TransactionId, PaymentState.Captured );
              } catch ( Exception exp ) {
            LoggingService.Instance.Error<Paynova>( "Paynova(" + order.OrderNumber + ") - Capture payment", exp );
              }

              return apiInfo;
        }