The SDK can be configured in a few ways.
FieldOptional / RequiredDescription
gr4vyIdRequiredThe Gr4vy ID automatically sets the apiHost to api.mattildapayments.com for production and api.sandbox.mattildapayments.com and to embed.sandbox.mattildapayments.com for the sandbox environment.
tokenRequiredThe server-side generated JWT token which will be used to authenticate any of the API calls.
environmentOptional.sandbox, .production. Defaults to .production.
amountRequiredThe amount to authorize or capture in the specified currency only.
currencyRequiredA valid, active, 3-character ISO 4217 currency code to authorize or capture the amount for.
countryRequiredA valid ISO 3166 country code.
buyerIdOptionalAn optional ID for a buyer. The transaction will automatically be associated with a buyer with that ID. If no buyer with this ID exists then it will be ignored.
buyerExternalIdentifierOptionalAn optional external ID for a buyer. The transaction will automatically be associated to a buyer with that external ID. If no buyer with this external ID exists then it will be ignored. This option is ignored if the buyerId is provided.
presentingViewControllerRequiredThe view controller that opens the payment sheet.
externalIdentifierOptionalAn optional external identifier that can be supplied. This will automatically be associated to any resource that opens the payment sheet and subsequently used to find a resource by that ID.
storeOptional'ask', 'preselect', true, false - Explicitly store the payment method, ask the buyer or preselect it by default. Requires buyerId or buyerExternalIdentifier.
displayOptionalall, addOnly, storedOnly, supportsTokenization - Filters the payment methods to show stored methods only, new payment methods only or methods that support tokenization.
intentOptionalauthorize, preferAuthorize, capture - Defines the intent of this API call. This determines the desired initial state of the transaction. When used, preferAuthorize automatically switches to capture if the selected payment method doesn’t support delayed capture.
metadataOptionalAn optional dictionary of keys and values for transaction metadata. All values should be a string.
paymentSourceOptionalinstallment, recurring - Can be used to signal that Embed is used to capture the first transaction for a subscription or an installment. When used, store is implied to be true and display is implied to be supportsTokenization. This means that payment options that do not support tokenization are automatically hidden.
cartItemsOptionalAn optional array of cart item objects, each object must define a name, quantity, and unitAmount. Other optional properties are discountAmount, taxAmount, externalIdentifier, sku, productUrl, imageUrl, categories and productType.
applePayMerchantIdOptionalThe Apple merchant ID to be used during Apple Pay transactions.
debugModeOptionaltrue, false. Defaults to false, this prints to the console.
themeOptionalTheme customization options See Theming Options. The SDK also contains an additional two properties within the colors object: headerBackground and headerText. These are used for the navigation background and foreground colors.
localeOptionalAn optional locale, this consists of a ISO 639 Language Code followed by an optional ISO 3166 Country Code, e.g. en, en-gb or pt-br.
requireSecurityCodeOptionalAn optional boolean which forces security code to be prompted for stored card payments.
shippingDetailsIdOptionalAn optional unique identifier of a set of shipping details stored for the buyer.
merchantAccountIdOptionalAn optional merchant account ID.
connectionOptionsOptionalAn optional set of values passed to a connection when processing a transaction (see New transaction)