Sha256: 2f663602f89835d061a13787252c7f8b7e1b580d20eadd0128abe710d4ffc4f8

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "irb"
require "irb/completion"
require "bundler/setup"
require "shipay"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

# Config IRB to enable --simple-prompt and auto indent
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:AUTO_INDENT] = true

def reload!(print = true)
  puts 'Reloading ...' if print
  # Main project directory.
  root_dir = File.expand_path('..', __dir__)
  # Directories within the project that should be reloaded.
  reload_dirs = %w{lib}
  # Loop through and reload every file in all relevant project directories.
  reload_dirs.each do |dir|
    Dir.glob("#{root_dir}/#{dir}/**/*.rb").each { |f| load(f) }
  end
  # Return true when complete.
  true
end

def initialize_shipay
  pp "Initilizing..."
  Shipay.secret_key = ""
  Shipay.access_key = ""
  # Shipay.client_id = ""

  Shipay.credentials = [ { key: :default, client_id: "" } ]

  @ch = {
    order_ref: "shipaypag-001",
    wallet: "shipay-pagador",
    total: 0.51,
    items: [
      {
        item_title: "Item 1",
        unit_price: 0.30,
        quantity: 1
      },
      {
        item_title: "Item 2",
        unit_price: 0.20,
        quantity: 1
      },
      {
        item_title: "Item 3",
        unit_price: 0.01,
        quantity: 1
      }
    ],
    buyer: {
      name: "Shipay PDV",
      cpf_cnpj: "121.191.870-02",
      email: "shipay-pagador@shipay.com.br",
      phone: "+55 11 99999-9999"
    }
  }
end

initialize_shipay
IRB.start

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shipay-0.1.5 bin/console