Sha256: a215724a958409d9debefa88bbe8b9dff8a28fe8a66f5fdf1eaacc18ba466014

Contents?: true

Size: 943 Bytes

Versions: 2

Compression:

Stored size: 943 Bytes

Contents

#!/usr/bin/env ruby

require 'pcp-server-ruby-sdk'
require_relative 'commerce_case_api_example'

def run
  api_key = ENV['API_KEY']
  api_secret = ENV['API_SECRET']
  merchant_id = ENV['MERCHANT_ID']
  commerce_case_id = ENV['COMMERCE_CASE_ID']
  checkout_id = ENV['CHECKOUT_ID']

  if !api_key || !api_secret || !merchant_id || !commerce_case_id || !checkout_id
    puts 'Please provide API_KEY, API_SECRET, MERCHANT_ID, COMMERCE_CASE_ID and CHECKOUT_ID as environment variables'
    exit(1)
  end

  communicator_configuration = CommunicatorConfiguration.new(
    api_key,
    api_secret,
    'https://api.preprod.commerce.payone.com'
  )

  commerce_case_api_client_example = CommerceCaseApiExample.new(communicator_configuration)

  # commerce_case_api_client_example.run_post_one
  commerce_case_api_client_example.run_get_all

  # commerce_case_api_client_example.run_get_one
  # commerce_case_api_client_example.run_update_one
end

run

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pcp-server-ruby-sdk-0.0.6 example-app/example.rb
pcp-server-ruby-sdk-0.1.0 example-app/example.rb