wompi_web_checkout 3.0.0
wompi_web_checkout: ^3.0.0 copied to clipboard
A pure Dart client for Wompi's Web Checkout. Build integrity-signed checkout URLs and accept payments in your Dart or Flutter apps.
3.0.0 #
Adds a way to keep the integrity secret out of the app, which is what Wompi recommends.
Breaking changes #
- The unnamed
WompiWebCheckout(...)constructor was removed: a client is now built withWompiWebCheckout.fromServerorWompiWebCheckout.fromClient. ReplacingWompiWebCheckout(publicKey: ..., integrityKey: ...)withWompiWebCheckout.fromClient(publicKey: ..., integrityKey: ...)keeps the previous behavior unchanged.
Added #
WompiWebCheckout.fromServer, which takes theintegritySignaturecomputed by the merchant's backend, so the integrity secret never reaches the client. The signature is validated as a SHA-256 digest (64 hexadecimal characters) and reported through theintegritySignaturefield ofWompiValidationException.WompiWebCheckout.fromClient, the explicit name for the previous behavior: the app holds the secret and hashes locally.WompiWebCheckout.signsLocally,trueonly for clients built withfromClient.
Fixed #
- Surrounding whitespace is dropped from the public key, the integrity
key and the integrity signature. A trailing newline — from an
.envfile, an HTTP body or a dashboard copy-paste — used to reach the checkout URL percent-encoded, and to be hashed into the signature, producing a URL Wompi rejects for no visible reason. A value that is only whitespace is still reported as empty.
2.0.0 #
Full overhaul: leaner API, richer validation, and Panama support.
Breaking changes #
- Renamed:
WompiWebCheckoutData→WompiCheckoutData,WompiWebCheckoutCustomerInfo→WompiCustomerData(fieldcustomerInfo→customerData),WompiWebCheckoutShippingAddressInfo→WompiShippingAddress(fieldshippingAddressInfo→shippingAddress),WompiLegalId→WompiLegalIdType. - Removed
WompiCheckoutData.currency: it is derived fromWompiWebCheckout.country. - The three
WompiInvalid*Exceptiontypes were replaced by a singleWompiValidationExceptionthat aggregates every error inerrors. getCheckoutUriis now synchronous.WompiWebCheckout.integrityKeyis no longer publicly readable.expirationTimeis validated bygetCheckoutUri, not by the constructor.- Stricter
referenceand phone number validation, per the docs. - Requires Dart SDK >= 3.0.0; dropped the
email_validatordependency.
Added #
- Panama support through the new
WompiCountryenum, which selects the checkout host, the currency (WompiCurrency), the acceptedlegalIdTypesand which optional parameters may be sent. - Parameters missing from 1.x:
WompiTaxes,phoneNumberPrefix,collectShipping,collectCustomerLegalId,WompiLanguage/defaultLanguageandWompiPaymentMethodReferences. WompiEnvironment, derived from the public key prefix, plus key format validation and a console warning when production credentials run in a debug build.- Cross-field validation (
phoneNumber/phoneNumberPrefix,legalId/legalIdType). clearon every model, to remove optional fields thatcopyWithcannot.- Value equality on all models.
Fixed #
expirationTimeis normalized to UTC milliseconds, the format Wompi documents —DateTime.now()would otherwise emit microseconds in both the URL and the signature.WompiLegalIdType.fromCodepreviously threw for every valid code; a nullabletryFromCodewas added.WompiValidationExceptionrejects an empty error list with anArgumentErrorinstead of anassert.- The production-credentials warning no longer fires in Flutter profile builds.
1.1.0 #
- Implemented customer info validation
- Implemented shipping address info validation
- Added validation utilities for email and phone number
- Added tests
1.0.0+1 #
- Fixed pub.dev analysis issues
1.0.0 #
- Initial release