Introduction

To create payments, you need to link your server to our platform via one of our integration methods.
Our Ruby SDK library is the ideal solution to connect to our platform if you prefer to do so with your own stand-alone system using Ruby language.

This SDK is automatically generated by the OpenAPI Generator project:

API version: 1.8.0
Package version: 0.1.0
Generator version: 7.7.0
Build package: org.openapitools.codegen.languages.RubyClientCodegen

Install SDK

Build a gem

To build the Ruby code into a gem:

    
   gem build PCP-server-Ruby-SDK.gemspec 


Then either install the gem locally:

    
   gem install ./PCP-server-Ruby-SDK-0.1.0.gem


 
(for development, run  gem install --dev ./PCP-server-Ruby-SDK-0.1.0.gem   to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:


Then either install the gem locally:

    
   gem 'PCP-server-Ruby-SDK', '~> 0.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:


Then either install the gem locally:

    
   gem 'PCP-server-Ruby-SDK', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

    
   ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

Ruby SDK
# Load the gem
require 'PCP-server-Ruby-SDK'

api_instance = PCPServerSDK::CheckoutApi.new
merchant_id = '3241' # String | The merchantId identifies uniquely the merchant. A Checkout has exactly one merchant.
commerce_case_id = 'commerce_case_id_example' # String | Unique identifier of a Commerce Case.
create_checkout_request = PCPServerSDK::CreateCheckoutRequest.new # CreateCheckoutRequest | 

begin
  #Add a Checkout to an existing Commerce Case
  result = api_instance.create_checkout(merchant_id, commerce_case_id, create_checkout_request)
  p result
rescue PCPServerSDK::ApiError => e
  puts "Exception when calling CheckoutApi->create_checkout: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://commerce-api.payone.com

Further Documentation can be found under Github Ruby SDK Documentation

Class Method HTTP request Description
PCPServerSDK::CheckoutApi create_checkout POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts Add a Checkout to an existing Commerce Case
PCPServerSDK::CheckoutApi delete_checkout DELETE /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId} Delete a Checkout
PCPServerSDK::CheckoutApi get_checkout GET /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId} Get Checkout Details
PCPServerSDK::CheckoutApi get_checkouts GET /v1/{merchantId}/checkouts Get a list of Checkouts based on Search Parameters
PCPServerSDK::CheckoutApi update_checkout PATCH /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId} Modify a Checkout
PCPServerSDK::CommerceCaseApi create_commerce_case POST /v1/{merchantId}/commerce-cases Create a Commerce Case
PCPServerSDK::CommerceCaseApi get_commerce_case GET /v1/{merchantId}/commerce-cases/{commerceCaseId} Get Commerce Case Details
PCPServerSDK::CommerceCaseApi get_commerce_cases GET /v1/{merchantId}/commerce-cases Get a list of Commerce Cases based on Search Parameters
PCPServerSDK::CommerceCaseApi update_commerce_case PATCH /v1/{merchantId}/commerce-cases/{commerceCaseId} odify an existing Commerce Case.
PCPServerSDK::OrderManagementCheckoutActionsApi cancel_order POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/cancel Mark items of a Checkout as cancelled and automatically cancel the payment for the items
PCPServerSDK::OrderManagementCheckoutActionsApi create_order POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/order Creates an Order that will automatially execute a Payment
PCPServerSDK::OrderManagementCheckoutActionsApi deliver_order POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/deliver Mark items of a Checkout as delivered and automatically capture the payment for the items
PCPServerSDK::OrderManagementCheckoutActionsApi return_order POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/return Mark items of a Checkout as returned and automatically refund the payment for the items
PCPServerSDK::PaymentExecutionApi cancel_payment_execution POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-executions/{paymentExecutionId}/cancel Cancel a Payment
PCPServerSDK::PaymentExecutionApi capture_payment_execution POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-executions/{paymentExecutionId}/capture Capture a Payment
PCPServerSDK::PaymentExecutionApi complete_payment POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-executions/{paymentExecutionId}/complete Complete a Payment
PCPServerSDK::PaymentExecutionApi create_payment POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-executions Create a Payment
PCPServerSDK::PaymentExecutionApi refund_payment_execution POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-executions/{paymentExecutionId}/refund Refund a Payment
PCPServerSDK::PaymentInformationApi create_payment_information POST /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-information Create a Payment Information
PCPServerSDK::PaymentInformationApi get_payment_information GET /v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/payment-information/{paymentInformationId} Get a Payment Information