Skip to content

TypeScript-based payment service integration with APIs for balance inquiries, payment link generation, and status tracking, supporting USD, LBP, and AED currencies.

License

Notifications You must be signed in to change notification settings

samish-dev/whish-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wish Payment SDK

A TypeScript SDK for interacting with the Wish Payment API.

Installation

npm install whish-payment-sdk

Error Handling

The SDK throws a custom WishPaymentApiError when an API request fails. This error contains the following properties:

  • message: A human-readable error message.
  • statusCode: The HTTP status code of the response.
  • code: An API-specific error code (if available).
  • details: Additional error details (if available).

Example:

try {
  const balance = await client.getBalance();
} catch (error) {
  if (error instanceof WishPaymentApiError) {
    console.error("API Error:", error.toJSON());
  } else {
    console.error("Unexpected Error:", error);
  }
}

Example Output:

{
  "name": "WishPaymentApiError",
  "message": "Invalid API key",
  "statusCode": 401,
  "code": "UNAUTHORIZED",
  "details": null
}

About

TypeScript-based payment service integration with APIs for balance inquiries, payment link generation, and status tracking, supporting USD, LBP, and AED currencies.

Resources

License

Stars

Watchers

Forks

Packages

No packages published