digetpay_plugin 0.5.0
digetpay_plugin: ^0.5.0 copied to clipboard
Pure-Dart DigetPay payment plugin: hosted (PCI-safe) checkout via WebView plus transaction management over the DigetPay REST API.
0.5.0 - 2026-07-20 #
- New: several operations exist on two backend endpoints — a direct/S2S
one and a hosted-checkout one — but the SDK previously wrapped only one of
each and silently chose which. Both are now reachable, under names that make
the target obvious at the call site:
refundS2s()(POST /payment/s2s/refund) andrefundCheckout()(POST /payment/refund);recurringS2s()(POST /payment/s2s/recurring) andrecurringCheckout()(POST /payment/checkout/recurring). Pick the variant matching how the payment was originally taken —sale()charges refund on the S2S rail,cardPay()charges on the checkout rail. - Compatibility:
refund()andrecurring()are unchanged and not deprecated. They keep working exactly as before, now as shorthand forrefundCheckout()/recurringCheckout()— the endpoints they have always called. Existing code needs no changes; prefer the explicit names in new code. - New:
payCheckoutSession({sessionId, request})pays an existing checkout session with card details you collected yourself (POST /payment/checkout/{sessionId}/pay), enrolling the card into a recurring plan. Build the body with the newCheckoutPayRequest.scheduled(...)(fixed cadence via the newCheckoutBillingFrequencyenum, over N installments) orCheckoutPayRequest.unscheduled(...)(charge now, charge again later viachargeSubscription()). Likesale(), this carries raw card data and widens PCI scope — the response's 3-D Secure page is surfaced through the existingDigetPayResponse.needs3ds/.htmlpair. - New:
getStatusCheckout(sessionId)wrapsGET /payment/checkout/status?sessionId=, returning aPageDto<Transaction>. This is a sibling of, not a replacement for,getCheckoutStatus(), which hits/sdk/statusand resolves a singleTransaction— the two endpoints answer with genuinely different shapes. - Docs: README gained a "Paying a checkout session" section (with the PCI
callout and the
getStatusCheckout()vsgetCheckoutStatus()distinction), reworked "Money movement" and "Recurring charges" sections showing both variants, and an updated capability table. The install snippet, which was still pinned at^0.4.4, now tracks the current version. - Example app: Money Movement now exposes each endpoint as its own button — Refund (S2S), Refund (Checkout), Recurring (S2S), Recurring (Checkout) — alongside Capture and Void, with the "Last action" line naming the variant that ran.
- Example app: new Checkout Pay screen demoing
payCheckoutSession()with a scheduled/unscheduled mode switch, and Transaction Lookup gained a "Look up checkout status by session id" action wired togetStatusCheckout(). - Example app / docs: Money Movement gained an optional "Order description"
field that populates
RecurringRequest.order, and the README's recurring sample now shows the nestedorderobject. Behaviour is unchanged —orderwas already optional and serialized verbatim when supplied — but it now has explicit test coverage for both the present and omitted cases.
0.4.5 - 2026-07-19 #
- Change:
getTransactionHistorypagination is now 0-based — the first page ispageNumber: 0. This reverses the 1-based note from 0.4.2 to match the backend's current paging. Doc comments onTransactionFilter.pageNumberandDigetPaySdk.getTransactionHistory(), plus the README example, were updated accordingly; no method signatures or runtime behaviour changed (the SDK has always forwardedpageNumberverbatim). - Example app: Transaction History now starts at page
0; its pager labels read "Page 1 of N" (showingpageNumber + 1) while requesting 0-based pages, and the Next button correctly disables on the final page instead of overrunning by one. - Example app: the S2S Card Sale screen gained an "Initialize recurring"
toggle that sends
recurringInit: "Y"/"N"(mirroring the existing "Authorization only" switch), so you can demo saving a reusable token from a direct sale. - Example app: refreshed the demo UI with the DigetPay brand — a shared
navy/orange light theme (
AppTheme, built fromAppColors), the logo (assets/svg/logo.svg, rendered viaflutter_svg) on the splash, onboarding, and home header, the capability list grouped into sections with a restyled tile, status pills in Transaction History, and brand colour tokens replacing the previous ad-hocColors.green/Colors.redshades.
0.4.4 - 2026-07-09 #
- New:
CheckoutPagenow acceptshtmlas an alternative tocheckoutUrl— loads raw HTML directly (WebViewController.loadHtmlString) instead of navigating to a URL, while still watching for the same terminalsuccessUrl/failureUrlnavigation. Exactly one ofcheckoutUrl/htmlmust be provided (asserted). This closes a real gap:sale()'s response carries a 3-D Secure collector page (DigetPayResponse.html, whenneeds3dsistrue) that has to be loaded and auto-submitted in a WebView before the payment can complete — previously there was no supported way to present it, so asale()requiring 3DS (most cards) never actually finished.cardPay()'s existingcheckoutUrlusage is unaffected. - Example app: the S2S Card Sale screen now presents the 3DS collector
page via
CheckoutPage(html: ...)whenresponse.needs3ds, then best-effort confirms the outcome withgetTransactionById(response.paymentId)(falling back to the terminal URL reached if that lookup is inconclusive), and shows the result. Previously the screen just displayed the initialPENDINGresponse and stopped. - Docs: README's "Direct (S2S) card sale" section gained a "Completing 3-D Secure" subsection with a full example.
0.4.3 - 2026-07-09 #
- New:
sale()'s integrity hash is now computed automatically — the algorithm has been confirmed against the backend.computeSaleHash(MD5 ofreverse(email) + apiKey + reverse(first6+last4 of the card number), uppercased) is wired back intoDigetPaySdk.sale(): it computes and injectshashon every call unlessSaleRequest.hashis already set, in which case that value is sent verbatim. This reverses the "temporarily disabled" note from 0.4.0/0.4.1 —computeSaleHashitself never changed, only whethersale()calls it. - Fix: the README's "Direct (S2S) card sale" example didn't compile —
Customer(...)was missing the now-requiredphoneargument. Added it. - Docs: removed the "temporary hash" callouts from
DigetPaySdk.sale()'s dartdoc,SaleRequest.hash's field doc, the README, and the example app's S2S Card Sale screen; all now describe hash computation as automatic.
0.4.2 - 2026-07-09 #
- Fix:
TransactionFilter.pageNumberis confirmed 1-based — the backend rejects0with400 Bad Request("pageNumber must not be less than 1"). Doc comments onTransactionFilter.pageNumber/statusandDigetPaySdk.getTransactionHistory()updated accordingly; no change to the method signatures themselves. - Example app: fixed Transaction History's pager to drive Prev/Next from
a locally-tracked, 1-based page number instead of trusting the response's
first/last/number— those follow a different convention on other endpoints and previously let the "Prev" button send an invalidpageNumber(0), triggering the400above. - Example app: added a status filter (
All/Success/Failed) to Transaction History, wired toTransactionFilter.status; changing it restarts pagination at page 1. - Example app: Transaction History's detail bottom sheet now shows a copyable Transaction ID row and scrolls (capped at 90% of screen height) instead of overflowing on transactions with many fields or a long fee breakdown.
- Example app:
transactionStatusis now color-coded (greenSUCCESS/ redFAILED) in both Transaction History's list rows and the detail sheet, via a new sharedtransactionStatusColor()helper (example/lib/utils.dart). - Fix:
TransactionSummaryCard(shared with Transaction Lookup) no longer shows "recurringToken: issued" when the backend returns""instead of omitting the field — it now checks for a non-empty value.
0.4.1 - 2026-07-09 #
- Fix:
SaleRequest.toMap()andCustomer.toMap()now match the S2S collection's request sample exactly:billingAddress/invoiceare always present (nullwhen unset, not omitted), andCustomer'sphone/idNumber/idType/taxNumberare always present (''when unset, not omitted) — the backend expects these keys regardless of value. This is a deliberate, endpoint-specific exception to this package's usual "omit null optionals" convention. - Docs: moved the "Transaction history & lookup by id" section to directly follow "Direct (S2S) card sale" (ahead of "Listing checkout sessions") — it's a more commonly-needed lookup than the sessions listing.
0.4.0 - 2026-07-08 #
- New:
sale(SaleRequest)now performs a real headless S2S card sale/authorization againstPOST /payment/s2s/sale— no moreUnsupportedError. This widens PCI scope for callers who opt into it;cardPay()remains the recommended, PCI-safe default. The backend's integrityhashfield has a ported implementation (computeSaleHash, MD5) but automatic injection is temporarily disabled pending confirmation of the algorithm/secret —sale()currently sends the request as-is; setSaleRequest.hashyourself if you need one meanwhile (see theTODO(hash-decision)markers inlib/src/digetpay_sdk.dart). - New:
recurring(RecurringRequest)now performs a real merchant-initiated recurring charge againstPOST /payment/checkout/recurring, charging arecurringTokenfrom a priorcardPay()transaction — no moreUnsupportedError. - New:
getTransactionById(id)now performs a real lookup againstGET /payment/transactions/digetpay/{id}/details— no moreUnsupportedError. This reverses the 0.3.0 breaking change now that a real replacement endpoint exists. The returnedTransactiongained ~23 fields from this richer endpoint (businessUnitId,reconciliationStatus,cardScheme,cardChannel,originalAmount/originalCurrency,gateway,settlementStatus,businessUnitHierarchy, and more), plus a newBusinessUnitmodel for the hierarchy. - New:
getRecurringSubscriptions([RecurringSubscriptionFilter])lists saved-card billing plans (GET /payment/checkout/recurring/subscriptions) as aPageDto<RecurringSubscription>. - New:
chargeSubscription({subscriptionId, amount, email})charges an existing subscription (POST /payment/checkout/recurring/{id}/charge) — no card data needed — returning aSubscriptionChargeResult. - New:
getTransactionHistory([TransactionFilter])lists raw transaction records (GET /payment/transactions/digetpay/) as aPageDto<Transaction>. Distinct from the deprecatedgetTransactions()(→getCheckoutSessions(), session-shaped) — this lists transaction-shaped records instead. - Breaking:
TransactionFilter's fields replaced (pageNumber,pageSize,status— dropping the old speculativeid/page/size/orderId/amountFrom/amountTo/dateFrom/dateTo) to backgetTransactionHistory(). This class had no caller in the SDK until now. - Packaging: added the
cryptodependency (for the S2S sale hash). - Example app: replaced the compile-time
--dart-define=DIGETPAY_API_KEYflow with a first-run onboarding screen — enter your API key, pick Sandbox/Production, and the app callsDigetPaySdk.initialize()and persists the choice (shared_preferences, example-app-only). A new settings action on the home screen reopens it to change or reset the saved configuration. Added demo screens for S2S Card Sale, Recurring Charge (on the Money Movement screen), Recurring Subscriptions, and Transaction History; Transaction Lookup now also demosgetTransactionById; Not Yet Available is trimmed to the four remaining guarded stubs (applePay,externalPayment,getTransactionByOrderId,getTransactionByRrn). - Docs: README capability tables updated; new "Direct (S2S) card sale" and
"Recurring charges & subscriptions" / "Transaction history & lookup by id"
sections; the security section now distinguishes
cardPay()(PCI-safe) from the opt-in, PCI-scope-wideningsale().
0.3.0 - 2026-07-07 #
- Breaking:
getTransactionById(id)is now a guarded stub — the backend lookup-by-id endpoint (GET /payment/checkout/status?id=) is no longer available, so this always throwsUnsupportedError. UsegetCheckoutStatus(sessionId), or listgetCheckoutSessions()and inspect the returnedCheckoutSessions, instead. - Docs: updated the README capability table, "which id do I use?" callout,
and "not yet available" section; the example's
Not Yet Availablescreen now demosgetTransactionByIdalongside the other guarded stubs, andTransaction Lookupis limited togetCheckoutStatus.
0.2.0 - 2026-07-06 #
- New:
getCheckoutSessions([CheckoutSessionFilter])lists your checkout sessions (GET /payment/checkout/sessions) as aPageDto<CheckoutSession>. EachCheckoutSessionexposesgatewayTransactionId— the id to use withcapture/voidd/refund/getTransactionById(not the sessionid). - New:
CheckoutSession,CheckoutSessionFilter, andPageDto.fromPaginated(parses the NestJS{data, pagination}shape). - Deprecated:
getTransactions()— renamed togetCheckoutSessions(); it now forwards to it and returnsPageDto<CheckoutSession>. - Behaviour change: the not-yet-implemented methods now throw
UnsupportedErrorinstead of silently returning a failure/null:sale(disabled for PCI),applePay,externalPayment,recurring,getTransactionByOrderId,getTransactionByRrn. - Fix:
getCheckoutStatusnow callsGET /sdk/status?sessionId=(was pointing at the wrong path). - Packaging: added
repository,issue_tracker, andtopicsmetadata; converted to a true pure-Dart package (removed the unused native plugin scaffolding); aligned theflutterSDK constraint. - Docs: rewritten README (hero, quick start, capability table, sessions guide) and a runnable example is now published.
0.1.0 #
- Initial DigetPay release (pure Dart).
DigetPaySdkfacade withinitialize()+ init-guard.- Hosted, PCI-safe card checkout via
cardPay()(WebView) —POST /payment/checkout/intiate+GET /payment/checkout/status. - Money movement:
capture,voidd,refund. - Transaction queries:
getTransactions,getTransactionById(typedTransaction/PageDto). - Typed
DigetPayResponsenormalizing the backend{code, message, errorCode, data}envelope. - Guarded stubs (no backend endpoint yet):
sale(S2S card — disabled for PCI),applePay,externalPayment,recurring,getTransactionByOrderId,getTransactionByRrn.