Skip to content

BTePOS: sanitise customer and address data in the orderBundle - #133

Closed
rmcotton-sap wants to merge 2 commits into
SAP-samples:mainfrom
rmcotton-sap:btepos-sanitise-orderbundle
Closed

rmcotton-sap wants to merge 2 commits into
SAP-samples:mainfrom
rmcotton-sap:btepos-sanitise-orderbundle

Conversation

@rmcotton-sap

@rmcotton-sap rmcotton-sap commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Customer and address values in the orderBundle are cleaned before they are sent to BTePOS:

Value Handling
", \ and control characters escaped with ?json_string; line breaks become a space
city, postAddress truncated to 50 characters; a longer street continues in postAddress2
postalCode truncated to 16 characters
phone digits only
all values percent-encoded with functions.encodeURL

Romanian diacritics are sent unchanged.

Changes

  • postman/btepos/PAYMENT_PAGE/BTePOS_mapping_configuration.json

Testing

Tested against the BTePOS sandbox with 43 address variants (special characters, long values, phone formats, diacritics). All were accepted by BTePOS.

🤖 Generated with Claude Code

rmcotton-sap and others added 2 commits October 13, 2026 09:10
The loyalty leg of a split payment fetched the account group with a GET on
/opf/merchant/transactions?expand=accountGroup and passed it on through a custom field.

The verify context now exposes the Payment Integration ID smart field, which is the account
group. Map accountGroupId to ${input.paymentIntegrationId} and drop the lookup call and the
loyAccountGroupId custom field. The verify block goes from four calls to three.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
BTePOS rejected a payment, or answered with an HTML page instead of JSON, for ordinary
address data. Measured against the sandbox through OPF initiate:

- a double quote, a backslash or a line break in an address broke the hand-built JSON
- a city or street over 50 characters, and a phone with +, spaces or brackets, were rejected
- an & or % in any value returned an HTML error page, because the value is not encoded

The orderBundle expression now replaces the characters that break the JSON, transliterates the
Romanian diacritics as the iPay documentation asks, truncates to the documented lengths and
continues a long street in postAddress2, keeps only digits in the phone, and percent-encodes
every value. It uses no <#function>, which the OPF template engine does not render, and stays
within the 2048-character limit of a mapping expression.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@rmcotton-sap

Copy link
Copy Markdown
Contributor Author

Folded into #132: its branch now carries this commit (99d2202), so this separate PR would duplicate it. Closing in favour of #132.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant