Send Notification to IOS app after payment transaction happpened through web client - php

I am creating a website as well as ios App. I implemented paypal and creadit card payment with it. Current scenario is when user open ios app and came at the point to purchase something. He'll select option either paypal or credit card. On selection of any option,respective window will open in web browser. After that user will input his credential for paypal/credit card. It will process input and generate some output like success response, failure response.
My problem is how to show or send that response message to ios app from web browser.
Push notification can be used for this but don't know how to implement it.

you can store the transaction result in the database (on the web server) and create a simple API that will enable your app to make a call to the web server, and get a response like "paid / not paid"

Related

Notification from web site (HTML Table) to Android application in real time without using GCM

I am developing an android application and website as well, in this i want to send notification in real time from Admin panel to specific android application user. The main problem is that using GCM (Firebase CM) there is a token generated from android application and stored it in the database, using this token we can send message from admin panel to android application user. Is there is way that we can receive/send notification without using "token" because e.g. "Teacher send notification to students from Website to Student android application teacher just select the registration name or section and just type what he want to send and click send button. Notification should receive to that particular user.
How we can do it? Can any body help me?
Use Android service and call API as a background and check new entry in notification table, if found new entry display it as a notification
Without Device Token you can not send any notification from Admin Panel to Android App. To send notification FCM needs a unique ID that is Device Token.
To resolve your query:
You can use Alarm Manager or a Background Service that will call your API to check have any new message of teacher in your DB, if have any new message then generate a notification with that message.
Only Background Service is not a complete solution, it will only call your check new message API.
Your Alarm Manager that will trigger at any given time duration e.g. 30 sec and call your Background service.
That can help you without token.

How to send Mobile Application Link For iOS and Android In SMS API from PHP?

I have query about SMS API. I am aware about the SMS Gateway Integration Using SMS API
But my question is how to redirect the user to the respective marketplaces (Google Play and iOS app store) from the link sent via SMS gateway
Well I found some solution for redirecting users to there respective marketplaces.
Solution 1
Use third party tools which give you a single link to send via SMS and when user click on that link they will redirect to there market places.
below are some link which help you to get that Single link for your Mobile Application.
One Link
Branch Metrics
many more
Solution 2
Make a web page where you have to check user's device and Conditions to redirect user to there application store. Send Web Page Link in SMS.
Hope this will help Some one.

Authorize.net Get Transaction ID from Server Integration Method

I want to integrate my application with Authorize and I need to get the transaction ID to save this information in database. The question is, can I do this with SIM? I know you can set a URL to get back to you homepage, but is it possible to send the transaction ID back to homepage?
You have two options:
Relay Response
Relay Response is a feature available to merchants using Server Integration Method (SIM) or Simple Checkout. It instructs the payment gateway to return transaction results to the merchant using an HTML form POST to a specified URL on the merchant's Web server. A script or program at the URL can be used to create a custom receipt page using the transaction information. The custom receipt page is then relayed back to the customer's browser. Relay Response does not redirect the end user back to the merchant’s server, but relays the page content to the end user instead of displaying the Authorize.Net default receipt page.
Silent Post
This feature allows you to specify a URL, or Web address, to which the payment gateway should copy the transaction response that is sent to the configured Relay Response URL. If you are not using Relay Response, the feature allows you to specify an additional URL to which transaction responses can be posted.
If you're looking for sample PHP code I wrote an article that includes that here.
My recommendation is to use Relay Response as it gives you an opportunity to customize the receipt page your user's see. (Although you can use both as they do not conflict with each other).
(I am the author of both Silent Post articles)

How can we use Google Play Service for back-end server validation?

I was following these articles: Verifying Back-End Calls from Android Apps and Stopping Vampires using License Verification Library (from 24:57 to 25:34) to implement an In-App Purchase verification system for our Android apps.
I am a bit confused about how this works end-to-end and what we can assume about the generated token from calling GoogleAuthUtil.getToken() with the first email address found--when AccountManager returns more than one account. My questions are as follows:
Should we assume that any e-mail address used by the user to buy our
app will generate the same token (i.e., same user + app ==> same
token)?
If the answer to question 1 is no, is there a way to launch in-app
purchase for a particular account/email?
It looks like Google is picking the first e-mail address returned by
AccountManager for its in-app purchase dialog. Can we assume that
this won't be changed by the user after in-app purchase dialog is
launched? How do we find out if this changed after the in-app
purchase returns?
What should we store in our database to identify this user? Is email
address and/or token allowed? When does the token expire?
The java-client library looks very promising and powerful at first
read. But, a number of things remains confusing. Is there an article
that describes the end-to-end scenario--from an app initiating a
call to a back-end server through launching the in-app purchase
dialog, getting the result and closing with commits on the server?
What articles are the most useful for accomplishing this on Android?
The main issue we are trying to solve is to to get the full picture.
We've gotten the idea that we can avoid requiring userid/password by using the java client features and using tokens. We have registers our project (both the web app and android app on the same project) per the instructions for Google API Console. We have the php java-client for Google Play Service on our back-end server. We got our Android app to generate a token using the first email address and then call the in-app purchase dialog and handle the user response at the end of the dialog. We've got the parts. Now, we need to glue everything together. We are at the point of integrating with the back-end server. E.g., What is Redirect URi supposed to point to in our server? We've got a php url that we do http post messages to for our server app. We've included the code example for Google API client example--with client-id, secret, simple api key, etc. filled in--as an include to our php. But, what should we put in the redirect uri (we are missing a usage instruction for the example code)?
Also, we want to avoid having the e-mail used for the in-app purchase be different from what we log on our server database as the address the user used to buy our app; if the address is the correct thing to track, we want it to be the same as what was used for the purchase. This could be frustrating for our user if we make this mistake and prevent them from the features they paid for. We don't want to make this mistake and need some clarification on how Google Play Service works. If we initiated the server part of the workflow to get app Nonce / Payload / Credentials for the first e-mail address on the Android device, we would want that address to be used throughout the workflow. If the user changed this along the line, we want to be aware of this and gracefully recover. So far the articles have been helpful but incomplete. Any insight/suggestion is appreciated.

In-app billing, how to update server side database

I'm trying to implement a feature to update my server side database when someone purchases a managed item in my Android application.
Basically I want the user to be able to log on to my website when the managed item have been purchased but not before.
Can someone please provide me with details on how to accomplish this.
Someone I would like to send a username/email or similar to the web page that I can use to update the server database. However I need to make sure this cannot be sent by a user that have not purchased the managed item in my Android application
I have read some good post on this subject, but I still don't see how I can apply this in my solution
How do I verify Android In-app Billing with a server with Ruby?
http://crazyviraj.blogspot.se/2011/06/some-notes-on-implementing-in-app.html
Best regards
Google play store sends signed data and signature of each individual purchase. On successful purchase of an item from your android application, the application needs to send in the signed data and signature to your server. This data then needs to be verified against the public key. On successful verification, you can then intimate the android application with the success response and the required credentials for him to login.
EDIT :
Android Inapp Billing Overview
Sample Inapp Billing
Sample BroadcastReceiver
Please check the android sample inapp billing implementation. That has a dungeon's example which implements inapp billing. You need to implement a BroadcastReceiver which gets the data back from GooglePlay. com.android.vending.billing.PURCHASE_STATE_CHANGED intent represents that a purchase has happened. Now you can get the signed data and signature from the intent like
String signedData = intent.getStringExtra("inapp_signed_data");
String signature = intent.getStringExtra("inapp_signature");
Now you may need to pass in this data to your server to identify the user who actually purchased it. Hope it helps.

Categories