Project

kakeibo

0.0
No commit activity in last 3 years
No release in over 3 years
IAP and IAB receipt validation module.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
>= 0
 Project Readme

Kakeibo

IAP and IAB receipt validation module.

Installation

Add this line to your application's Gemfile:

gem 'kakeibo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kakeibo

Usage

iOS

  • iOS(IAP in-app-purchase) receipt validation uses Apple receipt validation API.
  • iOSのレシート検証はAppleのレシート検証APIを叩くことで行う
kakeibo = Kakeibo.new(:Iap, retry_count: 2)
kakeibo.fetch(receipt, transaction_id: SKPaymentTransaction.transactionIdentifier)
kakeibo.valid?

initialize option

  • retry_count
    • If Apple receipt API is down, fetching API retry_count times.
    • Appleのレシート検証APIが落ちていた時の試行回数

Android

  • Android(IAB in-app-billings) receipt validation uses public key from Google Play. DO NOT USE Google API.
  • Androidのレシート検証は、Google Playから払い出される公開鍵を使って検証する。GoogleのAPIは使用しない
kakeibo = Kakeibo.new(:Iab)
kakeibo.fetch(
  receipt,
  signature: signature,
  base64_encoded_public_key: base64_encoded_public_key,
  developer_payload: developer_payload
)
kakeibo.valid?
kakeibo.order_id # You should validate order_id uniqueness for security

for sucurity

  • Please See this pages security recommendation!
    • You should verify that the orderId is a unique value that you have not previously processed, and the developerPayload string matches the token that you sent previously with the purchase request.
    • orderIdはユニーク性の担保をしてください。developerPayloadを使って、必ずrequestの整合性チェックを行って下さい

Refernces

iOS

Android

Contributing

  1. Fork it ( https://github.com/[my-github-username]/kakeibo/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request