File tree Expand file tree Collapse file tree 5 files changed +88
-0
lines changed
src/api/virtual-terminal/remove-split-code Expand file tree Collapse file tree 5 files changed +88
-0
lines changed Original file line number Diff line number Diff line change 1+ languages :
2+ - sh
3+ - js
4+ - php
Original file line number Diff line number Diff line change 1+ const https = require ( 'https' )
2+
3+ const params = JSON . stringify ( {
4+ "split_code" : "SPL_98WF13Zu8w5"
5+ } )
6+
7+ const options = {
8+ hostname : 'api.paystack.co' ,
9+ port : 443 ,
10+ path : '/virtual_terminal/:code/split_code' ,
11+ method : 'DELETE' ,
12+ headers : {
13+ Authorization : 'Bearer SECRET_KEY' ,
14+ 'Content-Type' : 'application/json' ,
15+ }
16+ }
17+
18+ const req = https . request ( options , res => {
19+ let data = ''
20+
21+ res . on ( 'data' , ( chunk ) => {
22+ data += chunk
23+ } )
24+
25+ res . on ( 'end' , ( ) => {
26+ console . log ( JSON . parse ( data ) )
27+ } )
28+ } )
29+
30+ req . on ( 'error' , error => {
31+ console . error ( error )
32+ } )
33+
34+ req . write ( params )
35+ req . end ( )
Original file line number Diff line number Diff line change 1+ <?php
2+ $ curl = curl_init ();
3+
4+ $ data = array (
5+ "split_code " => "SPL_98WF13Zu8w5 "
6+ );
7+
8+ curl_setopt_array ($ curl , array (
9+ CURLOPT_URL => "https://api.paystack.co/virtual_terminal/:code/split " ,
10+ CURLOPT_RETURNTRANSFER => true ,
11+ CURLOPT_CUSTOMREQUEST => "DELETE " ,
12+ CURLOPT_POSTFIELDS => json_encode ($ data ),
13+ CURLOPT_HTTPHEADER => array (
14+ "Authorization: Bearer SECRET_KEY " ,
15+ "Content-Type: application/json " ,
16+ "Cache-Control: no-cache "
17+ ),
18+ ));
19+
20+ $ response = curl_exec ($ curl );
21+ $ err = curl_error ($ curl );
22+ curl_close ($ curl );
23+
24+ if ($ err ) {
25+ echo "cURL Error #: " . $ err ;
26+ } else {
27+ echo $ response ;
28+ }
29+ ?>
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ url=" https://api.paystack.co/virtual_terminal/:code/split_code"
3+ authorization=" Authorization: Bearer SECRET_KEY"
4+ content_type=" Content-Type: application/json"
5+ data=' {
6+ "split_code": "SPL_98WF13Zu8w5"
7+ }'
8+
9+ curl " $url " -H " $authorization " -H " $content_type " -X DELETE -d " $data "
Original file line number Diff line number Diff line change 1+ {
2+ "400" : {
3+ "status" : false ,
4+ "message" : " Payment method does not exist" ,
5+ "meta" : {
6+ "nextStep" : " Ensure that you're passing the correct reference for the requested resource that exists on this integration"
7+ },
8+ "type" : " validation_error" ,
9+ "code" : " not_found"
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments