Update a provider's settings

Saves edited settings for a connected gateway (or workflow): the processor's own form values, handed to the processor and re-tested against it before they are stored. The same call decides what the gateway is enabled for, because the enabled currency and payment method lists are rewritten from the body on every save; Merchant Setup sends "all supported" each time so the server recomputes them from the processor rather than freezing yesterday's list. A settings form that asks for a second "apply" step is saving twice: there is no separate apply operation on the server.

Where you can do this

Before you start

  • The gateway or workflow exists and is not deleted.
  • Neither the record nor its processor integration is archived, if the processor is to be called at all. An archived record can still be edited through the API without one (see Rules and Dismiss an archived provider's notice); Merchant Setup never offers Save on one.

Inputs

InputRequiredMeaning and constraints
valuesnoSettings form values, in the shape the processor's settings form defines. On a gateway they are merged over the stored values, so a partial post keeps the rest; OAuth-supplied values win over posted ones. On a workflow they replace the stored values outright. Omitting them leaves the stored values untouched.
statusnoWhen sent it must equal the record's current status. A different status turns the call into a status change and discards every other field (see Disconnect a provider, Restore an archived provider).
metadatanoFree-form key-value pairs. Kept when omitted on a gateway; wiped when omitted on a workflow (see Rules).
tagsnoSame handling as metadata.
fields that belong to another function and are accepted on the same callnooauth_data (and the provider authorisation values it carries); see Reconnect a provider.

Rules

Checked by the API means Shuttle refuses the request however it is sent; a screen name means only that screen refuses it, and a direct API call would be accepted.

RuleChecked byWhat you see
The body must carry a gateway objectThe APIVALIDATION_ERROR (400), "API body error: missing gateway object"
The record must existThe APINOT_FOUND (404), "Gateway not found" / "workflow not found"
The name must not be blankThe APIvalidations.name.notempty
The reporting code cannot be blanked on an existing record, and must be uniqueThe APIvalidations.reportingCode.notempty, validations.reportingCode.nonunique
The processor connection is re-tested with the new values and the save is rejected on failure. Not every processor can be tested: where its connector implements no check, the connection is reported as unknown and the save goes throughThe APIINVALID (400) with the processor's own message, or "Invalid credentials"
Nothing is stored when that test fails: the values reach the processor before the record is writtenThe APIthe stored settings and the record's version are unchanged
Values are not checked against the settings schema server-side; the processor's integration and Merchant Setup's rendering of that schema are the only checksMerchant Setup screen, the API (processor integration)the form refuses to submit; the server accepts whatever the integration accepts
The enabled and displayed currency and payment method lists are rewritten from the body on every save, for gatewaysThe APIa caller who sends a narrower list narrows the gateway; one who sends none widens it back to everything supported
A gateway cannot be disabled for every currency or method through this call: an empty or omitted list is read as "all supported", and even a stored "none" resolves back to everything supported when the routing and payment code reads itThe APIno way to switch a gateway off here; use Disconnect a provider
A save that changes nothing is dropped: the record is only written, versioned and announced when its contents actually differThe APIno webhook, no version bump
Merchant Setup sends "all supported" currencies and a null legal entity on every saveMerchant Setup screena save from the app never narrows the gateway and never disturbs its routing
A settings form may mark a field as needing a second "apply" save. The app then saves, reloads the settings and leaves the form open; the server sees two ordinary saves and cannot tell them apartMerchant Setup screenthe form stays open for the second save

What happens

  • The settings are re-tested against the processor and stored. On failure nothing changes and the caller gets the processor's own message; on success the response carries the updated gateway, including the currencies and payment methods it now offers, re-read from the processor.
  • A gateway still in setup becomes CREATED, or LINKED when checkout routing already points at it. A gateway that is already live keeps its status.
  • The checkout offers what the saved gateway now supports, from the next payment onwards; payments already taken are untouched.
  • GATEWAY.UPDATE reaches the instance's webhook subscribers. A save that changed nothing raises nothing, and workflows raise no event at all.
  • Merchant Setup returns to the provider list; a form that asked for an apply step stays open for the second save instead.

Who can do this

  • Roles: Admin only. Support holds neither payment_gateway nor payment_workflow, and provider setup is Admin by intent.
  • Permission keys (for clients managing permissions directly): payment_gateway (or *) on the gateway, checked by Shuttle; without it the caller gets UNAUTHORIZED (401), "Unauthorized". For a workflow, payment_workflow (or *) on the division named in the body, falling back to the client, checked by Shuttle; without it UNAUTHORIZED (401), "Missing required permissions". Merchant Setup gates Save on holding payment_gateway on any object, for workflows as well as gateways: a session holding payment_workflow but not payment_gateway is shown a read-only workflow form the server would have let it save, and a session holding payment_gateway on one gateway only is offered Save on every gateway and refused by the server.
  • Without the permission Merchant Setup disables the settings form and replaces Save with a read-only message.
  • Archived records are read-only in Merchant Setup: the form is disabled, so Save never appears.
  • Single-provider deep links lock the app to one gateway and put this form and the checkout customisation on the same page; the save here behaves the same either way.

Related


Did this page help you?