Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maartenvanvliet/scrip
Scrip verifies Apple App Store receipts
https://github.com/maartenvanvliet/scrip
Last synced: 28 days ago
JSON representation
Scrip verifies Apple App Store receipts
- Host: GitHub
- URL: https://github.com/maartenvanvliet/scrip
- Owner: maartenvanvliet
- License: mit
- Created: 2020-08-13T14:25:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-03T04:57:24.000Z (almost 2 years ago)
- Last Synced: 2024-11-22T21:48:22.576Z (about 1 month ago)
- Language: Elixir
- Size: 73.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scrip
## [![Hex pm](http://img.shields.io/hexpm/v/scrip.svg?style=flat)](https://hex.pm/packages/scrip) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) ![CI](https://github.com/maartenvanvliet/scrip/workflows/CI/badge.svg)
Scrip is a library to verify Apple App Store receipts. See the [Apple docs](https://developer.apple.com/documentation/appstorereceipts) for more information
## Installation
The package can be installed by adding `scrip` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:scrip, "~> 1.0.0"},
{:jason, "~> 1.1"}, # optional
{:httpoison, "~> 1.7"}, # optional
]
end
````Jason` and `HTTPoison` are optional and can be overriden with other implementations
but these are the default implementations. See `Scrip.Config` for more information.## Usage
First set up In-App Purchases in App Store Connect. For your app should set the App-Specific Shared Secret, we can
use this later on to verify the receipt.The usual flow is that your app does an in app purchase. This returns a Base64 receipt to the app. Your app can send the
receipt data to your backend to validate against the Apple servers.The backend can verify the validity of this receipt using `Scrip.verify_receipt("BASE64_RECEIPT_DATA", password: "*App-Specific Shared Secret*")`
If all goes well, it returns an `:ok` tuple with the IAP information you can store on your backend.
Otherwise an `:error` tuple is returned.See `Scrip.verify_receipt/3` for more information