Our server uses the PHP SDK to validate subscription purchases.
https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get
Is it possible to view purchase history on the server side via the SDK, or some endpoint? Basically I'm looking for a way to get the subscription order number.
There is currently no API or endpoint that you can call/use to retrieve subscriptions/purchases history for Google Play.
AFAIK, the expected procedure for this is for developers to keep track of the history on their end by storing and keeping track of the orderIds and purchaseTokens accordingly on their side.
Related
I am writing the PHP back-end API for an Android application. The Android sends me purchase token, product name, etc and then I make this call : Purchases.products
I then acknowledge the purchase using : Purchases.products: acknowledge
Then after successfully processing the transaction on PHP API side, I would need to change the 'consumptionState' of the transaction on Google Play side to indicate that this (consumable) product has been been consumed. But nowhere can I find any example of the call needed to change the 'consumptionState'. I use google/apiclient package for the interaction with Google Play.
Can someone point me in the right direction with regards to changing 'consumptionState' for a Google Play Billing purchase?
I have a website coded in PHP that uses paypal buttons/IPN for subscriptions.
The method is limited and I need to replace it with the REST-API.
What the system needs to do:
Accept new user recurring-payment subscriptions
Be able to change plan pricing for new users
Be able to change plan pricing for existing users
Change subscription plans mid-subscription(If a user upgrades from pro to master the price goes up, and the opposite way it goes down).
The price difference between packages is 5$
Give periodic discounts for a limited amount of months.
The questions:
1.) What is the equivalent of recurring-payments in the PHP-API or REST-API? (I'd rather it auto-charges and notifies my IPN if possible)
2.) How can I automatically refund/charge an additional amount when the user upgrades/downgrades in the middle of a month?
3.) Is there a standalone PHP control-panel that can connect to the paypal API to manage the subscription packages + sales?
Thanks in advance!
If you are looking to use REST APIs, the best place to start is going to be at the REST API docs. For your situation, you can use the vault to set up a recurring payment system. You could also use the future payments API, but you will need to make sure you buy DPRP for your account. Contact PayPal Customer Support to enable DPRP.
With the Vault API, you can just create one time payments over and over with the token you get when storing a credit card.
There is an in-depth walkthrough using the SDK on the PayPal PHP SDK Wiki.
To do refunds, you can use the Refund REST API. All this assuming that you would be writing scripts to detect your user downgrading/upgrading. You would just need to store the amount they are paying each month in your DB.
There are some shopping carts out there that are implementing REST APIs. You might need to google search for something like that.
Hope that helps and gets you started in the right direction!
I have a Paypal Account Type: Personal
I don't want to be Business account or anything else.
Is there a way to get a list of last payments ? Maybe there is some API for personal account ?
The only way I see to get what I want, is create a php script which will imitate browser, login to web, go to History and get the last payments.
Thanks
You can only get access to the APIs using a premier or business account.
As for a PHP script - you can certainly get it to work.
However, if you do not take care of simulating a browser access 100%, PayPal MAY detect an unauthorized account access and lock the account down.
My advice would be to upgrade to a premier account and avoid the hacks.
Once you've got a premier account, you can use the TransactionSearch and GetTransactionDetails API calls in order to retrieve a list of payments (note that this can be a bit of a headache to handle too)
Per Facebook credits documentation.
Get Order
Gets order details for the specified order_id
API
GET https://graph.facebook.com/[order id]?access_token=ACCESS_TOKEN
Note: You must use actual orders when calling the Graph API. Orders from test users will not be processed.
How do we test this call on dev apps? Is the only way to test this by making real Facebook credits purchases on the app? I would rather user $facebook->api_client->getOrderDetails if that is the case.
In short. Yes.
I've built a App that in theory works and the transaction completes with me in test mode. But I've not put any real transactions through yet.
It depends what you are selling as the calls Facebook makes to you and expects from you are "as if live".
They just don't get entered into the Graph for Calling by this method.
I am using the Google Checkout API to code a simple store. I have gotten as far as letting the user select items, edit the cart, and checkout/pay with Google Checkout. The notification API (with XML) is being used to read notifications sent by Google after receiving orders. How can I connect the order notifications with the orders information in my SQL database? Can I send an "order ID" or something like that to Google with the initial order? I have coded that portion (ordering) with the HTML API.
Thanks in advance!
When an order is placed, a notification is made giving you a serial number for the order. You need to store this serial number in your database against whatever internal order number you have, so that you can use the serial number to refer to the order with Google Checkout via the Notification API.
No. Notification and Polling are two separate concepts.
Notification is when Google Checkout sends you info as it occurs, and Polling is when you send a request for sale details at some time in the future.
Documentation for Polling is lacking on-line. That is why you - and I - have not found the answer.
Google sends an e-mail when a sale is made (or when something goes wrong with a payment), and it stores some detail in your dashboard. You can use the date or the number to Poll for the rest of the details. Exactly how to do that is lacking in the on-line documentation.
Use the merchant-private-data field to pass any custom data about your order.
When you get back the notification, read the custom info from the merchant-private-data field.
See this answer for a solution to a similar issue.