Skip to content

201 Respones Code, but Error in response parsing #13

@markus-gx

Description

@markus-gx

Environment: Sandbox
Payment Type: EPS Payment (Austria)

Error:

The response did not match the response schema.

Some properties are missing in the object: "country_code".

Given value: {"national_number":"43158850"}
Type: 'object'
Expected type: 'Optional<Lazy<Object<{countryCode,nationalNumber}>>>'
Path: purchase_units › 0 › shipping › phone_number

  
  Some properties are missing in the object: "country_code".
  
  Given value: {"national_number":"43158850"}
  Type: 'object'
  Expected type: 'Optional<Lazy<Object<{countryCode,nationalNumber}>>>'
  Path: purchase_units › 0 › shipping › phone_number
  at new ResponseValidationError (node_modules/@apimatic/core/lib/errors/responseValidationError.js:22:24)
  at resInvalidErr (node_modules/@apimatic/core/lib/http/requestBuilder.js:508:16)
  at node_modules/@apimatic/core/lib/http/requestBuilder.js:510:68
  at validateJson (node_modules/@apimatic/core/lib/http/requestBuilder.js:515:15)
  at parseJsonResult (node_modules/@apimatic/core/lib/http/requestBuilder.js:510:12)
  at DefaultRequestBuilder.<anonymous> (node_modules/@apimatic/core/lib/http/requestBuilder.js:292:104)
  at step (node_modules/tslib/tslib.js:196:27)
  at Object.next (node_modules/tslib/tslib.js:177:57)
  at fulfilled (node_modules/tslib/tslib.js:167:62)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

The error occurs only with EPS payment method. Payment via PayPal works.
The response is a 201 Status Code and based on the Paypal Debug Logs in the Web-Panel the response is correct.
Seems like the parser has a bug :)

Code which is failing:

 const collect = {
    id: orderId,
    prefer: 'return=minimal',
  }

  try {
    const { body } = await PaypalOrdersController.ordersCapture(collect) //Fail here. 

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