Dwolla.Gateway.DwollaServerCheckoutApi.GetCheckoutRedirectUrl C# (CSharp) Méthode

GetCheckoutRedirectUrl() public méthode

public GetCheckoutRedirectUrl ( DwollaCheckoutResponse response ) : string
response DwollaCheckoutResponse
Résultat string
        public virtual string GetCheckoutRedirectUrl(DwollaCheckoutResponse response)
        {
            //this.ValidatorFactory.GetValidator<DwollaCheckoutResponse>()
            //    .ValidateAndThrow( response );

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

Usage Example

        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");
        }