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

reference_service

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reference_service

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

openapi_client

OpenapiClient - the Ruby gem for the Golden Service API

An API that conforms to the standards and best practices that should be adhered to in all Mastercard owned APIs. Can be used to create subscriptions to reports that are generated twice daily (6am & 6pm) that deliver e-commerce spending across multiple sectors and locations.

  • All requests must be signed using oauth 1.0a. Please refer to: https://developer.mastercard.com/platform/documentation/using-oauth-1a-to-access-mastercard-apis/

  • The user must provide their card details when creating a subscription. These details must be encrypted before entering transit. Please refer to Mastercard security

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://developer.mastercard.com/

Installation

Build a gem

To build the Ruby code into a gem:

gem build openapi_client.gemspec

Then either install the gem locally:

gem install ./openapi_client-1.0.0.gem

(for development, run gem install --dev ./openapi_client-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'openapi_client', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'openapi_client'

api_instance = OpenapiClient::ReportsApi.new
date = Date.parse('29/02/2019') # Date | The date for the requested data
location = 'New York' # String | The location for which you wish to receive the top-sectors report.
spending_type = 'ATV' # String | Used to distinguish between gross spending (GS) & average transaction value (ATV)
opts = {
  sector: 0 # Integer | The sector for which you wish to receive reports. Sector ids can be retrieved from sectors call
}

begin
  #Retrieves e-commerce spending for a particular location, sector and date range or single date
  result = api_instance.get_spending(date, location, spending_type, opts)
  p result
rescue OpenapiClient::ApiError => e
  puts "Exception when calling ReportsApi->get_spending: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://stage.api.mastercard.com/golden-service

ClassMethodHTTP requestDescription
OpenapiClient::ReportsApiget_spendingGET /spending-reportsRetrieves e-commerce spending for a particular location, sector and date range or single date
OpenapiClient::ReportsApiget_top_locationsGET /top-locationsRetrieves the top grossing locations for the specified date/sector/spending type
OpenapiClient::ReportsApiget_top_sectorsGET /top-sectorsRetrieves the top grossing sectors for the specified date & location
OpenapiClient::SectorApiget_sectorsGET /sectorsReturns the valid sectors which can be passed to various other endpoints in the sector field
OpenapiClient::SectorApiget_top_sectorsGET /top-sectorsRetrieves the top grossing sectors for the specified date & location
OpenapiClient::SubscribeApiget_subscriptionGET /subscriptions/{subscription_id}Gets a specific subscription using a subscription Id passed as in the path
OpenapiClient::SubscribeApilist_subscriptionsGET /subscriptionsgets all active subscriptions for a particular user. Returned list size can be limited using the limit parameter
OpenapiClient::SubscribeApisubscribePOST /subscriptionsAllows the user to subscribe to a particular location and receive updates on e-commerce spending in their chosen area. The user can pay for the subscription on a daily basis. The user is charged for every report they receive until their subscription is cancelled
OpenapiClient::SubscribeApiunsubscribeDELETE /subscriptionsUn-subscribes from a specified subcription
OpenapiClient::SubscribeApiupdate_subscriptionPUT /subscriptionsUpdates an active subscription

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

FAQs

Package last updated on 06 Sep 2019

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