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

            return(CheckoutUrl.Replace("{CheckoutId}", response.CheckoutId));
        }
コード例 #2
0
        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>();
        }
コード例 #3
0
        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");
        }
コード例 #4
0
        public virtual string GetCheckoutRedirectUrl(DwollaCheckoutResponse response)
        {
            //this.ValidatorFactory.GetValidator<DwollaCheckoutResponse>()
            //    .ValidateAndThrow( response );

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