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

go_puff-tax_service

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go_puff-tax_service

  • 1.5.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GoPuff::TaxService

Coverage Status

GoPuff Rails library to handle interaction with Tax Service

Installation

Add the gem to your project's Gemfile:

source 'https://rubygems.pkg.github.com/gopuff' do
  gem 'go_puff-tax_service'
end

And then execute:

$ bundle install

Or install it yourself as:

gem install go_puff-tax_service --source "https://rubygems.pkg.github.com/gopuff"

Configuration example

# config/initializers/tax_service.rb

GoPuff::TaxService.configure do |config|
  config.logger = GoPuff::Logger

  config.base_url = ENV['GOPUFF_TAX_SERVICE_BASE_URL']

  config.requests.max_retries = 3
  config.requests.retry_wait_time = 0.5
  config.requests.retryable_exceptions = [EOFError, Errno::ECONNRESET]

  config.user_agent_header = 'your header'

  config.authentication.token_provider = -> { Apis::TaxService::Authentication.get_token }
  config.authentication.on_unauthorized = -> { Apis::TaxService::Authentication.get_token(fresh: true) }
end

Gopuff::TaxService = GoPuff::TaxService

Usage

There are 3 main actions you can use: Get, Commit, Cancel

Get. It is used for fee calculation:

  order = ...
  purchases = ...
  fees_kind = 'all' || 'non_alcohol' || 'alcohol' || 'none'
  GoPuff::TaxService::Actions::Get.new(order, purchases: purchases, fees_kind: 'all').call

Commit It is used for confirming fee when order is finished:

  order = ...
  GoPuff::TaxService::Actions::Commit.new(order).call

Cancel It is used for refund:

  order = ...
  GoPuff::TaxService::Actions::Cancel.new(order).call

Local development with docker

docker-compose run --rm go_puff-tax_service bash

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Clone the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

FAQs

Package last updated on 23 May 2023

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