Example #1
0
        public virtual bool VerifyCallbackAuthenticity(DwollaCallback receivedCallback)
        {
            //this.ValidatorFactory.GetValidator<DwollaServerCheckoutApi>()
            //    .ValidateAndThrow( this );

            return(DwollaSignatureUtil.VerifyCallbackSignature(this.AppSecret, receivedCallback.Signature, receivedCallback.CheckoutId, receivedCallback.Amount));
        }
        public void server_checkout_api_can_verify_callback()
        {
            //appSecret = "test"
            var c = new DwollaCallback {
                Amount = 3.25m,
                CheckoutId = "C3D4DC4F-5074-44CA-8639-B679D0A70803",
                Signature = "7f42ba58ff0d20486fdc2634745e8e7c92cb6321"
            };

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

            api.VerifyCallbackAuthenticity(c)
                .ShouldBeTrue();
        }
        public virtual bool VerifyCallbackAuthenticity(DwollaCallback receivedCallback)
        {
            //this.ValidatorFactory.GetValidator<DwollaServerCheckoutApi>()
            //    .ValidateAndThrow( this );

            return DwollaSignatureUtil.VerifyCallbackSignature(this.AppSecret, receivedCallback.Signature, receivedCallback.CheckoutId, receivedCallback.Amount);
        }