Best Practices for Using IAP

I just made an iOS app with IAP for buying virtual coins (Consumable). And the backend is Ruby on Rails. At the moment, I have some problems regarding the whole solution.

My current IAP process describes the following:

  • STEP 1 - The iOS client sends a request to our server and receives the product identifiers.
  • STEP 2 - The customer receives a list of products through the Store Kit with identifiers from step 1
  • STEP 3 - The user buys a click and the customer sends a delivery request to the Store Kit
  • STEP 4 - Upon completion of the transaction, the client sends a receipt marker to our backend
  • STEP 5 - The server first checks the receipt to make sure it is checked correctly.
  • STEP 6 - The server calls the App Store application to check receipt and process the exchange (account reload in the database)
  • STEP 7 - The client returns a response and displays the account balance

I used to work on e-commerce / payment solutions, and IAP in a different way, although usually the payment gateway sends the verification server to the server for verification. And we always have a message queue view to make sure all transactions are stable and supported.

My questions:

  • What is the best practice for verifying IAP receipt? How to avoid interruption of verification from our server? (for example, the user spends money and completes the transaction on the client, but does not work when he checks receipt on the server. There is no support for the IAP recovery transaction.)

  • Apple IAP is more likely an ideal client solution. Especially in my case, after payment by the user, he wants to immediately receive coins, and not the case when we tell him that the transaction is being processed and his account will be executed in the near future. To prioritize UX on a mobile device. Are you still using message queue material on the server?

Thank you for your time.

+7
source share
3 answers

You may find http://helios.io/ useful. It brings together four useful gems related to iOS, one of which is https://github.com/mattt/rack-in-app-purchase

+1
source

Question 1: According to Apple Docs here ), you should always check receipts on the server. There are several ruby ​​stones that can help talk to the Apple server on the backend:

https://github.com/gabrielgarza/monza

Hosting: https://getmonza.com

https://github.com/nomad/venice

https://github.com/nov/itunes-receipt

Question 2: It depends on how much you are worried about fraud. If you do not verify receipts, you are subjecting yourself to fraud. I highly recommend checking on the server side.

Checkout this WWDC video to get great basics in app purchases.

+1
source

If I understand the question correctly, there seems to be a stone called an itunes receipt that you can use for this. Pearls can be found here: https://github.com/nov/itunes-receipt

There is also a problem with NSScreencast, and the instructions in the notes for the show look quite complete. http://nsscreencast.com/episodes/45-validating-iap-receipts

0
source

All Articles