Skip to content

Commit 074161b

Browse files
committed
paystack function done
1 parent c72c756 commit 074161b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

payment gateway/config/paystack.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,23 @@ const paystack=function(request){
1818
}
1919
request.post(options,callback);
2020
};
21+
22+
2123
const verifypayment=function(ref,cb){
22-
24+
25+
const options = {
26+
url : 'https://api.paystack.co/transaction/verify/'+encodeURIComponent(ref),
27+
headers : {
28+
authorization: secretkey,
29+
'content-type': 'application/json',
30+
'cache-control': 'no-cache'
31+
}
32+
}
33+
const callback=(err,response,body)=>{
34+
return cb(err,body);
35+
};
36+
request(options,callback);
2337
};
2438
return {initializepayment,verifypayment};
25-
}
39+
}
40+
module.exports=paystack;

0 commit comments

Comments
 (0)