Giter Site home page Giter Site logo

actuallytaylor / in_app_purchase_receipt_verifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lionheart/in_app_purchase_receipt_verifier

2.0 0.0 0.0 1.17 MB

A simple, one-click deploy web app to simplify the process of validating In-App Purchase receipts on the App Store.

License: Apache License 2.0

Python 74.75% Shell 17.41% Swift 7.57% Procfile 0.27%

in_app_purchase_receipt_verifier's Introduction

Deploy

A simple, one-click deploy web app to simplify the process of validating In-App Purchase receipts on the App Store. Written using Django 1.11 and Python 3.6.2.

Usage

Deployment

  1. (Optional, but highly recommended) Download IAPVerifierKeyGenerator.playground and run the playground. Copy the highlighted Base-64 encoded values below. Save these values for the next steps.

  2. Create the project on Heroku using the Deploy Button above. Before you do, make sure that you've already obtained your app-specific shared secret for authentication from iTunes Connect. For the BASE64_ENCODED_SIGNING_KEY value, paste in the value for the private key from Step 1.

In Your iOS App

  1. Add IAPReceiptVerifier to your Podfile, then run pod update.

  2. Use something like the following in your iOS app to validate your receipts.

    // Insert your Heroku app URL here.
    let url = URL(string: "https://your-app-name.herokuapp.com/verify")!
    
    // The Base 64 Encoded public key from Step 1.
    let publicKey = "..."
    
    // Create the receipt verifier from the above values.
    guard let verifier = IAPReceiptVerifier(url: url, base64EncodedPublicKey: publicKey) else {
        return
    }
    
    // Check the app store to see if there is a valid receipt.
    verifier.verify { receipt in
        guard let receipt = receipt else {
            // Someone tampered with the payload!
            return
        }
    
        // Your application logic here.
    }

Local Testing

curl -X POST -T receipt https://your-app.herokuapp.com/verify

...where receipt is a file with base-64 encoded receipt data.

License

In-App Purchase Receipt Verifier is available under the Apache 2.0 license. See the LICENSE file for more info.

in_app_purchase_receipt_verifier's People

Contributors

dlo avatar

Stargazers

 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.