Skip to content

haydaralaidrus/xendit-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xendit C/C++ SDK

Status: Development

The unofficial Xendit C/C++ SDK provides a simple and convenient way to call Xendit's REST API in applications written in C/C++.

  • Package version:

Getting Started

Prerequisites

Dependencies

Compiling and Installation

For an out-of-source build, create a build directory and change to it:

mkdir build && cd build

Run CMake to configure the build system and compile:

cmake .. && make

Or to build it with debugging symbols and disabled compiler optimizations, run:

cmake -DCMAKE_BUILD_TYPE=Debug .. && make

To install it on the system, run:

make install

Testing

Prerequisites

  • CTest - Part of CMake package
  • Valgrind - Optional, for leak detection.

The testing is integrated with the CTest testing suite. Additionally, memory leak checking is integrated with Valgrind using the following flags: --leak-check=full --error-exitcode=1, ensuring that any leaks will be detected by CTest through the exit code.

Read more about testing with CTest

Authorization

The SDK needs to be instantiated using your secret API key obtained from the Xendit Dashboard. You can sign up for a free Dashboard account here.

#include <xendit/xendit.h>

xnd_client_t *client = xnd_client_new("XENDIT_API_KEY");
#include <xendit/xendit.hpp>

xnd::client client { "XENDIT_API_KEY" };

Compiling Your Program with Xendit C/C++ SDK

To compile your program with the static library libxendit-c-static.a, you'd typically use the following command:

gcc -o prog prog.c -lxendit-c-static

Documentation

All URIs are relative to https://api.xendit.co. For more information about our API, please refer to https://developers.xendit.co/.

Further Reading

About

Unofficial Xendit REST API Client for C/C++ - Balance, Invoice

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published