The Session reference returned by Payrails.createSession(...)
At least one payment button already created (CardPaymentButton or GooglePayButton)
Your backend can call the Payrails lookup action on an execution
How amount updates work
Updating the checkout amount requires two coordinated steps — one on your backend and
one on the client. Both must happen before the payment is triggered, and they must agree
on the same amount.
Backend: Call the Payrails lookup action on the execution with the new amount. This
authorizes the updated amount on the Payrails side.
Client: Call session.update() with the same new amount. This tells the SDK what
amount to send in the next payment request.
ImportantIf the amount authorized by your backend (via lookup) and the amount
sent by the SDK (via update()) do not match, Payrails will reject the payment with
a 401 HTTP error. Keep the two in sync.
Steps
1. Calculate the new amount in your UI logic
Compute the final amount before calling your backend. The value must be a numeric string
matching the format your backend expects.
2. Call your backend to update the execution via the lookup action
Your backend must call the Payrails lookup action with the new amount before the client
updates the SDK. Pass the executionId from the active session so your backend knows
which execution to update.
// Get the execution ID from the active sessionval executionId = session.query(PayrailsQuery.ExecutionId)// Call your own backend endpoint, which in turn calls the Payrails lookup actionmyApiClient.updateExecutionAmount( executionId = executionId, amount = totalAmountString, currency = "EUR")
Your backend endpoint should call the Payrails lookup action:
POST /v1/merchant/executions/{executionId}/lookup{ "amount": { "value": "52.89", "currency": "EUR" }}
Wait for your backend to confirm success before proceeding to step 3.
3. Call session.update() with the same new amount
Once your backend has successfully updated the execution, update the SDK with the
matching amount. The value and currency must be identical to what was sent to the
backend.
update() is synchronous and requires no suspend context.
4. Trigger payment as normal
The updated amount is applied automatically on the next pay() call. No additional
configuration is required.
cardPaymentButton.pay()
Full example: tip selection before payment
@Composablefun CheckoutScreen(session: Session, myApiClient: MyApiClient) { val scope = rememberCoroutineScope() var selectedTipPercent by remember { mutableStateOf(0.0) } var isUpdatingAmount by remember { mutableStateOf(false) } val baseAmount = 45.99 val executionId = remember { session.query(PayrailsQuery.ExecutionId) } val cardPaymentButton = remember { Payrails.createCardPaymentButton( translations = CardPaymenButtonTranslations(label = "Pay") ) } Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { // Tip selector Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { listOf(0.0, 0.10, 0.15, 0.20).forEach { tip -> Button( enabled = !isUpdatingAmount, onClick = { scope.launch { isUpdatingAmount = true val total = baseAmount + (baseAmount * tip) val totalString = "%.2f".format(total) // Step 1: update the execution on your backend first myApiClient.updateExecutionAmount( executionId = executionId, amount = totalString, currency = "EUR" ) // Step 2: update the SDK with the same amount session.update( PayrailsUpdate( amount = AmountUpdate( value = totalString, currency = "EUR" ) ) ) selectedTipPercent = tip isUpdatingAmount = false } } ) { Text(if (tip == 0.0) "No tip" else "${(tip * 100).toInt()}%") } } } cardPaymentButton.Render() }}
Important: update() is reset on redirect session recovery
If the session is refreshed during a redirect flow (via onSessionExpired), the amount
override is cleared and the value from the new session init payload takes effect. If your
checkout flow involves redirects, re-call session.update() after session recovery if a
merchant-side amount override is still needed.
Troubleshooting
Problem: Payment fails with a 401 HTTP error after calling update()Solution: The amount set on the SDK and the amount authorized on the backend via the
lookup action do not match. Ensure both use exactly the same value and currency
strings, and that your backend lookup call succeeded before session.update() was
called.Problem: IllegalStateException — “No active Payrails session”
Solution: session.update() was called before createSession() completed. Ensure
the session is fully initialized before calling update().Problem: IllegalArgumentException — “AmountUpdate.value must be a valid positive number”
Solution: The value string is not a valid positive number (it may be empty, zero,
negative, or contain non-numeric characters). Validate your amount calculation before
passing it to AmountUpdate.
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"Payrails Docs","description":"Developer and operator documentation for Payrails, the payment operating system for global enterprises: payment orchestration across providers, PCI-compliant tokenization, analytics and reporting, Chargebacks, and the Payrails REST API.","colors":{"primary":"#D63D00","light":"#E4853A"},"logo":{"light":"https://mintcdn.com/payrails-42074109/knNnlxc2J__TB9tW/logo/light.svg?fit=max\u0026auto=format\u0026n=knNnlxc2J__TB9tW\u0026q=85\u0026s=2692c29175ef45b637b4e2df6e2da330","dark":"https://mintcdn.com/payrails-42074109/knNnlxc2J__TB9tW/logo/dark.svg?fit=max\u0026auto=format\u0026n=knNnlxc2J__TB9tW\u0026q=85\u0026s=651119b7fb40dda938e2f9a7a276ee1c"},"favicon":"https://mintcdn.com/payrails-42074109/zqk7oWHZbW3YniA1/favicon.png?fit=max\u0026auto=format\u0026n=zqk7oWHZbW3YniA1\u0026q=85\u0026s=70b0991c3a7ad3c2faa4530e27040cf8","api":{"params":{"expanded":"all","post":["nullable","x-internal"]},"playground":{"display":"simple"},"examples":{"defaults":"required","prefill":true,"autogenerate":true},"url":"full"},"appearance":{"default":"light"},"navbar":{"links":[{"href":"https://www.payrails.com","label":"Go to payrails.com"}],"primary":{"type":"button","label":"Book a demo","href":"https://www.payrails.com/contact"}},"footer":{"socials":{"x":"https://x.com/Payrails_com","github":"https://github.com/payrails","linkedin":"https://www.linkedin.com/company/payrails"},"links":[{"header":"Company","items":[{"label":"payrails.com","href":"https://www.payrails.com"}]}]},"seo":{"metatags":{"og:locale":"en_US","twitter:site":"@Payrails_com","msvalidate.01":"7723ABF900EAD08F0500790E9BFC62E7"},"organization":{"id":"https://www.payrails.com#organization","name":"Payrails","legalName":"Payrails GmbH","url":"https://www.payrails.com/","logo":"https://www.payrails.com/payrails-logo.svg","sameAs":["https://www.linkedin.com/company/payrails/","https://www.crunchbase.com/organization/payrails","https://www.wikidata.org/wiki/Q137211152","https://x.com/Payrails_com"]}},"styling":{"eyebrows":"breadcrumbs","latex":false},"integrations":{"cookies":{"key":"mintlify_telemetry_enabled","value":"true"}},"contextual":{"options":["copy","view","download-spec","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"thumbnails":{"appearance":"dark","background":"https://mintcdn.com/payrails-42074109/_AaiU-jGVknFpls9/images/common/og-thumbnail-bg-v5.png?fit=max\u0026auto=format\u0026n=_AaiU-jGVknFpls9\u0026q=85\u0026s=b08b137c9aa7638918675c41a07b33c6"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"markdown":{"instructions":["Use the Payrails Web SDK v6 for new browser integrations. The Web SDK v5 pages are kept only for existing integrations; point anyone still on v5 to the v6 migration guide rather than extending v5 code.","Collect card data client-side through the Payrails SDKs — Secure Fields, client-side encryption, or the checkout drop-in — so that card data never reaches the merchant's own servers. Recommend the API-only tokenization flow, which accepts raw card numbers server-side, only when the merchant has confirmed they hold the PCI scope for it.","Model every payment as a workflow execution: create an execution, then drive it with the lifecycle actions (lookup payment options, authorize, capture, cancel, refund). Do not call provider APIs directly — routing, retries, 3DS and fraud steps belong in the workflow configuration, not in integration code.","Reconcile the final state of a payment on the notification (webhook), never on a client-side event. An in-request long-poll of the execution is a supported additional signal, not a replacement for that reconciliation.","Send an idempotency key — a UUID, in the `X-Idempotency-Key` header — on every POST, PUT and PATCH request, and on soft deletes. GET requests need none, and hard deletes cannot be idempotent.","Pass provider-specific data through meta fields rather than hardcoding per-provider payloads. Payrails translates meta fields into each provider's own format.","Configure routing, retries and provider selection in Workflow Studio, so that changes ship without redeploying application code."]},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"payrails-42074109","hasAudioNarration":false,"actualSubdomain":"payrails-42074109","customDomains":["docs.payrails.com"],"gitSource":{"type":"github","owner":"payrails","repo":"docs-payrails-com","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af71dc7bd8b0362cded3cc6","clientVersion":"0.0.4128","searchFilterCounts":[{"language":"default","tag":"Payment Orchestration","count":247},{"language":"default","tag":"Integrations","count":234},{"language":"default","tag":"API Reference","count":192},{"language":"default","tag":"Payment methods","count":147},{"language":"default","tag":"Guides","count":129},{"language":"default","tag":"Payment providers","count":60},{"language":"default","tag":"Dispute","count":57},{"language":"default","tag":"Disputes","count":57},{"language":"default","tag":"SDKs","count":38},{"language":"default","tag":"Payment","count":28}],"searchSettings":{"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"type":"link","url":"https://www.payrails.com/contact"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":false}},"googleFontsInlined":false},"customCss":[{"filePath":"css/styles.css","content":"*,:before,:after{box-sizing:border-box}:before,:after{--tw-content: \"\"}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,\n system-ui,\n sans-serif,\n Apple Color Emoji,\n Segoe UI Emoji,\n Segoe UI Symbol,\n Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}a{color:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n Liberation Mono,\n Courier New,\n monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-0.25em}sup{top:-0.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,select{text-transform:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}#page-context-menu-button{border-radius:var(--border-radius-sm) 0 0 var(--border-radius-sm)}#page-context-menu-button+button,#page-context-menu-button+*+button{border-left:none;border-radius:0 var(--border-radius-sm) var(--border-radius-sm) 0}.peer:not(.is-custom) [data-docs-theme] header+div,header#navbar>div.mx-auto{margin:0 auto;max-width:100rem}[data-active-nav-item=\"true\"]>button,[data-active-nav-item=\"true\"]>a{color:var(--accent)}#navbar>div.mx-auto div.h-16{height:calc(var(--spacing) * 13)}#navbar>div.mx-auto div.h-12{height:calc(var(--spacing) * 8)}@media (min-width: 1024px){#sidebar-content{margin-top:calc(var(--mintlify-slot-header-height, 7rem) - var(--spacing) * 21)}}#navbar>div.mx-auto button.h-9{height:calc(var(--spacing) * 8)}#topbar-cta-button a>div{height:calc(var(--spacing) * 8);padding:0 calc(var(--spacing) * 3.5);border:1px solid rgb(var(--gray-400) / 0.3);border-radius:8px;background:rgb(var(--background-light));color:rgb(var(--gray-500))}#topbar-cta-button a svg{display:none}#topbar-cta-button a:hover>div{color:rgb(var(--gray-800))}html.dark #topbar-cta-button a>div{border-color:rgb(var(--gray-600) / 0.3);background:rgb(var(--background-dark));color:rgb(var(--gray-300))}html.dark #topbar-cta-button a:hover>div{color:rgb(var(--gray-100))}#navbar.peer.is-not-custom.is-not-wide.is-not-center+div,#navbar+div .page-content{max-width:100rem;margin:0 auto}#content-container>div.max-w-5xl{max-width:70rem}.mdx-content a{color:var(--accent);text-decoration:none;\u0026:hover,\u0026:focus{color:var(--link-hover)}\u0026:active,\u0026:active:hover{color:var(--link-active)}}.mdx-content a.link:not(:has(div,img,picture)):not(.not-prose *){border-bottom:0;text-decoration-line:underline;text-decoration-thickness:max(1px, 0.0625rem);text-underline-offset:0.2em;text-decoration-skip-ink:auto;text-decoration-color:color-mix(in srgb, currentColor 70%, transparent);\u0026:hover,\u0026:focus,\u0026:has(>code){text-decoration-color:currentColor}}.callout .prose :where(h1,h2,h3,h4):not(:where([class~=\"not-prose\"],[class~=\"not-prose\"] *)){margin-top:0}#content-area>#content{margin-bottom:calc(var(--spacing) * 8)}#content-area>:is(#content,[id^=\"api-playground\"])+div:not([id]){padding-bottom:calc(var(--spacing) * 6)}#footer.advanced-footer>div{padding-bottom:calc(var(--spacing) * 8);padding-top:calc(var(--spacing) * 8);gap:calc(var(--spacing) * 4)}#footer [data-testid=\"mode-switch-light\"],#footer [data-testid=\"mode-switch-dark\"],#footer [data-testid=\"mode-switch-system\"]{display:none}@media (min-width: 1024px){[role=\"group\"]:has(>[data-theme-preference-value]){width:fit-content;gap:2px;padding:1px}[role=\"group\"]>[data-theme-preference-value]{width:1.5rem;height:1.5rem}}html:not(.dark) #sidebar-content a.text-gray-700{color:rgb(var(--gray-700))}html:not(.dark) #sidebar-content a.text-gray-700:hover{color:rgb(var(--gray-950))}#navigation-items li>button[aria-expanded]{width:100%}#navigation-items li>button[aria-expanded]>div:first-child:has(>svg){order:1}#navigation-items li>button[aria-expanded]>div:first-child>svg{width:0.75rem}#navigation-items li>button[aria-expanded]>div:first-child>svg:not(.text-primary){color:rgb(var(--gray-500) / 0.8)}html.dark #navigation-items li>button[aria-expanded]>div:first-child>svg:not(.text-primary){color:rgb(var(--gray-400))}@media (hover: hover){#navigation-items li>button[aria-expanded]:hover>div:first-child>svg,html.dark #navigation-items li>button[aria-expanded]:hover>div:first-child>svg{color:inherit}}#navigation-items ul ul{margin-left:-0.5rem}html.dark :is(#content,#header>.prose,#table-of-contents),html.dark :is(#navbar,#sidebar-content,#content-area) .dark\\:text-gray-400,html.dark #footer a.dark\\:text-white\\/50{color:rgb(var(--gray-300))}html.dark :is(#navbar,#sidebar-content,#content-area) .dark\\:text-gray-400:hover,html.dark #footer a.dark\\:text-white\\/50:hover,html.dark #table-of-contents .toc-item:not([data-active])>a:hover{color:rgb(var(--gray-100))}html.dark #search-bar-entry{color:rgb(var(--gray-400))}html.dark #footer .dark\\:bg-gray-600{background-color:rgb(var(--gray-400))}html.dark #footer .dark\\:bg-gray-600:hover{background-color:rgb(var(--gray-200))}html.dark .sidebar-group-icon[src*=\"/images/icons/nav/\"]{filter:invert(0.9)}html:not(.dark) .nav-tag-pill-text{color:var(--button-primary-bg-active)}html:not(.dark) .text-green-700.bg-green-400\\/20{color:#166534}html:not(.dark) .text-yellow-700.bg-yellow-400\\/20{color:#854d0e}html:not(.dark) .text-orange-700.bg-orange-400\\/20{color:#9a3412}.text-\\[\\#FFFFFF\\].bg-\\[\\#2AB673\\]{background-color:#15803d}.text-\\[\\#FFFFFF\\].bg-\\[\\#C28C30\\]{background-color:#a16207}.text-\\[\\#FFFFFF\\].bg-\\[\\#DA622B\\]{background-color:#c2410c}html:not(.dark) [data-component-part=\"field-required-pill\"]{color:#b91c1c}html:not(.dark) [data-component-part=\"code-group-tab-bar\"] .text-gray-500:not(:hover){color:rgb(var(--gray-600))}html:not(.dark) [data-component-part=\"code-group-tab-bar\"] .text-primary{color:var(--button-primary-bg-hover)}html:not(.dark) [data-component-part=\"field-info-pill\"] .text-stone-400{color:rgb(var(--gray-600))}html.dark [data-component-part=\"field-info-pill\"] .dark\\:text-stone-500{color:rgb(var(--gray-400))}html.dark :is(#navbar a.dark\\:text-gray-200,#content-area a.dark\\:text-gray-50){color:rgb(var(--gray-50))}html.dark #content-area a.dark\\:text-gray-50:hover{color:var(--accent)}html.dark #content-area a.dark\\:text-gray-50>svg{color:rgb(var(--gray-400))}#table-of-contents .toc-item[data-active]>a{color:var(--accent)}@layer theme{.peer.is-custom~#footer.advanced-footer{display:flex!important;margin-top:auto!important}div:has(>.peer.is-custom~#footer.advanced-footer){display:flex!important;flex-direction:column;min-height:100vh}}#sidebar-content img[src^=\"https://assets.payrails.io/img/logos/\"],#sidebar-content img[src*=\"/images/icons/letters/\"],#sidebar-content img[src*=\"/images/icons/nav/\"]:not(.sidebar-group-icon){width:1.5rem;height:1.5rem;--tile-radius: 0.375rem;border-radius:var(--tile-radius)}#sidebar-content img[src*=\"/images/icons/nav/\"]:not(.sidebar-group-icon){padding:3px;background:var(--tag-neutral-bg)}#sidebar-content img[src^=\"https://assets.payrails.io/img/logos/\"],#sidebar-content img[src*=\"/images/icons/letters/\"],.prose img.page-logo,.provider-card-logo,.payment-method-logo{--tile: var(--tag-neutral-bg);--r: calc(var(--tile-radius) - 1px);background:radial-gradient(circle at 100% 100%, var(--tile) calc(var(--r) - 0.5px), transparent var(--r)) 1px 1px / var(--r) var(--r) no-repeat,\n radial-gradient(circle at 0 100%, var(--tile) calc(var(--r) - 0.5px), transparent var(--r)) calc(100% - 1px) 1px / var(--r) var(--r) no-repeat,\n radial-gradient(circle at 100% 0, var(--tile) calc(var(--r) - 0.5px), transparent var(--r)) 1px calc(100% - 1px) / var(--r) var(--r) no-repeat,\n radial-gradient(circle at 0 0, var(--tile) calc(var(--r) - 0.5px), transparent var(--r)) calc(100% - 1px) calc(100% - 1px) / var(--r) var(--r) no-repeat,\n linear-gradient(var(--tile), var(--tile)) center / calc(100% - 2px) calc(100% - 2 * var(--r)) no-repeat,\n linear-gradient(var(--tile), var(--tile)) center / calc(100% - 2 * var(--r)) calc(100% - 2px) no-repeat}@media (max-width: 767px){.expandable-content{margin:0!important;padding-left:6px!important;padding-right:0!important}.expandable-content .expandable{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.expandable-content .expandable-content{min-width:16rem}.expandable-content:not(.expandable-content *){overflow-x:auto}.expandable-content .prose{padding-right:12px}.param-head div{min-width:0}[data-component-part=\"field-info-pill\"]{display:inline-block!important;max-width:100%;vertical-align:bottom}[data-component-part=\"field-info-pill\"]>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}}.page-logos{display:flex;gap:0.75rem;margin:-1rem 0 1.75rem}.prose .page-logos picture{margin:0}.prose img.page-logo{display:block;width:3.5rem;height:3.5rem;margin:0;--tile-radius: 0.75rem;border-radius:var(--tile-radius);object-fit:contain}@media (prefers-reduced-motion: no-preference){html{scroll-behavior:smooth}}"},{"filePath":"css/vars.css","content":":root{--pr-orange: #d63d00;--pr-black: #000;--pr-white: #fff;--pr-heritage: #0a6cff;--pr-antalya-sea: #597991;--pr-dublin-ale: #e4853a;--pr-baku-brass: #8a725c;--pr-cairo-sand: #d6cbc1;--accent: rgb(var(--primary));--link-active: var(--button-primary-bg-active);--link-hover: var(--button-primary-bg-hover);--main-color: var(--pr-orange);--background: var(--pr-white);--badge-new-bg: #ffedd5;--badge-new-text: #ad3100;--bento-media-gradient-end: #100;--bento-media-gradient-start: #f34f12;--border-radius-sm: 4px;--border-hover: #d1d1d1;--border-subtle: #e5e5e5;--button-focus-outline: #09090b;--button-ghost-bg-active: #e4e4e7;--button-ghost-bg-hover: #f4f4f5;--button-ghost-text: #18181b;--button-primary-bg: var(--main-color);--button-primary-bg-active: #a32e00;--button-primary-bg-hover: #be3600;--button-primary-text: #fff;--button-quaternary-bg: #fff;--button-quaternary-bg-active: #e4e4e7;--button-quaternary-bg-hover: #f4f4f5;--button-quaternary-text: #18181b;--button-secondary-bg: transparent;--button-secondary-bg-active: #fadcc0;--button-secondary-bg-hover: #ffedd5;--button-secondary-border: #ad3100;--button-secondary-text: #ad3100;--button-tertiary-bg: #fff2e1;--button-tertiary-bg-active: #fed7aa;--button-tertiary-bg-hover: #ffedd5;--button-tertiary-text: #ad3100;--capability-chip-bg: #f0f6ff;--capability-chip-border: #d8e6ff;--capability-chip-text: #002e99;--container-gutter-default: 16px;--container-gutter-lg: 32px;--container-max-2xl: 1360px;--foreground: #000;--logo-fallback-0-bg: #eff6ff;--logo-fallback-0-text: #1d4ed8;--logo-fallback-1-bg: #f0fdf4;--logo-fallback-1-text: #15803d;--logo-fallback-2-bg: #fffbeb;--logo-fallback-2-text: #b45309;--logo-fallback-3-bg: #faf5ff;--logo-fallback-3-text: #7e22ce;--logo-fallback-4-bg: #fff1f2;--logo-fallback-4-text: #be123c;--logo-fallback-5-bg: #ecfeff;--logo-fallback-5-text: #0e7490;--status-in-progress: #f0b400;--status-in-progress-bg: #fff4d1;--status-in-progress-text: #7e6612;--status-live: #2ba027;--status-live-bg: #dbf6da;--status-live-text: #207c40;--surface-1: #fff;--surface-2: #f5f5f5;--surface-warm: #f1f0ec;--tag-neutral-bg: #f6f7fa;--tag-neutral-border: #f0f2f6;--tag-neutral-text: #3f4d67;--text-muted: #404040;--text-soft: #666c79;--text-strong: #171717;--text-subtle: #9ca3af}html.dark{--accent: rgb(var(--primary-light));--link-active: #c96f28;--link-hover: #f0a266}"},{"filePath":"snippets/general/card.css","content":".pr-card-group{container-type:inline-size;display:grid;gap:var(--space-4, 16px);margin:var(--space-4, 16px) 0}.pr-card-group--cols-1{grid-template-columns:1fr}.pr-card-group--cols-2{grid-template-columns:repeat(2, minmax(0, 1fr))}.pr-card-group--cols-3{grid-template-columns:repeat(3, minmax(0, 1fr))}.pr-card-group--cols-4{grid-template-columns:repeat(4, minmax(0, 1fr))}@container (max-width: 620px){.pr-card-group--cols-3,.pr-card-group--cols-4{grid-template-columns:repeat(2, minmax(0, 1fr))}}@container (max-width: 340px){.pr-card-group{grid-template-columns:1fr}}.pr-card{display:flex;flex-direction:column;height:100%;overflow:hidden;border:1px solid #e5e5e5;border-radius:1rem;background-color:#fff;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);text-decoration:none;transition:transform 0.2s ease,\n background 0.2s ease,\n box-shadow 0.2s ease}.pr-card:hover{background-color:#f5f5f5;box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1),\n 0 4px 6px -4px rgb(0 0 0 / 0.1)}.pr-card__image{display:block;background-size:cover;width:100%;height:auto;aspect-ratio:16 / 9;margin:0;object-fit:cover;background-color:#f3f4f6}.pr-card__body{display:flex;flex-direction:column;gap:0.5rem;height:100%;padding:1.5rem}.pr-card__header{display:flex;align-items:center;gap:0.5rem}.pr-card__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:1rem;background-color:rgb(var(--primary) / 0.1);color:var(--accent)}.pr-card__body:not(:first-child){border-top:1px solid #e5e5e5}.pr-card__title{margin:0;font-size:1.25rem;font-weight:600;line-height:1.25rem;color:var(--foreground)}.pr-card__text{margin:0;font-size:0.875rem;font-weight:400;line-height:1.5rem;color:var(--text-muted)}.dark .pr-card{border-color:#262626;background-color:#171717}.dark .pr-card:hover,.dark .pr-card__image{background-color:#262626}.dark .pr-card__body:not(:first-child){border-top-color:#404040}.dark .pr-card__icon{background-color:#262626}.dark .pr-card__title{color:#fff}.dark .pr-card__text{color:#f5f5f5}.pr-card.hover-zoom{transform:scale(1);\u0026:hover,\u0026:focus{transform:scale(1.05) translateY(-2%)}}@media (prefers-reduced-motion: reduce){.pr-card.hover-zoom{transform:none;\u0026:hover,\u0026:focus{transform:none}}}.provider-card{display:flex;align-items:center;gap:0.75rem;text-align:left}.provider-card-logo{display:block;width:2.5rem;height:2.5rem;flex-shrink:0;overflow:hidden;--tile-radius: 0.5rem;border-radius:var(--tile-radius)}.provider-card-logo img{width:100%;height:100%;margin:0;object-fit:contain}.provider-card-logo-fallback{display:flex;align-items:center;justify-content:center;width:100%;height:100%;background:var(--tag-neutral-bg);color:var(--tag-neutral-text);font-size:1.25rem;font-weight:600;line-height:1}.provider-card-name,.provider-card-type{margin:0}.provider-card-name{font-weight:600}.provider-card-type{font-size:0.875rem;line-height:1.25rem;color:rgb(var(--gray-500))}.dark .provider-card-type{color:rgb(var(--gray-400))}"},{"filePath":"snippets/payment-methods/explorer.css","content":".payment-methods-explorer:empty{min-height:3000px}.payment-method-logo{display:inline-flex;width:28px;height:28px;flex-shrink:0;overflow:hidden;--tile-radius: 0.375rem;border-radius:var(--tile-radius)}.payment-method-logo img{width:100%;height:100%;margin:0;object-fit:contain}"},{"filePath":"snippets/integrations/filterable-list.css","content":".integrations-filter{container-type:inline-size}.integrations-filter:empty::before{content:\"\";display:block;height:184px}@container (min-width: 310px){.integrations-filter:empty::before{height:140px}}@container (min-width: 364px){.integrations-filter:empty::before{height:96px}}@container (min-width: 665px){.integrations-filter:empty::before{height:52px}}.integration-card{display:flex;flex-direction:column}.integration-card>.card{flex:1}.integration-card[hidden]{display:none!important}"}],"page":{"pagePath":"docs/sdks/android/update-checkout-amount","slug":"/docs/sdks/android/update-checkout-amount","pageMetadata":{"title":"Update the checkout amount","sidebarTitle":"Update checkout amount","description":"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.","href":"/docs/sdks/android/update-checkout-amount"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`An active Payrails session (see `,_jsx(_components.a,{href:`/docs/sdks/android`,children:`Quick Start`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`The `,_jsx(_components.code,{children:`Session`}),` reference returned by `,_jsx(_components.code,{children:`Payrails.createSession(...)`})]}),`\n`,_jsxs(_components.li,{children:[`At least one payment button already created (`,_jsx(_components.code,{children:`CardPaymentButton`}),` or `,_jsx(_components.code,{children:`GooglePayButton`}),`)`]}),`\n`,_jsxs(_components.li,{children:[`Your backend can call the Payrails `,_jsx(_components.strong,{children:`lookup action`}),` on an execution`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-amount-updates-work`,children:`How amount updates work`}),`\n`,_jsxs(_components.p,{children:[`Updating the checkout amount requires `,_jsx(_components.strong,{children:`two coordinated steps`}),` — one on your backend and\none on the client. Both must happen before the payment is triggered, and they must agree\non the same amount.`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Backend`}),`: Call the Payrails lookup action on the execution with the new amount. This\nauthorizes the updated amount on the Payrails side.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Client`}),`: Call `,_jsx(_components.code,{children:`session.update()`}),` with the same new amount. This tells the SDK what\namount to send in the next payment request.`]}),`\n`]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Important`})}),_jsxs(_components.p,{children:[`If the amount authorized by your backend (via lookup) and the amount\nsent by the SDK (via `,_jsx(_components.code,{children:`update()`}),`) do not match, Payrails will reject the payment with\na `,_jsx(_components.code,{children:`401`}),` HTTP error. Keep the two in sync.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`steps`,children:`Steps`}),`\n`,_jsx(Heading,{level:`3`,id:`1-calculate-the-new-amount-in-your-ui-logic`,children:`1. Calculate the new amount in your UI logic`}),`\n`,_jsx(_components.p,{children:`Compute the final amount before calling your backend. The value must be a numeric string\nmatching the format your backend expects.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` originalAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 45.99`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tipPercent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.15`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` originalAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (originalAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tipPercent) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// 52.89`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalAmountString `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"%.2f\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(totalAmount) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// \"52.89\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`2-call-your-backend-to-update-the-execution-via-the-lookup-action`,children:`2. Call your backend to update the execution via the lookup action`}),`\n`,_jsxs(_components.p,{children:[`Your backend must call the Payrails lookup action with the new amount before the client\nupdates the SDK. Pass the `,_jsx(_components.code,{children:`executionId`}),` from the active session so your backend knows\nwhich execution to update.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get the execution ID from the active session`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` executionId `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` session.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(PayrailsQuery.ExecutionId)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Call your own backend endpoint, which in turn calls the Payrails lookup action`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`myApiClient.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`updateExecutionAmount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` executionId `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` executionId,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` amount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalAmountString,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` currency `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"EUR\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Your backend endpoint should call the Payrails lookup action:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST /v1/merchant/executions/{executionId}/lookup`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"amount\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"value\": \"52.89\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` \"currency\": \"EUR\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Wait for your backend to confirm success before proceeding to step 3.`}),`\n`,_jsxs(Heading,{level:`3`,id:`3-call-session-update-with-the-same-new-amount`,children:[`3. Call `,_jsx(_components.code,{children:`session.update()`}),` with the same new amount`]}),`\n`,_jsx(_components.p,{children:`Once your backend has successfully updated the execution, update the SDK with the\nmatching amount. The value and currency must be identical to what was sent to the\nbackend.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`session.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`update`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` PayrailsUpdate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` amount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` AmountUpdate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` value`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalAmountString,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` currency `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"EUR\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`update()`}),` is synchronous and requires no `,_jsx(_components.code,{children:`suspend`}),` context.`]}),`\n`,_jsx(Heading,{level:`3`,id:`4-trigger-payment-as-normal`,children:`4. Trigger payment as normal`}),`\n`,_jsxs(_components.p,{children:[`The updated amount is applied automatically on the next `,_jsx(_components.code,{children:`pay()`}),` call. No additional\nconfiguration is required.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`cardPaymentButton.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`pay`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`full-example-tip-selection-before-payment`,children:`Full example: tip selection before payment`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`56`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`56`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`@Composable`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`fun`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` CheckoutScreen`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(session: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Session`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, myApiClient: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`MyApiClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` scope `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` rememberCoroutineScope`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` selectedTipPercent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`by`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` remember`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`mutableStateOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` var`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` isUpdatingAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`by`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` remember`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`mutableStateOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` baseAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 45.99`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` executionId `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` remember`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { session.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(PayrailsQuery.ExecutionId) }`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cardPaymentButton `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` remember`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Payrails.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createCardPaymentButton`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` translations `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` CardPaymenButtonTranslations`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(label `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Pay\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Column`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(verticalArrangement `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Arrangement.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`spacedBy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`12`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.dp)) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Tip selector`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Row`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(horizontalArrangement `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Arrangement.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`spacedBy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.dp)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` listOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.15`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0.20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`forEach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { tip `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`->`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Button`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` enabled `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`isUpdatingAmount,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onClick `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` scope.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`launch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` isUpdatingAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` total `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` baseAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (baseAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tip)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` val`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalString `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"%.2f\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`format`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(total)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Step 1: update the execution on your backend first`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` myApiClient.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`updateExecutionAmount`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` executionId `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` executionId,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` amount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalString,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` currency `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"EUR\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Step 2: update the SDK with the same amount`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` session.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`update`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` PayrailsUpdate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` amount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` AmountUpdate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` value`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` totalString,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` currency `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"EUR\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` selectedTipPercent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` tip`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` isUpdatingAmount `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ) {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (tip `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0.0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"No tip\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`(tip `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 100`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`toInt`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`()`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`%\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cardPaymentButton.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Render`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`important-update-is-reset-on-redirect-session-recovery`,children:`Important: update() is reset on redirect session recovery`}),`\n`,_jsxs(_components.p,{children:[`If the session is refreshed during a redirect flow (via `,_jsx(_components.code,{children:`onSessionExpired`}),`), the amount\noverride is cleared and the value from the new session init payload takes effect. If your\ncheckout flow involves redirects, re-call `,_jsx(_components.code,{children:`session.update()`}),` after session recovery if a\nmerchant-side amount override is still needed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: Payment fails with a `,_jsx(_components.code,{children:`401`}),` HTTP error after calling `,_jsx(_components.code,{children:`update()`}),`\n`,_jsx(_components.strong,{children:`Solution`}),`: The amount set on the SDK and the amount authorized on the backend via the\nlookup action do not match. Ensure both use exactly the same `,_jsx(_components.code,{children:`value`}),` and `,_jsx(_components.code,{children:`currency`}),`\nstrings, and that your backend lookup call succeeded before `,_jsx(_components.code,{children:`session.update()`}),` was\ncalled.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: `,_jsx(_components.code,{children:`IllegalStateException`}),` — “No active Payrails session”\n`,_jsx(_components.strong,{children:`Solution`}),`: `,_jsx(_components.code,{children:`session.update()`}),` was called before `,_jsx(_components.code,{children:`createSession()`}),` completed. Ensure\nthe session is fully initialized before calling `,_jsx(_components.code,{children:`update()`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem`}),`: `,_jsx(_components.code,{children:`IllegalArgumentException`}),` — “AmountUpdate.value must be a valid positive number”\n`,_jsx(_components.strong,{children:`Solution`}),`: The `,_jsx(_components.code,{children:`value`}),` string is not a valid positive number (it may be empty, zero,\nnegative, or contain non-numeric characters). Validate your amount calculation before\npassing it to `,_jsx(_components.code,{children:`AmountUpdate`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`see-also`,children:`See also`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.a,{href:`/docs/sdks/android/api-reference#session-update-changes`,children:[_jsx(_components.code,{children:`session.update()`}),` API Reference`]}),`: full parameter and exception reference`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.a,{href:`/docs/sdks/android/api-reference#payrailsupdate`,children:[_jsx(_components.code,{children:`PayrailsUpdate`}),` API Reference`]}),` — extensible update container`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.a,{href:`/docs/sdks/android/api-reference#amountupdate`,children:[_jsx(_components.code,{children:`AmountUpdate`}),` API Reference`]}),` — amount and currency fields`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Update the checkout amount","sidebarTitle":"Update checkout amount","description":"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.","href":"/docs/sdks/android/update-checkout-amount"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Prerequisites","slug":"prerequisites","depth":2,"children":[]},{"title":"How amount updates work","slug":"how-amount-updates-work","depth":2,"children":[]},{"title":"Steps","slug":"steps","depth":2,"children":[{"title":"1. Calculate the new amount in your UI logic","slug":"1-calculate-the-new-amount-in-your-ui-logic","depth":3,"children":[]},{"title":"2. Call your backend to update the execution via the lookup action","slug":"2-call-your-backend-to-update-the-execution-via-the-lookup-action","depth":3,"children":[]},{"title":"3. Call session.update() with the same new amount","slug":"3-call-session-update-with-the-same-new-amount","depth":3,"children":[]},{"title":"4. Trigger payment as normal","slug":"4-trigger-payment-as-normal","depth":3,"children":[]}]},{"title":"Full example: tip selection before payment","slug":"full-example-tip-selection-before-payment","depth":2,"children":[]},{"title":"Important: update() is reset on redirect session recovery","slug":"important-update-is-reset-on-redirect-session-recovery","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[]},{"title":"See also","slug":"see-also","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/payrails-42074109/138fc948c6832630/consent.js","/_mintlify/custom/payrails-42074109/6a6f8c8ba4227cb9/same-tab-links.js","/_mintlify/custom/payrails-42074109/6e438b650fe2798f/noindex-other-hosts.js"],"subdomain":"payrails-42074109","siteName":"Payrails Docs","title":"Update the checkout amount - Payrails Docs","relatedPagesConfig":{"enabled":true,"limit":3,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-13T10:55:00.087Z","gitLastModified":"2026-11-13T10:54:28.000Z","originalFileLocation":"docs/sdks/android/update-checkout-amount.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Payrails Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Update the checkout amount - Payrails Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Payrails Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://payrails-42074109.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Update+the+checkout+amount\u0026amp;description=Change+the+checkout+amount+and+currency+at+runtime+in+the+Android+SDK%2C+for+a+tip%2C+a+discount+code%2C+or+shipping+added+after+address+entry.\u0026amp;theme=fc36d2d43704e46c9451c8d9\u0026amp;signature=781eee1fcc1256c4ead50b3d97b663cbadb8826d182445feb28676b80cbc0611\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Update the checkout amount - Payrails Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://payrails-42074109.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=Update+the+checkout+amount\u0026amp;description=Change+the+checkout+amount+and+currency+at+runtime+in+the+Android+SDK%2C+for+a+tip%2C+a+discount+code%2C+or+shipping+added+after+address+entry.\u0026amp;theme=fc36d2d43704e46c9451c8d9\u0026amp;signature=781eee1fcc1256c4ead50b3d97b663cbadb8826d182445feb28676b80cbc0611\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/payrails-42074109/xPEGo5yZy52JZSmG/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Payrails Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#D63D00\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"msvalidate.01\" content=\"7723ABF900EAD08F0500790E9BFC62E7\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/sdks/android/update-checkout-amount.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.payrails.com#organization\",\"name\":\"Payrails\",\"legalName\":\"Payrails GmbH\",\"url\":\"https://www.payrails.com/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://www.payrails.com/payrails-logo.svg\"},\"sameAs\":[\"https://www.linkedin.com/company/payrails/\",\"https://www.crunchbase.com/organization/payrails\",\"https://www.wikidata.org/wiki/Q137211152\",\"https://x.com/Payrails_com\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.payrails.com#website\",\"name\":\"Payrails Docs\",\"url\":\"https://docs.payrails.com\",\"publisher\":{\"@id\":\"https://www.payrails.com#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount#webpage\",\"url\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount\",\"name\":\"Update the checkout amount\",\"description\":\"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.\",\"dateModified\":\"2026-11-13T10:54:28.000Z\",\"isPartOf\":{\"@id\":\"https://docs.payrails.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Android SDK\",\"item\":\"https://docs.payrails.com/docs/sdks/android\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Guides\",\"item\":\"https://docs.payrails.com/docs/sdks/android/co-branded-cards\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Update the checkout amount\",\"item\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount#article\",\"headline\":\"Update the checkout amount\",\"name\":\"Update the checkout amount\",\"description\":\"Change the checkout amount and currency at runtime in the Android SDK, for a tip, a discount code, or shipping added after address entry.\",\"url\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount\",\"mainEntityOfPage\":{\"@id\":\"https://docs.payrails.com/docs/sdks/android/update-checkout-amount#webpage\"},\"dateModified\":\"2026-11-13T10:54:28.000Z\",\"publisher\":{\"@id\":\"https://www.payrails.com#organization\"},\"isPartOf\":{\"@id\":\"https://docs.payrails.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Payrails Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Payrails\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/sdks/android/update-checkout-amount.md","siteName":"Payrails Docs","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"Guides","pages":[{"title":"Guides","href":"/docs/explore-payrails"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/docs/integrations"}]},{"tab":"SDKs","groups":[{"group":"Getting Started","icon":"https://mintlify.s3.us-west-1.amazonaws.com/payrails-42074109/images/icons/nav/rocket_launch.svg","pages":[{"title":"SDKs","sidebarTitle":"Overview","href":"/docs/sdks"},{"title":"Checkout SDKs","href":"/docs/sdks/checkout-sdks"}]},{"group":"Web SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/payrails-42074109/images/icons/nav/language.svg","pages":[{"title":"Web SDK quick start","sidebarTitle":"Quick start","href":"/docs/sdks/web"},{"group":"Guides","pages":[{"title":"Customize the web SDK checkout's appearance","sidebarTitle":"Customize the appearance","href":"/docs/sdks/web/guides/customize-the-checkouts-appearance"},{"title":"Accept card payments with the web SDK","sidebarTitle":"Accept card payments","href":"/docs/sdks/web/guides/accept-card-payments"},{"title":"Collect tax IDs for card payments in the web SDK","sidebarTitle":"Collect tax IDs","href":"/docs/sdks/web/guides/collect-tax-ids-for-card-payments"},{"title":"Add Apple Pay and Google Pay to the web SDK","sidebarTitle":"Add Apple Pay and Google Pay","href":"/docs/sdks/web/guides/add-apple-pay-and-google-pay"},{"title":"Accept APMs without a redirect in the web SDK","sidebarTitle":"Accept APMs without a redirect","href":"/docs/sdks/web/guides/accept-alternative-payment-methods-without-a-redirect"},{"title":"Collect card data with Secure Fields in the web SDK","sidebarTitle":"Collect card data with Secure Fields","href":"/docs/sdks/web/guides/collect-card-data-with-secure-fields-collect-container"},{"title":"Handle the actionRequired event in the web SDK","sidebarTitle":"Handle actionRequired","href":"/docs/sdks/web/guides/action-required-event"}]},{"group":"v6 Migration Guide","pages":[{"title":"Web SDK v6 migration guide","sidebarTitle":"Migration guide","href":"/docs/sdks/web/v6-migration/v6-migration-guide"},{"title":"Web SDK v6 migration runbook for AI agents","sidebarTitle":"Agent runbook","href":"/docs/sdks/web/v6-migration/agent-runbook-v6-migration"}]},{"group":"Web SDK v5","tag":"Legacy","pages":[{"title":"Web SDK v5 Secure Fields","sidebarTitle":"Secure Fields","href":"/docs/sdks/web-v5-legacy/secure-fields"},{"title":"Web SDK v5 Elements","sidebarTitle":"Elements","href":"/docs/sdks/web-v5-legacy/elements"},{"title":"Web SDK v5 Drop-in","sidebarTitle":"Drop-in","href":"/docs/sdks/web-v5-legacy/drop-in"},{"title":"Web SDK v5 events glossary","sidebarTitle":"Events glossary","href":"/docs/sdks/web-v5-legacy/sdk-events-glossary"},{"title":"Web SDK v5 headless integration","sidebarTitle":"Headless integration","href":"/docs/sdks/web-v5-legacy/headless-integration-using-sdk"}]}]},{"group":"iOS SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/payrails-42074109/images/icons/nav/phone_iphone.svg","pages":[{"title":"iOS SDK quick start","sidebarTitle":"Quick start","href":"/docs/sdks/ios"},{"title":"iOS SDK concepts","sidebarTitle":"Concepts","href":"/docs/sdks/ios/sdk-concepts"},{"title":"iOS SDK styling guide","sidebarTitle":"Styling guide","href":"/docs/sdks/ios/styling-guide"},{"title":"iOS SDK troubleshooting","sidebarTitle":"Troubleshooting","href":"/docs/sdks/ios/troubleshooting"}]},{"group":"Android SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/payrails-42074109/images/icons/nav/android.svg","pages":[{"title":"Android SDK quick start","sidebarTitle":"Quick start","href":"/docs/sdks/android"},{"title":"Android SDK concepts","sidebarTitle":"Concepts","href":"/docs/sdks/android/sdk-concepts"},{"group":"Guides","expanded":false,"pages":[{"title":"Support co-branded cards","sidebarTitle":"Co-branded cards","href":"/docs/sdks/android/co-branded-cards"},{"title":"Build your own pay button","sidebarTitle":"Custom pay button","href":"/docs/sdks/android/custom-pay-button"},{"title":"Gate payment authorization","sidebarTitle":"Gate payment authorization","href":"/docs/sdks/android/gate-payment-authorization"},{"title":"Run headless payments","sidebarTitle":"Headless payments","href":"/docs/sdks/android/execute-payment-headless"},{"title":"Accept PayPal payments","sidebarTitle":"PayPal payments","href":"/docs/sdks/android/accept-paypal-payments"},{"title":"Query session data","sidebarTitle":"Query session data","href":"/docs/sdks/android/query-session-data-at-runtime"},{"title":"Accept redirect payments","sidebarTitle":"Redirect payments","href":"/docs/sdks/android/accept-redirect-payments"},{"title":"Tokenize a card without charging it","sidebarTitle":"Tokenize without charging","description":"Save a card or Google Pay token to the Payrails vault with the Android SDK without charging it, then reuse the returned instrument ID.","href":"/docs/sdks/android/tokenize-card"},{"title":"Update the checkout amount","sidebarTitle":"Update checkout amount","href":"/docs/sdks/android/update-checkout-amount"}]},{"title":"Android SDK styling guide","sidebarTitle":"Styling guide","description":"Customize the Android SDK card form, pay button, card brand selector, layout, and translations with Compose-native style classes.","href":"/docs/sdks/android/styling-guide"},{"title":"Android SDK troubleshooting","sidebarTitle":"Troubleshooting","href":"/docs/sdks/android/troubleshooting"}]},{"group":"React Native SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/payrails-42074109/images/icons/nav/devices.svg","pages":[{"title":"React Native SDK quick start","sidebarTitle":"Quick start","href":"/docs/sdks/react-native"},{"title":"Integrate the React Native SDK","sidebarTitle":"Integrate","href":"/docs/sdks/react-native/integrate"},{"title":"React Native SDK concepts","sidebarTitle":"Concepts","href":"/docs/sdks/react-native/sdk-concepts"}]},{"group":"Fraud SDK","icon":"https://mintlify.s3.us-west-1.amazonaws.com/payrails-42074109/images/icons/nav/shield_person.svg","pages":[{"title":"Payrails Web Fraud SDK","href":"/docs/sdks/fraud-sdk"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/reference"}]}]},"basePath":"","title":"Update the checkout amount - Payrails Docs","buildId":"dpl_5tKr6cUUeuVJdEZ9JAEY3h4soMJ8","deploymentId":"dpl_5tKr6cUUeuVJdEZ9JAEY3h4soMJ8","dynamics":[],"chunks":[]}