1+ const sh = `#!/bin/sh
2+ url="https://api.paystack.co/transfer/export"
3+ authorization="Authorization: Bearer YOUR_SECRET_KEY"
4+
5+ curl "$url" -H "$authorization" -X GET
6+ `
7+
8+ const js = `const https = require('https')
9+
10+ const options = {
11+ hostname: 'api.paystack.co',
12+ port: 443,
13+ path: '/transfer/export',
14+ method: 'GET',
15+ headers: {
16+ Authorization: 'Bearer SECRET_KEY'
17+ }
18+ }
19+
20+ https.request(options, res => {
21+ let data = ''
22+
23+ res.on('data', (chunk) => {
24+ data += chunk
25+ });
26+
27+ res.on('end', () => {
28+ console.log(JSON.parse(data))
29+ })
30+ }).on('error', error => {
31+ console.error(error)
32+ })
33+ `
34+
35+ const php = `<?php
36+ $curl = curl_init();
37+
38+ curl_setopt_array($curl, array(
39+ CURLOPT_URL => "https://api.paystack.co/transfer/export",
40+ CURLOPT_RETURNTRANSFER => true,
41+ CURLOPT_ENCODING => "",
42+ CURLOPT_MAXREDIRS => 10,
43+ CURLOPT_TIMEOUT => 30,
44+ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
45+ CURLOPT_CUSTOMREQUEST => "GET",
46+ CURLOPT_HTTPHEADER => array(
47+ "Authorization: Bearer SECRET_KEY",
48+ "Cache-Control: no-cache",
49+ ),
50+ ));
51+
52+ $response = curl_exec($curl);
53+ $err = curl_error($curl);
54+
55+ curl_close($curl);
56+
57+ if ($err) {
58+ echo "cURL Error #:" . $err;
59+ } else {
60+ echo $response;
61+ }
62+ ?>
63+ `
64+
65+ export { sh , js , php }
0 commit comments