php - facebook, credits payment process error, how to? - Stack Overflow

admin2025-04-22  0

I implement the example from facebook credits, and create an test app, added the callback.php in the Callback Url, place my 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 a few buttons with different monetary values. Like:

Click to get 100 credits
Click to get 1000 credits

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

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 monetary presets I think 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 got it right.

Can anyone push me in the right direction?

I implement the example from facebook credits, and create an test app, added the callback.php in the Callback Url, place my 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 a few buttons with different monetary values. Like:

Click to get 100 credits
Click to get 1000 credits

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

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 monetary presets I think 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 got it right.

Can anyone push me in the right direction?

Share Improve this question edited Apr 16, 2013 at 11:47 franzlorenzon 5,9436 gold badges37 silver badges58 bronze badges asked Sep 16, 2011 at 20:51 PatrioticcowPatrioticcow 27.1k76 gold badges221 silver badges340 bronze badges 1
  • even I am facing the same problem. I was trying to debug the code and all suddenly it started popping the dialog and after I some time it started giving the same error. so I am not sure what is happening – dejjub-AIS Commented Mar 10, 2012 at 8:34
Add a ment  | 

2 Answers 2

Reset to default 2 +300

Yeah, you'll have to have your users select the item they want to purchase, which will then call the buyMore function to have them confirm their purchase via the Credits dialog (like you're doing in your second example).

First thing I'd do is check my Credits setting in the Developer app though. I've gotten that error before on a new app before realizing I'd forgotten to set my credits callback URL or set my user as a Credits test user.

Why are you asking the user to buy a set number of credits?

Surely it's an easier flow if you ask the user to buy an item (priced in credits) and Facebook handles the step of the user buying the necessary credits themselves?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745251522a292534.html

最新回复(0)