facebook, credits payment process error, how to?
Asked Answered
P

2

6

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?

Preterite answered 16/9, 2011 at 20:51 Comment(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 happeningAcquirement
M
2

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.

Marnie answered 20/9, 2011 at 16:22 Comment(0)
M
1

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?

Minnick answered 20/9, 2011 at 22:22 Comment(2)
in any case, i still need some working code. i don't want to use the credits_purchase at allPreterite
@Minnick Its not the answer, its more like suggestion, which I would add as a comment to OPAcquirement

© 2022 - 2024 — McMap. All rights reserved.