I have an Android app that processes payments through Google Play (in-app billing) and the MPL from PayPal.
After I get an positive result in the activity I call a php script on the server to process the order.
I want the script to check if the payment is verified.
I found some information on the PayPal developers site, but since PHP is pretty new for me, I don't know how to 'translate' all that into PHP. So if there is some snippet somewhere, that would be great.
For google play in-app I should be able to check this POST:
www.googleapis.com/androidpublisher/v1.1/applications/{packageName}/inapp/{productId}/purchases/{token}
I couldn't find what the productId is, but I'm guessing it's the SKU I'm sending, and where to I get the token?
For PayPal, I found:
GET https://api.paypal.com/v1/payments/sale/{id}
curl -s --insecure
-H "X-PAYPAL-SECURITY-USERID: api_username"
-H "X-PAYPAL-SECURITY-PASSWORD: api_password"
-H "X-PAYPAL-SECURITY-SIGNATURE: api_signature"
-H "X-PAYPAL-REQUEST-DATA-FORMAT: NV"
-H "X-PAYPAL-RESPONSE-DATA-FORMAT: NV"
-H "X-PAYPAL-APPLICATION-ID: app_id"
https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails -d
"payKey=AP-3TY011106S4428730
&requestEnvelope.errorLanguage=en_US"
I'm not sure how to use this in PHP and how to deal with the certificate when using this form my server. It also seems like depending on the use of a PayPal account or a credit card you should use different verifications, how do I know which method the user used?
Some example code would help me a lot, I'm using PHP.