Skip to content

Instantly share code, notes, and snippets.

View derrek's full-sized avatar
🏠
Working from home

Derrek Long derrek

🏠
Working from home
View GitHub Profile
@derrek
derrek / google_play_receipt_verification.md
Last active August 17, 2022 19:34
Google Play/Android Receipt Validation/Verification/Lookup with Ruby

This document outlines setting up google's ruby gem, google-api-client, to verify payloads(receipts) sent to a server from google play in app purchases made via an android app.
This document was written using version 0.9.13.

First you'll need 'owner' access to the google play developer's console that contains the mobile app you wish to verify receipts from.

  • Go to https://play.google.com/apps/publish
  • Click on the mobile app you'd like to set up
  • Click "Settings" on the left click "API access"
  • Below "LINKED PROJECT" link the google play account

Next setup an api account

# This class shows uses version 0.9.x of the ruby google-api-client gem circa July 2016
# to query the Google Play subscription API.
#
# If using an older version of the google-api-client gem (ie. version 0.8.x), instead refer to:
# https://gist.github.com/jkotchoff/e60fdf048ec443272045/e3e2c867633900d9d6f53de2de13aa0a0a16bb03
#
# Sample usage:
#
# package_name = 'com.stocklight.stocklightapp'
# product_id = 'com.stocklight.stocklight.standardsubscription'
@derrek
derrek / carrier_wave_dreamobjects.md
Last active February 8, 2017 00:50
CarrierWave Fog configuration for a Public Bucket on DreamObjects with Rails 4.2

As of 2015-01-22 this is one way of setting up Carrierwave to work with DreamObjects. The dreamobjects docs are woefully out of date useing AWS::S3 gem which fails spectacularly on Rails 4.2 ruby 2.1 (see marcel/aws-s3#98 ).

DreamObjects GUI

In the DreamObjects web GUI, if you don't already have a bucket, click "create bucket". Name the bucket. For this example the bucket is named testing-bucket. Toggle the "private" switch to "public".

For the user enclosing the bucket you just created click on the "keys" button. This will reveal the public key. Click on "show secret key" (to the right of the public key in hardly legible light gray). This will reveal the private key.

Rails App