Skip to content

fix: WR-18424 support the payload attribute being received as a serialized JSON object - #17

Merged
DustinK-retailsuccess merged 1 commit into
mainfrom
fixes/WR-18424-support-serialized-payload-attribute
Jun 5, 2026
Merged

DustinK-retailsuccess merged 1 commit into
mainfrom
fixes/WR-18424-support-serialized-payload-attribute

Conversation

@DustinK-retailsuccess

@DustinK-retailsuccess DustinK-retailsuccess commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

The following test message was received and logged the following error message.

This adjusts our logic to align with the expected payload. ProPay indicates this difference from their docs was caused by the payload being encrypted on their side and they hadn't seen the output exercised yet to understand the change in output.

NOTE: This also adjusts what we store to just be the payload attribute of the detail received in the webhook. The other attributes on the detail seem irrelevant or redundant from the information we already track for a ProPay enabled store.

{"version":"0","id":"ad917211-80b0-12f4-e6c2-6ed93c2f8c0b","detail-type":"merchantware.credentials.created","source":"propay.webhook","account":"203538442868","time":"2026-06-05T21:05:00Z","region":"us-east-1","resources":[],"detail":{"notificationId":"e7982070-8c25-448f-a6c4-dc63d8e4eae0","eventType":"merchantware.credentials.created","eventDateTimeUTC":"06/05/2026 21:04:57","payload":"{\"accountNum\":1234564789,\"merchantId\":123456789,\"merchantName\":\"Kurt T2P Test\",\"tapToPay\":{\"terminalId\":10000036,\"activationCode\":\"some-redacted-code\",\"merchantSiteId\":\"1QH5PTEV\",\"merchantKey\":\"AUDKZ-4I0SS-SJBN2-UD6DW-JCCZW\"}}"}}
{
    "Timestamp": "2026-06-05T21:05:03.0940340+00:00",
    "Level": "Error",
    "MessageTemplate": "Unrecoverable error processing message. Dead-lettering.",
    "Exception": "System.InvalidOperationException: The requested operation requires an element of type 'Object', but the target element has type 'String'.\n   at System.Text.Json.ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)\n   at System.Text.Json.JsonDocument.TryGetNamedPropertyValue(Int32 index, ReadOnlySpan`1 propertyName, JsonElement& value)\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.Gateways.Propay.PropayConfigurationParser.TryReadDetail(String body, String& detailJson, Int64& accountNumber) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/Gateways/Propay/PropayConfigurationParser.cs:line 47\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.Gateways.Propay.PropayConfigurationParser.Parse(String rawWebhookBody) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/Gateways/Propay/PropayConfigurationParser.cs:line 20\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.PaymentConfigurationMessageHandler.Handle(SQSMessage message, CancellationToken cancellationToken) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/PaymentConfigurationMessageHandler.cs:line 39\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.Function.FunctionHandler(SQSEvent input, ILambdaContext context) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/Function.cs:line 54",
    "Properties": {
        "SourceContext": "Wayroo.Payments.ConfigurationRecorder.Lambda.ProcessFailureHandler",
        "MessageId": "0d18262e-0223-4aea-be9b-a40adcf8b90a",
        "TraceId": "Root=1-6a2339fc-9aadf74b36463538912b22f7;Parent=734b0a00ef7eff47;Sampled=0;Lineage=1:008a1e6d:0",
        "FunctionName": "dev-WayrooPayments-ConfigurationRecorderLambda",
        "AwsRequestId": "64ca1f07-c0d5-5f12-82f6-7d9afcfae41d",
        "InvokedFunctionArn": "arn:aws:lambda:us-east-1:203538442868:function:dev-WayrooPayments-ConfigurationRecorderLambda",
        "Scope": [
            "0d18262e-0223-4aea-be9b-a40adcf8b90a",
            "0d18262e-0223-4aea-be9b-a40adcf8b90a"
        ]
    }
}

steven-palomino
steven-palomino previously approved these changes Jun 5, 2026
@DustinK-retailsuccess
DustinK-retailsuccess force-pushed the fixes/WR-18424-support-serialized-payload-attribute branch from 659f8c1 to 5a99457 Compare June 5, 2026 22:11
steven-palomino
steven-palomino previously approved these changes Jun 5, 2026
@DustinK-retailsuccess
DustinK-retailsuccess force-pushed the fixes/WR-18424-support-serialized-payload-attribute branch from 5a99457 to 7250bf7 Compare June 5, 2026 22:20
steven-palomino
steven-palomino previously approved these changes Jun 5, 2026
@DustinK-retailsuccess
DustinK-retailsuccess force-pushed the fixes/WR-18424-support-serialized-payload-attribute branch from 7250bf7 to 64698e4 Compare June 5, 2026 22:27
@DustinK-retailsuccess
DustinK-retailsuccess merged commit fa54eed into main Jun 5, 2026
7 checks passed
@DustinK-retailsuccess
DustinK-retailsuccess deleted the fixes/WR-18424-support-serialized-payload-attribute branch June 5, 2026 22:31
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.

2 participants