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:
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
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
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" };
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
All URIs are relative to https://api.xendit.co. For more information about our API, please refer to https://developers.xendit.co/.
Further Reading