CreditCardRestClient - the Ruby gem for the Credit Card API v1
Credit Card API for authorizing and charging credit cards.
This SDK is automatically generated by the Swagger Codegen project:
- API version: 1
- Package version: 1.2.0
- Build package: io.swagger.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build credit_card_rest_client.gemspec
Then either install the gem locally:
gem install ./credit_card_rest_client-1.2.0.gem
(for development, run gem install --dev ./credit_card_rest_client-1.2.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:
gem 'credit_card_rest_client', '~> 1.2.0'
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:
gem 'credit_card_rest_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'credit_card_rest_client'
# Setup authorization
CreditCardRestClient.configure do |config|
# Configure HTTP basic authorization: basic
config.username = 'YOUR USERNAME'
config.password = 'YOUR PASSWORD'
end
api_instance = CreditCardRestClient::AuthorizeApi.new
opts = {
details: CreditCardRestClient::ChargeDetails.new # ChargeDetails |
}
begin
#Authorizes a card
result = api_instance.authorize_card(opts)
p result
rescue CreditCardRestClient::ApiError => e
puts "Exception when calling AuthorizeApi->authorize_card: #{e}"
end
All URIs are relative to https://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
CreditCardRestClient::AuthorizeApi | authorize_card | POST /api/creditcard/v1/authorize | Authorizes a card |
CreditCardRestClient::ChargeApi | charge_card | POST /api/creditcard/v1/charge | Charges a credit card |
CreditCardRestClient::StatusApi | external_status_check | POST /api/creditcard/status/external | Check external API status |
CreditCardRestClient::StatusApi | status_check | GET /api/creditcard/status | API status check |
- CreditCardRestClient::ChargeDetails
- CreditCardRestClient::ChargeResult
- CreditCardRestClient::ExternalStatusRequest
- CreditCardRestClient::ExternalStatusResponse
- CreditCardRestClient::StatusResponse
- Type: HTTP basic authentication