Facebook credit process error process how?

I am implementing an example from credits on facebook and building a test application by adding callback.php to the callback.php url, put your keys correctly. but I get this error:

 Sorry, but we're having trouble processing your payment. You have not been charged for this transaction. Please try again. 

I am trying to create several buttons with different monetary values. How:

 Click to get 100 credits Click to get 1000 credits 

If I use this common code, I get the payment window just fine, but I don’t see my products there, I can only choose from presets already made:

 function buyMore(){ // calling the API ... var obj = { app_id: 'xxxxxxxxxxxxxxxxxxxxx', method: 'pay', order_info: n, purchase_type: 'item', credits_purchase: true }; 

To show the user my money presets, it seems to me that I need to pass different values ​​to the function:

 <p><a onclick="buyMore('100'); return false;">Buy More Credits 100</a></p> <p><a onclick="buyMore('1000'); return false;">Buy More Credits 1000</a></p> function buyMore(price) { var order_info = { "title":'title', "description":'description', "price":price, "image_url":'http://....img_url', "product_url":'http://....product_url' }; // calling the API ... var obj = { app_id: '153230661424821', method: 'pay', order_info: order_info, purchase_type: 'item' }; } 

Not sure if I understood correctly.

Can someone push me in the right direction?

+6
source share
2 answers

Yes, you will have to have your users select the item they want to purchase, and then call the buyMore function to confirm their purchase through the Credits dialog (for example, you do in your second example).

The first thing I would do is check the settings of my loans in the application for developers. I got this error earlier in a new application before realizing that I forgot to set a callback URL for my credits or set my user as a user of the Credits test.

+2
source

Why are you asking the user to buy a certain amount of loans?

Undoubtedly, this is an easier flow if you ask the user to buy goods (on loans), and Facebook handles the step of the user who buys the necessary loans?

+1
source

Source: https://habr.com/ru/post/897497/


All Articles