-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.cpp
33 lines (26 loc) · 971 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* Author: Zadock Maloba
* E-mail: zadockmaloba@outlook.com
* Twitter: zadock_254
* copyright: Zadock Maloba, 2022
*/
#include <QCoreApplication>
#include "networkhandler.h"
#include "accesstokenrequest.h"
#include "registerurlrequest.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
DarajaCpp::NetworkHandler netH;
//process the request
//arg1: consumerKey , arg2: consumerSecret
DarajaCpp::AccessTokenRequest _acc(""/*Enter consumer key*/,""/*Enter consumer secret*/);
DarajaCpp::RegisterUrlRequest _url(""/*Generated accessToken*/);
_url.setRequestBody({{"ShortCode",""/*Business ShortCode*/},
{"ResponseType",""/*Completed or Canceled*/},
{"ConfirmationURL",""/*url to confirmation server*/},
{"ValidationURL",""/*url to validation server*/}});
_acc.renderRequest(&netH);
_url.renderRequest(&netH);
return a.exec();
}