docs(reference): add surcharging integration guide - #203
Open
flozanofdez wants to merge 1 commit into
Open
Conversation
Documents the surcharge feature landing in Android SDK 7.1014.0 / App 4.14.0 / REST API 2.28.0: the five terminal configuration parameters, how to derive the surcharge amount, and how to read back what the gateway applied. Calls out that the Cloud API expects the surcharge to be already included in `amount` while the Android SDK adds it on top of the amount passed, since sending the wrong shape either overcharges the cardholder or double-counts the surcharge. Co-Authored-By: Claude Code - Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes API-78.
Why
Surcharging ships with Android SDK 7.1014.0 / App 4.14.0 / REST API 2.28.0 and has no user-facing documentation. This adds a guide to
docs/reference/, alongsideavs-for-motoandpre-authorization-guide, which is where cross-cutting feature guides live on this branch.The source material was the surcharging spec doc, condensed and rewritten against the actual SDK and Cloud API source rather than transcribed — the spec was written ahead of implementation and diverges from what shipped.
The main thing reviewers should check
The two integration paths assemble the amount differently, and the guide leads with that:
amountcontainstransaction-request.model.ts: "Already included inamount")SharedRequestFactoryadds surcharge and tax on topSending the wrong shape either overcharges the cardholder or double-counts the surcharge. Worth confirming this asymmetry is intended rather than an SDK bug.
Corrections made against the spec
ConfigurationManager,getBooleanKey()/getFloatKey()HapiConfigurationManagerviahapi.getConfigurationManager();getKey(name).asBooleanKey()/.asDecimalKey()surchargePercentis a floatBigDecimal—phoenix-config-resourcevalidates it as adecimalparamConfigurationNotFoundExceptionConfigurationKeyNotFoundExceptionHapiConfigurationListener.newConfiguration()Events.ConfigurationUpdatesEvent.newConfigurations()PreAuthorizationCaptureOptionsOptionsSurchargeReasonenumreasonis a plainStringRefundOptionsneeds asurchargeAmountfield"Optionsand forwarded byRefundRequestFactorySupport matrix — needs a second opinion
Marked ✅ for Cloud API and Android (PAX); ❌ for Android (HiLite), iOS (HiLite) and Cordova. The ❌ marks are inferred from the absence of any surcharge field in those SDKs plus the "App 4.14.0" gating, not from a positive statement of scope. Please correct if wrong.
Also worth a look
HALF_UPthroughout; if the gateway team settles on something else, the Refunds section needs updating.Options.taxAmountis@Deprecatedin favour oftaxInformation, yet it is the field that actually adds tax to the charged total. The guide uses it without commentary.Checklist
yarn buildpasses; no new broken links or anchors/reference/surchargingand appears in the Reference sidebar🤖 Generated with Claude Code