Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateBrandingThemePaymentServices should expect an array of payment services, not a single payment service #605

Closed
Assignees

Comments

@applecran
Copy link

applecran commented Oct 4, 2022

  • Version observed in 4.5.1 to current

Describe the bug
The api docs, and my testing show that this function should be posting an object with an array of Payment Services in it, and not a single payment service.
(https://developer.xero.com/documentation/api/accounting/brandingthemes#post-paymentservices)

The api is expecting the body to be:

{
"PaymentServices": [{
  "PaymentServiceID": "de5c978d-3cbf-4ebb-9ca9-20d7cb196ab1"
  }]
}

But it's currently sending:

{
"PaymentService": {
  "PaymentServiceID": "de5c978d-3cbf-4ebb-9ca9-20d7cb196ab1"
  }
}

line 966 of accountingApi.ts should be changed from
body: ObjectSerializer.serialize(paymentService, "PaymentService")
to
body: ObjectSerializer.serialize(paymentService, "PaymentServices")

Ideally we'd change the parameter name to paymentServices and line 966 to
body: ObjectSerializer.serialize(paymentServices, "PaymentServices").

@RettBehrens
Copy link
Contributor

Hey @applecran good catch. I've just tested this in the sample app and confirmed the API accepts both formats 🤔

We'll look to update the SDK method so it reflects the docs and accepts an array of PaymentServices.

I just want to confirm with the API team regarding expected behavior before releasing the change

@RettBehrens
Copy link
Contributor

Sorry, github auto closed this issue. Will update/close once the updated SDK has been released

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