All Projects → nomad → Venice

nomad / Venice

Licence: mit
Ruby Gem for In-App Purchase Receipt Verification

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Venice

Houston
Apple Push Notifications; No Dirigible Required
Stars: ✭ 2,973 (+414.36%)
Mutual labels:  cli, nomad
Cupertino
CLI for the Apple Dev Center
Stars: ✭ 2,664 (+360.9%)
Mutual labels:  cli, nomad
Nomadctld
ssh server with ability to exec/attach/logs/tail/stop/restart hashicorp nomad containers
Stars: ✭ 47 (-91.87%)
Mutual labels:  cli, nomad
Shenzhen
CLI for Building & Distributing iOS Apps (.ipa Files)
Stars: ✭ 4,668 (+707.61%)
Mutual labels:  cli, nomad
Musicrepair
Fixes music metadata and adds album art.
Stars: ✭ 566 (-2.08%)
Mutual labels:  cli
Gscript
framework to rapidly implement custom droppers for all three major operating systems
Stars: ✭ 547 (-5.36%)
Mutual labels:  cli
Cli
GitHub’s official command line tool
Stars: ✭ 26,649 (+4510.55%)
Mutual labels:  cli
Terragrunt
Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
Stars: ✭ 5,446 (+842.21%)
Mutual labels:  cli
Summoner
🔮 🔧 Tool for scaffolding batteries-included production-level Haskell projects
Stars: ✭ 577 (-0.17%)
Mutual labels:  cli
Wunderbar
Simple horizontal bar chart printer for your terminal
Stars: ✭ 572 (-1.04%)
Mutual labels:  cli
Aliyun Cli
Alibaba Cloud CLI
Stars: ✭ 561 (-2.94%)
Mutual labels:  cli
Discline
🐍 A terminal Discord client that you can actually use.
Stars: ✭ 553 (-4.33%)
Mutual labels:  cli
Rate.sx
💰 curl cryptocurrencies exchange rates
Stars: ✭ 563 (-2.6%)
Mutual labels:  cli
Sherlock
🔎 Hunt down social media accounts by username across social networks
Stars: ✭ 28,569 (+4842.73%)
Mutual labels:  cli
Undercover
Actionable code coverage - detects untested code blocks in recent changes
Stars: ✭ 574 (-0.69%)
Mutual labels:  cli
Carbon Now Cli
🎨 Beautiful images of your code — from right inside your terminal.
Stars: ✭ 5,165 (+793.6%)
Mutual labels:  cli
Devkit
Stars: ✭ 561 (-2.94%)
Mutual labels:  cli
Sentry Cli
A command line utility to work with Sentry.
Stars: ✭ 567 (-1.9%)
Mutual labels:  cli
Weweb
兼容小程序写法的web开发框架
Stars: ✭ 557 (-3.63%)
Mutual labels:  cli
Yaspeller
🔍 Search tool typos in the text, files and websites
Stars: ✭ 554 (-4.15%)
Mutual labels:  cli

Venice

Travis

Venice is a simple gem for verifying Apple In-App Purchase receipts, and retrieving the information associated with receipt data.

There are two reasons why you should verify in-app purchase receipts on the server: First, it allows you to keep your own records of past purchases, which is useful for up-to-the-minute metrics and historical analysis. Second, server-side verification over SSL is the most reliable way to determine the authenticity of purchasing records.

See Apple's Receipt Validation Programming Guide for additional information.

Venice is named for Venice, Italy—or more specifically, Shakespeare's The Merchant of Venice. It's part of a series of world-class command-line utilities for iOS development, which includes Cupertino (Apple Dev Center management), Shenzhen (Building & Distribution), Houston (Push Notifications), Dubai (Passbook pass generation), and Nashville (iTunes Store API).

Installation

$ gem install venice

Usage

Basic

require 'venice'

data = '(Base64-Encoded Receipt Data)'
if receipt = Venice::Receipt.verify(data)
  p receipt.to_h

  # You can refer an original JSON response via a Receipt instance.
  case receipt.original_json_response['status'].to_i
    when 0     then foo
    when 21006 then bar
  end
end

For Auto-Renewable

require 'venice'

data = '(Base64-Encoded Receipt Data)'

# You must pass shared secret when verification on Auto-Renewable
# To generate a shared secret, go to App Store Connect -> My Apps > (Your app) > In-App Purchases > View or generate a shared secret
opts = { shared_secret: 'your key' }

if receipt = Venice::Receipt.verify(data, opts)
  # Renewed receipts are added into `latest_receipt_info` array.
  p receipt.latest_receipt_info.map(&:expires_at)
  # => [2016-05-19 20:35:59 +0000, 2016-06-18 20:35:59 +0000, 2016-07-18 20:35:59 +0000]
end

Command Line Interface

Venice also comes with the iap binary, which provides a convenient way to verify receipts from the command line.

$ iap verify /path/to/receipt

+--------------------------------+------------------------------------+
|                               Receipt                               |
+--------------------------------+------------------------------------+
| adam_id                        | 664753504                          |
| application_version            | 123                                |
| bundle_id                      | com.example.product                |
| download_id                    | 30000000000005                     |
| expires_at                     |                                    |
| latest_receipt                 |                                    |
| original_application_version   | 123                                |
| original_purchase_date         | Fri, 07 Mar 2014 20:59:24 GMT      |
| receipt_type                   | Production                         |
| receipt_created_at             | Mon, 23 Jun 2014 17:59:38 GMT      |
| requested_at                   | Mon, 23 Jun 2014 17:59:38 GMT      |
+--------------------------------+------------------------------------+
| in_app                         | 1                                  |
|  - app_item_id                 |                                    |
|  - cancellation_at             |                                    |
|  - expires_at                  |                                    |
|  - original_purchase_date      |                                    |
|  - original_transaction_id     | 1000000000000001                   |
|  - product_id                  | com.example.product                |
|  - purchase_date               |                                    |
|  - quantity                    | 1                                  |
|  - transaction_id              | 1000000000000001                   |
|  - web_order_line_item_id      | 1000000000000001                   |
|  - version_external_identifier |                                    |
|  - is_trial_period             | true                               |
|  - is_in_intro_offer_period    | true                               |
+--------------------------------+------------------------------------+

Creator

Mattt Thompson (@mattt)

License

Venice is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].