Skip to content

Latest commit

 

History

History
100 lines (65 loc) · 2.36 KB

README.md

File metadata and controls

100 lines (65 loc) · 2.36 KB

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