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

Type not specific enough for getPaymentsByPaymentMethodId #219

Open
devcsrj opened this issue Jun 6, 2024 · 0 comments
Open

Type not specific enough for getPaymentsByPaymentMethodId #219

devcsrj opened this issue Jun 6, 2024 · 0 comments

Comments

@devcsrj
Copy link

devcsrj commented Jun 6, 2024

/**
* 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'
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant