I am building an online store, I am using paystack payment gateway, in the api, I am trying to run a function inside the payment gateway api but it's not working. Here is the code:
payWithPaystack(returnData, amount){
const binded = this.service.completePayment.bind(this)
var handler = PaystackPop.setup({
key: '.......',
email: this.details.email,
amount: amount,
currency: "NGN",
ref: `ref-${Math.ceil(Math.random() * 10e13)}`,
metadata: {
custom_fields: [{
display_name: this.details.firstName+' '+this.details.lastName,
variable_name: "mobile_number",
value: this.details.phoneNumber
}]
},
callback(res){
console.log(res)
binded(res);
},
onClose(){
console.log('window closed');
this.color='danger'
this.payDisplay='Transaction closed'
this.payClick=false
}
});
handler.openIframe();
}
in the service page here is the code
completePayment(sentData){
console.log('enter')
this.http.post(`${this.ApiURL}payAm.php`, sentData, {headers:this.headers})
.subscribe(data=>console.log('ok'), error=>console.log(error))
}
Now the issue is that the function completePayment is calling partially, the console.log is running, but its not sending the http request, pls how can i solve this issue