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

Add missing recipients.create type #218

Open
chuwong35122 opened this issue Jun 30, 2024 · 1 comment
Open

Add missing recipients.create type #218

chuwong35122 opened this issue Jun 30, 2024 · 1 comment
Assignees
Labels

Comments

@chuwong35122
Copy link

chuwong35122 commented Jun 30, 2024

Expected behavior

According to this documentation, bank_account.number existed and is a required value for recipients creation. This is the expected code (with no errors).

const recp = await omise.recipients.create({
    name: "Somchai Prasert",
    email: "[email protected]",
    type: "individual",
    bank_account: {
      brand: "bbl",
      number: "1234567890",
      name: "SOMCHAI PRASERT",
    },
  });

  console.log(recp);

Actual behavior

Upon completing the omise.recipients.create 's parameter, the following type error occurs...

Object literal may only specify known properties, and 'number' does not exist in type 'IBankAccount'.ts(2353)
index.d.ts(621, 7): The expected type comes from property 'bank_account' which is declared here on type 'IRequest'

The IBankAccount object type is missing its number property.

Update: It seems like the Omise.Recipients object type is missing several attributes written in the documentation.

interface IRequest {
      name: string;
      email?: string;
      description?: string;
      type: string;
      tax_id?: string;
      bank_account: IBankAccount;
      metadata?: { [key: string]: any };
    }

  interface IBankAccount {
    object: string;
    brand: string;
    last_digits: string;
    name: string;
    created: string;
  }

Steps to reproduce the issue

Using "omise": "^0.12.1" installed using bun

Logs

This is only a type error, filling complate type ensures good developer experiences.

Screenshots

No response

Name and version information

bun --version: 1.1.3
node --version: v20.10.0

Using Macbook Air M1
❯ sw_vers
ProductName: macOS
ProductVersion: 14.0
BuildVersion: 23A344

❯ uname
Darwin

@aashishgurung
Copy link
Contributor

@chuwong35122 Thank you for reaching out. We are aware of this issue and working on it. We will provide an update when we resolve this. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants