salutejs icon indicating copy to clipboard operation
salutejs copied to clipboard

PaymentError incorrect error_description type

Open a13xand9r opened this issue 3 years ago • 1 comments

В типизации объекта error, возвращаемого функцией createInvoice, видимо, неверно стипизировано поле error_description.

export interface PaymentError {
    /** Код ответа */
    error_code: PaymentReponseStatuses;
    /** Техническое описание кода ошибки / ответа */
    error_description: string;
    /** Описание кода ошибки / ответа */
    user_message: string;
}

По факту error_description - массив объектов:

error_description: [
    {
      keyword: 'format',
      dataPath: '.requestData.reqBody.invoice.purchaser.email',
      schemaPath: '#/properties/requestData/properties/reqBody/properties/invoice/properties/purchaser/properties/email/format',
      params: [Object],
      message: 'should match format "email"'
    }
  ],

a13xand9r avatar Sep 08 '21 12:09 a13xand9r