Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rocleung_apsa

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rocleung_apsa

  • 0.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

app-store-server-api

A Ruby client for the App Store Server API.

Gem Version

Features

  • Transaction history, subscription status
  • Notification test and history endpoints
  • Manages authentication tokens for you
  • Helpers to decode JWS items
  • Performs certificate validation against Apple's CA.

Requirements

Ruby 3.x

Installation

gem install app_store_server_api

Usage

Prerequisites

To get started, you must obtain the following:

Configure

In your Rails application, create a client configure

# my_app/config/app_store_server.yml
default: &default
  private_key: |
    -----BEGIN PRIVATE KEY-----
  key_id: S4AZ693A4A
  issuer_id: fd02853a-1290-4854-875e-918c86459b3e
  bundle_id: com.myapp.app
  environment: sandbox

development:
  <<: *default

test:
  <<: *default

production:
  <<: *default

Load the configure

# my_app/config/application.rb

config.app_store_server = config_for :app_store_server

Create a global client

# my_app/config/initializers/app_store_server_api.rb

AppStoreServerApiClient = AppStoreServerApi::Client.new(**Rails.configuration.app_store_server)

API

Get Transaction History

data = client.get_transaction_history(transaction_id,
  params: {
    sort: "DESCENDING"
  })

transactions = AppStoreServerApi::Utils::Decoder.decode_transactions signed_transactions: data["signedTransactions"]

Get Transaction Info

client.get_transaction_info transaction_id

Get All Subscription Statuses

response = client.get_all_subscription_statuses transaction_id

signed = response["data"].first["lastTransactions"].first["signedTransactionInfo"]

transaction = AppStoreServerApi::Utils::Decoder.decode_transaction signed_transaction: signed

Request a Test Notification

client.request_a_test_notification

Utils

  • AppStoreServerApi::Utils::Decoder.decode_transaction
  • AppStoreServerApi::Utils::Decoder.decode_jws!

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the AppStoreServerApi project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 25 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc