0.0
No release in over 3 years
Low commit activity in last 3 years
Сloudpayments API wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.7.10
 Project Readme

Cloudpayments

A Ruby wrapper for cloudpayments

Installation

# Gemfile
gem "cloudpayments", "~> 0.4.0"
$ bundle install

Usage:

# config/initializers/cloudpayments.rb
require "cloudpayments"

Cloudpayments.configure do |config|
  config.login = "login"
  config.password = "password"
end
request_params = {
  "Inn" => inn,
  "Type" => format_receipt_type,
  "CustomerReceipt" => {
    "Items" => [{
      "Label" => label,
      "Quantity" => 1,
      "Amount" => amount,
      "Price" => amount,
      "Vat" => "",
      "Method" => 1,
      "Object" => 10
    }],
    "calculationPlace" => calculation_place,
    "TaxationSystem" => 0,
    "Email" => email,
    "Amounts" => {
      "Electronic" => amount
    }
  }
}

response = Cloudpayments::Client::Request::Receipts::Create.call(request_params)
response.success?

receipt_ofd_id = response.body.model_id

response = Cloudpayments::Client::Request::Receipts::GetStatus.call(receipt_ofd_id)
status = response.body.model