Managing inventory with off site payment systems - java

I am building a site that sells tickets. I am processing payments through third party payment processors, google checkout. Currently I am limiting purchase time on google checkout to 10 min. If they take longer, the tickets reopen and other users are able to purchase the tickets. The only problem is that Google checkout doesn't know that the timer has expired. The user is able to complete their purchase even though the tickets they are trying to buy have already been bought by someone else. Is there any way to stop google checkout from selling too many tickets? The tickets are GA so if I could limit how many are sold total this would work also. If this is not possible, which seems to be the case, has anyone tackled this problem and found a better solution?

You have several options to deal with inventory issues:
Checkout Store Gadget: offers a simple built-in "inventory update" (using an online spreadsheet). Because Google handles the inventory, an order will not go through if the inventory dropped to zero. Here's the link to the Store Gadget documentation:
http://code.google.com/apis/checkout/developer/Google_Checkout_Store_Gadget_How_To.html
If you don't want to use the Store Gadget, you can use the Checkout Notification and Order Processing APIs and cancel the order if it took to long to complete (i.e. the ticket was sold to someone else). This avoids overselling but will make some customers unhappy.
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Notification_API.html
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API_Processing.html
Use an inventory buffer to avoid overselling. Keep a few tickets in "reserve" and avoid cancelations and unhappy customers :-)

Related

Salesforce: Which API to use without Login required?

I'm currently working on a native Android app for my company and ran into some problems with Salesforce lately.
I hope I can find some help here.
What I want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)
The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.
The problem I'm facing is that I can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?
It would be so awesome if anybody could help me with this problem.
What I tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication() i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method peekUnauthenticatedRestClient(), but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practical for my Use-case.
I feel like I read nearly all docs about salesforce API, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  
would a salesforce-apex method which would select all records inside a set radius around the user's location to be accessible without authentication?
Thanks for your help in advance!
Roman
Try asking on salesforce.stackexchange.com. Your question is more about licensing model than a particular programming problem. It might even be the case that you don't really need Salesforce for your project, you'd be better off on Heroku (even free tier) if the login piece is an issue...
All Salesforce APIs require some form of authentication. If you're positive you don't want to hardcode "Integration user" credentials in the app and you don't want to pay for (self-)registered user licenses in your org...
Try to read about these:
Site - piece of Visualforce running under specific "guest user", letting you view & interact with SF data without having to log in. You expose SF data to the world but that means it's your job to handle security (if any) and craft the API. You want to really display the data to human? Or just return JSON content or what...
Sites are meant to be displayin some incentive to contact you. Your product catalog / basic order form. Some map of nearby locations. Maybe a "contact us" form. There's limit on the traffic so eventually they'll explode as your app gets popular:
Customer Community - typically you need named licenses (even if they're fairly cheap) to let your customers log in to your SF. You create a Contact, click magic button - boom, this Contact now has a real matching User record with its own license. Think of it as some kind of step up from Sites - it'll still have some limits but will offer more than just raw API access and you'll have better control on what's going on.

Android in-app payment for physical items, where to store price information?

I am working on a Android app with the possibility to purchase a physical items. The payment will be implemented with help of the Paypal SDK.
Now i am facing a problem. I only offer two products which can be ordered. First one for say 10 Euro and the second one for 15 Euro.
Where do I have to place the price information which is then to be transfered to Paypal? I don´t think hardcoding the price for my items
into the app is a good approach, but I did not find any better solution for it. I decompiled the app of one competitioner and saw that he also just saves the
price into the app?
Once i hardcode the price information into the app, how should I change it in future? Old app installations will always have
the old price? Lets say it was 10 Euro and now it should be 12 Euro?! How should I change that?
One possibility would be to get the price informaton from my CloudService each time the user starts my app?
What are other solutions for that problem? I want to be flexibel to change the price of my products and to be safe from manipulation.
(I would verifiy the payment with my CloudService and Paypal)
Regards
Store price on your Server this is the best way
You set pricing in Google Play Console.
Go to your application, Store presence, In-app products.
You can add your products and pricing info in there.

Paypal java API app between users

I have a question regarding the Paypal Java API. I read their documentation and watched some tutorials about their developer tool to integrate Paypal in my app, but I didn't see nothing about letting users pay each other through Paypal.
To be more explicit, for 2 users, user provides a service through the app for user 2 and user 2 now has to pay user 1 through Paypal within the app. Is it possible, and if it is, how ?
From what I read, the only way I can think about doing this, Paypal API can send an invoice to user 2, but from me (from the application as the receiver) and so the money would go to the app account (express account or whatever it was called) and from there I could forward the money to the user 1. This way would be really inefficient and I wonder if I could make the transaction directly: user 1 sends an invoice to user 2 and user 2 pays that invoice directly.
Thank you.
You can use Adaptive payment API to let user 1 pay user 2 directly, the app act as the API caller, please see document here

Creating an m-banking program

Am trying to make a program in Java. I want it to be in such a way when you want to buy something online be it a software or any product you use m-banking like (M-pesa used in Kenya).
When one tries to shop and reaches a point you want to pay you will need to input the amount you want to pay a certain unique number of the product on your phone then the program on the other side should check whether the input money is enough and clear the product as paid. The person buying the product will be given the right to download the product after entering the unique id he/she will be given by the product.
Is it possible to use Java and interact with a program which may be written in another language and then the two programs will be communicating together with the web?
Yes you can!
There is no problem if you use different languages or technologies. In fact, there are several technical solutions. E.g., you can use a shared database on a Web server that can be accessed by a PHP Web site or a Java application through Sockets...

Android In-App billing - some cards not accepted

I get a lot emails lately that someone tried to pay inside my application with in-app billing and they get a "card not supported" kind of error on the Android in-app billing window. These same people report that they are able to buy other apps directly on Android Market, and with the same card they can't pay in-app.
I tried to contact Google but no response yet (I will post an update if I get an answer).
Have you experienced something similar? And then some people run into the in-app billing bug, where your order is "pending" and you can't do anything. I get negative feedback and this is outside my responsibility.
I think I found a solution for my problem. It was most probably caused after we asked Google to transfer the whole Android account to a new gmail address. I have checked the in-app products in the Android Market console and the the price field was empty on the new account! Only the country specific prices were set. I am pretty sure that the price was set before the account was changed. So I edited the product and entered a price and I asked a customer who previously couldn't pay to try it again. It worked!
So be sure to check if your in-app products have the price set (and not only the country specific price values).
BTW. Google also changed our public key while switching the accounts. People were complaining the whole day that they paid and didn't receive the item. Well Google took the money but the information was delivered signed with a new public key and was not recognized on the devices.

Categories