Project

prodamus

0.0
No release in over a year
This gem allows to integrate Prodamus purchases service in your Rails app or simple Ruby app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.5
~> 0.14
~> 7.0
~> 13.0
~> 3.6
~> 1.47
~> 6.0
~> 3.14

Runtime

~> 2.5
 Project Readme

Purchase integration with https://prodamus.ru/

Client library for ruby apps

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

Example usage:

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'