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

prodamus

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prodamus

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Purchase integration with https://prodamus.ru/

Client library for ruby apps

Prodamus docs https://help.prodamus.ru/

Example usage:

  • configure connection

    Prodamus.config do |conf|
      conf.main_payment_form_url = <payment form provided by prodamus>
      conf.secret_key = <key from main form settings>
    end
    

    or

    Prodamus.main_payment_form_url = <payment form provided by prodamus>
    Prodamus.secret_key = <key from main form settings>
    
  • configure request wich be sent for get purchase link

    Prodamus.link_config do |conf|
      conf.order_id = 12
      conf.currency = 'rub'
      ...
    end
    

    To see more parameters https://help.prodamus.ru/payform/integracii/rest-api/instrukcii-dlya-samostoyatelnaya-integracii-servisov#obshie-neobyazatelnye-parametry

  • get payment link

    Prodamus.link
    

Submit callback

Your callback from Prodamus server can be look like this:

data = {
    date: '2022-12-08T10:42:10+03:00',
    order_id: <id in prodamus system>,
    order_num: <id in your system>,
    domain: <your main form>,
    sum: '770.00',
    currency: 'rub',
    customer_phone: '+78005553535',
    customer_extra: '',
    payment_type: 'Оплата картой, выпущенной в РФ',
    commission: '100',
    commission_sum: '770.00',
    attempt: '2',
    callbackType: 'json',
    link_expired: '2022-12-08 11:38',
    products: [
      {
        name: <product name>,
        price: '770.00',
        quantity: '1',
        sum: '770.00'
      }
    ],
    payment_status: payment_status,
    payment_status_description: 'Успешная оплата',
    payment_init: 'manual',
    submit: {
      date: '2022-12-08T10:42:10+03:00',
      order_id: <id in prodamus system>,
      order_num: <id in your system>,
      domain: <your main form>,
      sum: '770.00',
      currency: 'rub',
      customer_phone: '+78005553535',
      customer_extra: '',
      payment_type: 'Оплата картой, выпущенной в РФ',
      commission: '100',
      commission_sum: '770.00',
      attempt: '2',
      callbackType: 'json',
      link_expired: '2022-12-08 11:38',
      products: [{ name: <product name>, price: '770.00', quantity: '1', sum: '770.00' }],
      payment_status: 'success',
      payment_status_description: 'Успешная оплата',
      payment_init: 'manual'
    }
  }

Need get signature from header 'Sign' and verify this data:

sign = request.headers['Sign']
Prodamus.verify(data[:submit], sign)

This method returns 'true' or 'false'.

You must perform some actions in your system to complete purchase if this method returns'true'

FAQs

Package last updated on 10 Mar 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