Git Product home page Git Product logo

googleplay_inappbilling_purchaseveryfication's Introduction

GoogleplayInAppBillingPurchaseVeryfication

This(simple) gem handle Google Play In App Purchase Receipt Verification, and retrieving the information associated with receipt data. Server-side verification over SSL is the most reliable way to determine the authenticity of purchasing records.

Installation

Add this line to your application's Gemfile:

gem 'Googleplay_InAppBilling_PurchaseVeryfication'

And then execute:

 $ bundle

Or install it yourself as:

$ gem install Googleplay_InAppBilling_PurchaseVeryfication

Usage

For this gem you need to provide the following credentials: client_id , google_secret , refresh_token , app_name , app_version

Rails version greater than 4.0

Credentials will be placed in the secrets.yml file

Rails version less than 4.1

Just run "rake play_config" command will generate under AppRoot/config/google_play.yml file. Credentials will be placed in this file.

SIMPLE USAGE

   receipt_data = 'purchase_token from android app'
   response = GoogleplayInAppBillingPurchaseVeryfication::Play.verify(package_name, subscription_id, receipt_data)
   if !response['errors']
    success
   else
    error
   end
   rescue Exception => e
      render json: {:message=> e.message},status: 400

Contributing

  • Fork the project.

  • Make your feature addition or bug fix.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

Details

Need more detail on how all of this works (especially the Android implementation)? Read Google's In-app Billing Docs.

Error

If you have ssl error in development just put this two lines of code

        require 'openssl'
        OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

Be sure never to use this in any production environment, as it will negate benefits of using SSL in the first place. It is only ever valid to do this in your local development environment. Here some useful links to fix this issue:

      http://railsapps.github.io/openssl-certificate-verify-failed.html
      https://gist.github.com/fnichol/867550

License

The gem is available as open source under the terms of the MIT License.

googleplay_inappbilling_purchaseveryfication's People

Contributors

osmanperviz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.