Skip to content

Type not specific enough for getPaymentsByPaymentMethodId #219

@devcsrj

Description

@devcsrj

/**
* Returns payments with matching PaymentMethodID.
* Returns payments with matching PaymentMethodID.
*/
async getPaymentsByPaymentMethodId(requestParameters: GetPaymentsByPaymentMethodIdRequest): Promise<object> {
const response = await this.getPaymentsByPaymentMethodIdRaw(requestParameters);
return await response.value();
}

Notice that the return type is object. Was expecting a proper type. Here's a sample payload I got:

{
  data: [
    {
      amount: 20.58,
      business_id: '65758dd48ce3112f63c41f2c',
      channel_code: 'QRPH',
      country: 'PH',
      created: '2024-06-05T10:24:47.265313Z',
      currency: 'PHP',
      id: 'pymt-12c3b34a-1343-4958-a2c0-011b4c61dc8f',
      instrument_id: 'qrpy_b04be677-82f9-40a1-9967-bfa8d7e72779',
      payment_detail: [Object],
      payment_method: [Object],
      payment_request_id: 'pr-dbede44c-25c3-4bd8-8188-2c8d2026928a',
      reference_id: '7c624c78-523f-4a40-9aed-40ef842d4e7b',
      status: 'SUCCEEDED',
      type: 'QR_CODE',
      updated: '2024-06-05T10:24:47.265313Z'
    }
  ],
  has_more: false,
  links: [
    {
      href: '/v2/payment_methods/pm-9a4fa574-a6f3-419d-ba16-348077337456/payments?limit=10&payment_request_id=pr-dbede44c-25c3-4bd8-8188-2c8d2026928a',
      method: 'GET',
      rel: 'first'
    }
  ]
}

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