Facebook Credits API: refunding creates a new order id? - facebook

When I refund a specific order ID using the updateOrder() API, it correctly updates this order's status to 'refunded' as expected but also creates an entirely new order id also with a status of 'refunded'. This makes it look like a user has been refunded twice as much as they spent ... anyone know why this is? Or if it's documented anywhere in Facebook's amazing API docs?

Related

Paypal - Get the order identifier out of transaction identifier

I could not find info in the documentation on how to grab an order id out of the capture id that I receive from the daily transaction detail report. The only way I found was to check the links field in the capture after the capture gets the request, however, that does not seem like the best way to do it.
Does anyone know how to achieve it directly?
If you are using the Orders V2 API, the Order ID is only used during checkout approval. It is not persisted after transaction creation, and looking up captured payment details with the transaction/capture id: https://developer.paypal.com/docs/api/payments/v2/#captures_get , will not return the Order ID used during checkout, since it is not useful for anything at that point.

Facebook API Campaign Create

Some background...
I'm trying to create a Campaign using the graph.facebook.com API. When I post, I get an ID back, which I thought would most likely be the Campaign-id, when I do a Get, I am returned a list of ID's...presumably campaigns.
When I go the AdManager page to see all my campaigns there is nothing. I have tried searching Adverts and Adsets, but also nothing. I now have a list of Id's but no idea what they actually represent.
If I do a GET on one of Ids I was hoping I might get some further information about the object (node), but instead I just get the id back and nothing else.
The AdAccount I am POSTing the campaigns to is a SandBox account, not sure if this makes a difference.
...
Can anyone confirm whether or not the id I am receiving is likely to be the CampaignId?
Is there a special way to see campaign's created for a sandbox account?
Is there a further stage I need to complete to get the Camapigns to show up?
many thanks.

Facebook User vs Event (get RSVP status for user on event)

Is there any better way of checking RSVP status of user (logged in our application) vs. specific Event through Graph API, than calling /v2.3/{user_id}/events and going through all events to find the one we're interested into and get the rsvp_status field there?
What I've tried, and what didn't work:
/v2.3/{user_id}/events/{event_id}
/v2.3/{user_id}/events?event={event_id}
/v2.3/{user_id}/events?event_id={event_id}
calling all of them, to find out if user is in any of RSVP groups: /v2.3/{event_id}/{attending|invited|maybe|declined|noreply}?user={user_id}
Also FQL is not a solution, if anybody wants to C&P existing FQL answers, because that's deprecated since API v2.0
This related answer is also wondering about efficiency on using Graph API, because pulling all user's events and going through them is both time and resource expensive operation
Ok, so I found the answer, which is quite simple:
/v2.3/{event_id}/invited?user={user_id}
Currently this method will
return nothing, if user is not yet part of event (was never invited and never attended/maybe himself)
return one object, with user object and his rsvp_status
/invited (what we've seen from testing) contains both users that were invited to the event, and users that joined the event themselves (so don't get confused by the word invited, at least unless facebook changes the API again)

Payments Callback URL not being call after new local currency changes

After switching to the new Facebook local currency API the process is working, but
my server is not involve in the process so i really don't know if the user bought coins cause the payment callback URL is not being called now (using static payment).
I tried to use real time update to get Facebook data but can make it work, what is the best practice to involve the server in the process so it will be aware of the purchase?
I prefer for security reasons to get the update from Facebook and not from my client.
Ok after searching a log i found the solution
There are two primary methods through which you are notified of the outcome of the purchase, and a further method by which you can verify any payment information.
Firstly, Facebook will return details of the order via a JavaScript callback. The data sent to this callback includes:
payment_id, which uniquely identifies the transaction.
quantity, which indicates the amount of the item which was sold.
request_id, optionally, the developer can provide their own unique identification for the transaction when calling our Javascript SDK to render the payment dialog. This value is then returned upon purchase completion.
status, which indicates the current state of the transaction, i.e. 'pending', 'completed', 'failed' etc.
Secondly, Facebook will issue a realtime update notifying the developer that a new order has completed. The developer can subscribe to the payment_object callback to track order completions, using the payment_id as the unique identity parameter for each transaction.
Thirdly, at any time, the payment_id can be used to verify details of a transaction via the Graph API. Details such as the associated user_id, updated_time and amount can be queried, using the payment_id. The Graph API will also allow you to access further details including any refunds or disputes associated with the transaction.
If for some reason both the JavaScript callback and the realtime update fail and you do not receive the payment_id, we also allow you to query the Graph API using the optional request_id parameter, which can be specified by the developer when invoking the Facebook payment dialog.
please refer to:
https://developers.facebook.com/docs/concepts/payments/
and to:
https://developers.facebook.com/docs/howtos/payments/fulfillment/#rtu

facebook chargeback refund details

we are dealing with heavy chargebacks and refunds. But I am unable to identify how can I get the details of chargebacks and refunds. We have published our game through third party so they own the Company Account for transactions. We have asked them, but apparently they don't have anything to help us out. I have used Graph API to log the transaction details and I have also used the debug tool to find out the reason or details of chargebacks and refunds. but even our refunds does not have any reason attached with it. Please help me out of this. I have done alot of Google on this but i am unable to find out what I need to know
Regards.
All you will actually get is a “Refund Reason Code” – which of these there are, and how to access them, is described here:
https://developers.facebook.com/docs/payments/disputes/#refundcb_tracking
Edit:
It does not look like you can look up the refund reason code via the API – but Facebook will send it to you, via a ping to your callback URL:
“If the order has been refunded by Facebook, we will ping your callback with a payments_status_update for the order in questions with a status of refunded. In addition, there will be an additional field returned called refund_reason_code with one of the following values: […]”
So you will have to react to that and evaluate the refund reason code (save it to your database, …) in this callback.