Skip to content

Variables on CreatePaymentRequestParams #29

Description

@ashansen

Hi.
I get a BadRequest when trying to use the Variables on CreatePaymentRequestParams
It might be a serialization issue caused by a previous change from e.g. NewtonSoft to System.Text.Json.

For example:

createPaymentParams.variables = [
    new { name = "Test Name"},
    new { street = "Test Street"}
];

This serializes to:
"variables":[{"name":"Test Name"},{"street":"Test Street"}]

And that returns BadRequest from Quickpay API:
{"message":"Validation error","errors":{"variables":["is invalid"]},"error_code":null}

If I change variables to be object and parse in Dictionary<string, object> and do the similar

createPaymentParams.variables = new Dictionary<string, object>()
    {
            { "name","Test Name"},
            { "street","Test Street"}
    }; 

I get serialized to:
"variables":{"name":"Test Name","street":"Test Street"}

And this request works for Quickpay, and I can see the variables in the management view.

Image

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions