There is a payment system on my site.I agreed with an advertiser and he gave me a Facebook pixel id. I use this on the client side, it’s very easy , but in some cases I couldn’t figure out how to integrate this, for example in case of payment completion.The place where the payment takes place is firebase functions.
note : I was given only pixel id and script code.
offlinepayment in firebase function :
app.post('/offlinepayment', (req:any, res:any) => {
var re = new Promise((Resolve, Reject) => {
return iyzipay.checkoutForm.retrieve({
locale: Iyzipay.LOCALE.TR,
conversationId: '*******',
token: req.body.token
}, function (err:any, result:any) {
Resolve(result)
});
})
re.then(async (result:any)=>{
if (result.paymentStatus = "SUCCESS") {
//I want to perform facebook pixel operation here