Sha256: 16f8b00b8795809be0f270b70a5a37c1cddb26414083fc0af508aad9d97c8613

Contents?: true

Size: 976 Bytes

Versions: 1

Compression:

Stored size: 976 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/PCP-server-Ruby-SDK.rb'
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 = PCPServerSDK::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

1 entries across 1 versions & 1 rubygems

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