New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

integral-yandex-money-notification_validator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

integral-yandex-money-notification_validator

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Yandex.Money notification validator

Gem Version Maintainability Test Coverage Build Status

Table of Contents

Features

Checks integrity of Yandex.Money payment notification by comparing SHA of strigified params including a secret shared with Yandex.

Here are the official docs for the notification service and validating notifications specifically.

Requirements

Setup

Add the following to your Gemfile:

gem "integral-yandex-money-notification_validator"

Usage

Intended to use in a Rails controller like so:

class YandexMoneyReceiptsController < ApplicationController

  def create
    secret    = "YOUR_YANDEX_MONEY_NOTIFICATIONS_SHARED_SECRET"
    validator = Integral::Yandex::Money::NotificationValidator.new(params: params, secret: secret)

    if validator.valid?
      # Do your thing here, for example create a new `YandexMoneyReceipt` record in DB
    else
      render text: validator.errors.join(". "), status: :bad_request and return
    end
  end

end

params are supposed to be an ActionController::Parameters or just a Hash.

validator.errors returns an Array of message strings — most often only 1 message, but who knows.

secret is recommended to be kept in an ENV variable, Rails credentials or elsewhere secure.

Tests

To test, run:

bundle exec rake

Credits

Developed by Sergey Pedan at Integral Design.

FAQs

Package last updated on 02 Dec 2018

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