Skip to content

Variables on CreatePaymentRequestParams #29

@ashansen

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

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