Example #1
0
        public virtual string GetCheckoutRedirectUrl(DwollaCheckoutResponse response)
        {
            //this.ValidatorFactory.GetValidator<DwollaCheckoutResponse>()
            //    .ValidateAndThrow( response );

            return(CheckoutUrl.Replace("{CheckoutId}", response.CheckoutId));
        }
        public void getting_redirect_url_from_failed_checkout_response_throws_exception()
        {
            var r = new DwollaCheckoutResponse {
                Result = DwollaCheckoutResponseResult.Failure,
                Message = "invalid total."
            };

            var api = new DwollaServerCheckoutApi("test", "test");
            //new Action( () => api.GetCheckoutRedirectUrl( r ) )
            //    .ShouldThrow<ValidationException>();
        }
        public void server_checkout_api_can_get_redirect_url_on_successful_response()
        {
            var r = new DwollaCheckoutResponse {
                Result = DwollaCheckoutResponseResult.Success,
                CheckoutId = "C3D4DC4F-5074-44CA-8639-B679D0A70803",
            };

            var api = new DwollaServerCheckoutApi("test", "test");

            var redirectUrl = api.GetCheckoutRedirectUrl(r);

            redirectUrl.ShouldEqual("https://www.dwolla.com/payment/checkout/C3D4DC4F-5074-44CA-8639-B679D0A70803");
        }
        public virtual string GetCheckoutRedirectUrl(DwollaCheckoutResponse response)
        {
            //this.ValidatorFactory.GetValidator<DwollaCheckoutResponse>()
            //    .ValidateAndThrow( response );

            return CheckoutUrl.Replace("{CheckoutId}", response.CheckoutId);
        }