opentok videocall and payment intergartion does not working in same window? - paypal

I am working on opentok video call and set time limit for call.
I am looking for functionality where User, before call disconnects the user can pay(Using paypal) and continue call.
How I can get payment response from paypal in other window to opentok calling window without disconnect to session...

Related

Does FCM push notification registration need to be done once or each time the app is opened

I'm using PushNotifications of capacitor for ionic app to send FCM (firebase cloud messages).
The PushNotifications.register() is needed to trigger the 'registration' event with the push token. When the 'registration' event received we use PushNotifications.addListener('registration',()) to get the token and keep it in order to use it to send FCM.
It seems to me these actions need to be done only once, but I saw somewhere that the token is changed from time to time so maybe this is the reason I saw several examples that do this registration each time the app is opened.
What is the right approach? do it once or each time the app is opened?

Facebook Messenger apps repeated calls to webhook complicating my debug procedures

I'm currently developing my fist bot.
When I add a breakpoint somewhere in the code of my bot application, send a message from my Facebook page, and debugger stops at that point, after some seconds the debugger stops at that point again, making the debug procedure very complicated.
I understand this happens since I didn't acknowledge the message was received by returning a status code 200, and for that reason my Facebook Messenger application keeps sending the same request.
Is there a way to set up my Facebook Messenger application so that it only calls my webhook once, or to increase the period of time my webhook is called?
Otherwise, are there any suggestions overcome this?
Only option really is to send the 200 as soon as the webhook receives a message while you are debugging, so that you can step through any of your message processing.

Payments in our game stopped working, "object does not exist"

Our in-game transactions suddenly stopped working properly in one of our games. When a player tries to buy something, they are charged, but then an unknown error occurs and the player is not provided the items they tried to purchase.
Here is the screenshot: https://i.gyazo.com/e7beb162e9e94c9dd50008f1e0b6b78c.png
According to our investigation, the object ID coming to our payment callback cannot be found, even through the Graph API explorer.
Here's an example:
Our server receives the following data from payment callback:
{"object":"payments","entry":[{"id":"1005703272873733","time":1479471429,"changed_fields":["actions"]}]}
We then send a request:
https://graph.facebook.com/PAYMENT_ID?access_token=APP_ACCESS_TOKEN
and receive an error message. The same error occurs in Graph API Explorer
The app name is Butterfly Miracle
App ID is 1186246188099014
This is a critical issue that cripples the game.
EDIT: The problem is still unresolved. We keep getting failed payments from the players. This is clearly a problem with Facebook servers that handle payment information. We need an answer from Facebook staff.
There are not any hidden ways for payment validating.
Facebook works with two alternative ways of validation:
when you user clicks on "Buy" button - FB.ui({"method": "pay" ... should be fired and your callback will receive data about current payment
in same time the Backend will receive request with payment data from Facebook Payment Service.
That error lies in how your Facebook app and server are configured.
You should check this:
If you are using Dynamic Pricing - check URL in Canvas Payments chapter and be sure your backend is sending correct response.
Check what Facebook knows about your product URL here: https://developers.facebook.com/tools/debug/ Sometimes facebook cache OLD product response - you can try to force cache clean by clicking Scrape again button. BTW: resolve all warnings here.
Canvas Payments chapter in FB app settings page should be configured correctly - try to click Test Callback Url - response should be OK
Try to make test payments and analyze client and backend logs. First of all catch client (js) response from FB.ui({"method": "pay"... and check it. Then analyze access_logs of the Backend (I don't know what are you using: it can be php-fpm, apache, nodejs, etc) - be sure the Backend correctly receives Payment Request from Facebook Payment Service and correctly process it - response status codes should be 200.
Just review again FB app_id and FB secret you typed in the Backend configuration. They should be equal to FB app settings.
If nothing helps - try to debug step-by-step requests that you are receiving from Facebook on test payments.

Twilio Recording after call initiated

I'm currently using the Twilio API in order to implement a call-recording feature for my app. I'm wondering whether it is possible to accomplish the following scenario.
Person A calls Person B, connection between the two is established
Person A would like to start recording the phone call and pushes a recording button
Call ends, Person A receives recording
I have tried the following:
Connect the two users so that they can talk to each other (Successful)
Use the REST API to modify the live call and put the TwiML record verb.(ref https://www.twilio.com/docs/api/rest/change-call-state#example-1)
Been stuck on step 2, whenever I try to redirect at all it just disconnects the call. Is there a proper way to inject TwiML messages while the call is going on using the rest API?

response to payments callback url after purchase using local currency (local currency breaking changes)

Do we get response to payments callback url after successfully purchasing using local currency automatically??
Is there any other way other than subscribing for real time updated in the above mentioned case to get response for successful purchase?
I was just researching the same thing.
The FB.ui callback will now have confirmation of purchase. You could use that, however since it executes on client side, it can be tempered with and is not reliable.
FB will still make a call to your specified callback URL (under FB app settings), however you need to subscribe to Real Time Updates from FB app settings. To subscribe, your callback page must respond to the challenge sent my FB.
Edit
Information on how to subscribe to RTU is here
https://developers.facebook.com/docs/howtos/payments/fulfillment/#rtu
This is the FB documentation on what you need to configure in your callback.php page https://developers.facebook.com/docs/reference/api/realtime/
It's beyond me why they wouldn't provide a complete example. It is buried in their blogs somewhere, but this post gives you everything you need:
https://developers.facebook.com/blog/post/2012/01/31/how-to--subscribing-to-data-changes-using-the-real-time-updates-api/