Skip to content

Commit e17688f

Browse files
committed
Update README.md
1 parent c66cfd1 commit e17688f

1 file changed

Lines changed: 146 additions & 91 deletions

File tree

README.md

Lines changed: 146 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,166 @@
1-
# openapi_client
1+
# AndDone Client Library - Ruby
22

3-
OpenapiClient - the Ruby gem for the Secure API
3+
This client library integrates with AndDone's secure APIs.
44

5-
Secure API
5+
Please see our developer documentation & API Explorer, linked below, for detailed instructions on how to integrate this into your systems.
66

7-
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
7+
**Secure API Ruby Client**
88

9-
- API version: 2.3
10-
- Package version: 1.0.0
11-
- Generator version: 7.9.0
12-
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
9+
This Ruby SDK is an auto-generated client for the AndDone Secure API, built using the [OpenAPI Generator](https://openapi-generator.tech).
10+
11+
* **API version**: 2.3
12+
* **Package version**: 1.0.0
13+
* **Generator version**: 7.9.0
14+
* **Build package**: `org.openapitools.codegen.languages.RubyClientCodegen`
15+
* **Developer Documentation**: [DevDocs](https://docs.anddone.com/)
16+
* **API Explorer**: [AndDone API Explorer](https://docs.anddone.com/explorer/)
17+
18+
---
19+
20+
## Table of Contents
21+
22+
* [Requirements](#requirements)
23+
* [Installation](#installation)
24+
* [Configuration](#configuration)
25+
* [Quickstart](#quickstart)
26+
* [API Endpoints](#api-endpoints)
27+
* [Models](#models)
28+
* [Authorization](#authorization)
29+
* [Support & Versioning](#support--versioning)
30+
31+
---
32+
33+
## Requirements
34+
35+
* **Ruby 2.7+**
36+
* Bundler / RubyGems
37+
* Access to **AndDone Merchant Portal** for API keys
38+
39+
---
1340

1441
## Installation
1542

16-
### Build a gem
43+
### Install from RubyGems
1744

18-
To build the Ruby code into a gem:
45+
If published, install via Bundler:
1946

20-
```shell
21-
gem build openapi_client.gemspec
47+
```ruby
48+
gem 'openapi_client', '~> 1.0.0'
49+
```
50+
51+
Then run:
52+
53+
```bash
54+
bundle install
55+
```
56+
57+
### Install from Git
58+
59+
If hosted on GitHub:
60+
61+
```ruby
62+
gem 'openapi_client', :git => 'https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-Ruby.git'
2263
```
2364

24-
Then either install the gem locally:
65+
### Build & Install Locally
2566

26-
```shell
67+
```bash
68+
gem build openapi_client.gemspec
2769
gem install ./openapi_client-1.0.0.gem
2870
```
2971

30-
(for development, run `gem install --dev ./openapi_client-1.0.0.gem` to install the development dependencies)
72+
---
3173

32-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
74+
## Configuration
3375

34-
Finally add this to the Gemfile:
76+
1. **Retrieve Developer Credentials:**
3577

36-
gem 'openapi_client', '~> 1.0.0'
78+
1. Log in to AndDone Merchant Portal:
3779

38-
### Install from Git
80+
* **UAT**: [https://portal.uat.anddone.com](https://portal.uat.anddone.com)
81+
* **Production**: [https://portal.anddone.com](https://portal.anddone.com)
82+
2. Go to **Developer → API Keys** in the left menu.
83+
3. Copy:
3984

40-
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:
85+
* `xApiKey` (API Key)
86+
* `xAppKey` (App Key)
4187

42-
gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
88+
2. **Determine Your Origin:**
89+
The `origin` is your public IP address.
90+
Find it by searching **"what's my IP"** in Google or visiting [https://www.whatsmyip.org](https://www.whatsmyip.org).
4391

44-
### Include the Ruby code directly
92+
* Contact AndDone support to ensure your origin IP is registered.
93+
* Email: [integrations@anddone.com](mailto:integrations@anddone.com)
4594

46-
Include the Ruby code directly using `-I` as follows:
95+
3. **Create a Config File (Recommended):**
96+
Rename `config.example.json``config.json` and fill with your keys:
4797

48-
```shell
49-
ruby -Ilib script.rb
50-
```
98+
```json
99+
{
100+
"x_api_key": "YOUR_API_KEY",
101+
"x_app_key": "YOUR_APP_KEY",
102+
"x_version": "2.3",
103+
"origin": "YOUR_IP_ADDRESS"
104+
}
105+
```
106+
107+
---
108+
109+
## Quickstart
51110

52-
## Getting Started
53-
1. Find and note your company AndDone Developer settings.
54-
1. Login to (UAT) https://portal.uat.anddone.com/ (Production) https://portal.anddone.com/
55-
2. In the left menu, click "Developer" then "API Keys"
56-
3. Your xApiKey will be the API Key
57-
4. Your xAppKey will be the App Key
58-
2. You will need to register your Origin with us to execute API calls against our Secure endpoints.
59-
1. Typically, we use your domain for production or other hosted environments and IP address for local development environments.
60-
2. Contact AndDone support (integrations@anddone.com) or your onboarding agent to ensure all your domains or IP addresses you may use are registered for use with our secure APIs.
61-
3. Please follow the [installation](#installation) procedure and then modify and run the following code:
111+
Here’s a minimal working example to call the **Secure Create Payment Intent API**:
62112

63113
```ruby
64-
# Load the gem
65114
require 'json'
66115
require 'openapi_client'
67116

68-
# Setup authorization
69-
OpenapiClient.configure do |config|
70-
# Configure API key authorization: x-api-key
71-
config.api_key['x-api-key'] = 'YOUR_API_KEY'
72-
# Configure API key authorization: x-app-key
73-
config.api_key['x-app-key'] = 'YOUR_APP_KEY'
74-
end
75-
76-
api_instance = OpenapiClient::SecurePaymentIntentApi.new
77-
x_api_key = 'x_api_key_example' # String | an authorization header
78-
x_app_key = 'x_app_key_example' # String | an authorization header
79-
x_version = 8.14 # Float | x-version
80-
origin = 'origin_example' # String | origin
81-
opts = { :payment_intent_request => JSON.parse('{YOUR_PAYMENT_INTENT_REQUEST}')
82-
}
117+
# Load API keys from config.json
118+
file = File.read('./config.json')
119+
config = JSON.parse(file)
120+
121+
x_api_key = config['x_api_key']
122+
x_app_key = config['x_app_key']
123+
x_version = config['x_version']
124+
origin = config['origin']
125+
126+
api = OpenapiClient::SecurePaymentIntentApi.new
127+
128+
request = OpenapiClient::PaymentIntentRequest.new(
129+
save_for_future: true,
130+
amount: 10000,
131+
title: "YOUR UNIQUE TITLE",
132+
short_description: "shortDescription",
133+
payment_description: "paymentDescription",
134+
invoice_number: "ruby-sdk",
135+
expires_in: "300000",
136+
intent: {
137+
payment_types: ["CreditCard", "ACH"]
138+
},
139+
enable_premium_finance: true,
140+
additional_details_preference: "NoAdditionalDetails"
141+
)
83142

84143
begin
85-
#This API will create a payment intent
86-
result = api_instance.secure_paymentintents_post(x_api_key, x_app_key, x_version, origin, opts)
87-
p result
144+
result = api.secure_paymentintents_post(x_api_key, x_app_key, x_version, origin, request)
145+
puts result
88146
rescue OpenapiClient::ApiError => e
89-
puts "Exception when calling SecurePaymentIntentApi->secure_paymentintents_post: #{e}"
147+
puts "Exception when calling SecurePaymentIntentApi: #{e}"
90148
end
91149
```
92150

93-
## Documentation for API Endpoints
151+
---
152+
153+
## API Endpoints
154+
155+
All URIs are relative to:
156+
157+
* **UAT**: `https://api.uat.anddone.com`
158+
* **Production**: `https://api.anddone.com`
94159

95-
All URIs are relative to *https://api.uat.anddone.com*
160+
<details>
161+
<summary>Click to view all endpoints</summary>
96162

97-
Class | Method | HTTP request | Description
98-
------------ | ------------- | ------------- | -------------
99-
*OpenapiClient::SecureEmbeddedPremiumFinanceApi* | [**secure_epf_merchants_quotes_policy_put**](docs/SecureEmbeddedPremiumFinanceApi.md#secure_epf_merchants_quotes_policy_put) | **PUT** /secure/epf/merchants/quotes/policy | This API is will update the policy number
100-
*OpenapiClient::SecureEmbeddedPremiumFinanceApi* | [**secure_epf_quotes_booking_put**](docs/SecureEmbeddedPremiumFinanceApi.md#secure_epf_quotes_booking_put) | **PUT** /secure/epf/quotes/booking | This API will update PFA to book a quote.
163+
EmbeddedPremiumFinanceApi.md#secure_epf_quotes_booking_put) | **PUT** /secure/epf/quotes/booking | This API will update PFA to book a quote.
101164
*OpenapiClient::SecureEmbeddedPremiumFinanceApi* | [**secure_epf_quotes_captureesign_put**](docs/SecureEmbeddedPremiumFinanceApi.md#secure_epf_quotes_captureesign_put) | **PUT** /secure/epf/quotes/captureesign | This API will eSign the pfa with insured name.
102165
*OpenapiClient::SecureEmbeddedPremiumFinanceApi* | [**secure_epf_quotes_generate_post**](docs/SecureEmbeddedPremiumFinanceApi.md#secure_epf_quotes_generate_post) | **POST** /secure/epf/quotes/generate | This API is used to Generate Quotes
103166
*OpenapiClient::SecureEmbeddedPremiumFinanceApi* | [**secure_epf_quotes_intent_post**](docs/SecureEmbeddedPremiumFinanceApi.md#secure_epf_quotes_intent_post) | **POST** /secure/epf/quotes/intent | This API will return quotes created againsts a payment intent.
@@ -151,8 +214,14 @@ Class | Method | HTTP request | Description
151214
*OpenapiClient::SecureVendorManagementApi* | [**vendorapi_secure_merchants_vendors_unsuspend_post**](docs/SecureVendorManagementApi.md#vendorapi_secure_merchants_vendors_unsuspend_post) | **POST** /vendorapi/secure/merchants/vendors/unsuspend | This API unsuspends vendor into system
152215
*OpenapiClient::SecureVoidsApi* | [**secure_cancellations_post**](docs/SecureVoidsApi.md#secure_cancellations_post) | **POST** /secure/cancellations | This API cancel a transaction.
153216

217+
</details>
154218

155-
## Documentation for Models
219+
---
220+
221+
## Models
222+
223+
<details>
224+
<summary>Click to view all models</summary>
156225

157226
- [OpenapiClient::BankDetailDto](docs/BankDetailDto.md)
158227
- [OpenapiClient::CancelPaymentRequestDTO](docs/CancelPaymentRequestDTO.md)
@@ -277,7 +346,6 @@ Class | Method | HTTP request | Description
277346
- [OpenapiClient::RowDto](docs/RowDto.md)
278347
- [OpenapiClient::SecureBatchExecuteRequest](docs/SecureBatchExecuteRequest.md)
279348
- [OpenapiClient::SecureCancelledTransactionResponse](docs/SecureCancelledTransactionResponse.md)
280-
- [OpenapiClient::SecureEpfQuotesPost200Response](docs/SecureEpfQuotesPost200Response.md)
281349
- [OpenapiClient::SecureMerchantTokenShortResponse](docs/SecureMerchantTokenShortResponse.md)
282350
- [OpenapiClient::SecurePaymentBatchDetailsRequest](docs/SecurePaymentBatchDetailsRequest.md)
283351
- [OpenapiClient::SecurePaymentDetailsRequest](docs/SecurePaymentDetailsRequest.md)
@@ -316,12 +384,10 @@ Class | Method | HTTP request | Description
316384
- [OpenapiClient::TransactionDetailResponseTenderInfo](docs/TransactionDetailResponseTenderInfo.md)
317385
- [OpenapiClient::TransactionPaymentResponse](docs/TransactionPaymentResponse.md)
318386
- [OpenapiClient::TransactionPaymentResponseAchTenderInfo](docs/TransactionPaymentResponseAchTenderInfo.md)
319-
- [OpenapiClient::TransactionPaymentResponseAchTenderInfoCommissionType](docs/TransactionPaymentResponseAchTenderInfoCommissionType.md)
320387
- [OpenapiClient::TransactionPaymentResponseBillingContact](docs/TransactionPaymentResponseBillingContact.md)
321388
- [OpenapiClient::TransactionPaymentResponseBillingContactAddress](docs/TransactionPaymentResponseBillingContactAddress.md)
322389
- [OpenapiClient::TransactionPaymentResponseBillingContactName](docs/TransactionPaymentResponseBillingContactName.md)
323390
- [OpenapiClient::TransactionPaymentResponseCcTenderInfo](docs/TransactionPaymentResponseCcTenderInfo.md)
324-
- [OpenapiClient::TransactionPaymentResponseRefundOrigin](docs/TransactionPaymentResponseRefundOrigin.md)
325391
- [OpenapiClient::TransactionPaymentResponseRefundTransactions](docs/TransactionPaymentResponseRefundTransactions.md)
326392
- [OpenapiClient::TransactionPaymentResponseRefundTransactionsDataInner](docs/TransactionPaymentResponseRefundTransactionsDataInner.md)
327393
- [OpenapiClient::TransactionPaymentResponseTransactionEntitySplitResponsesInner](docs/TransactionPaymentResponseTransactionEntitySplitResponsesInner.md)
@@ -343,35 +409,24 @@ Class | Method | HTTP request | Description
343409
- [OpenapiClient::VerifyBankAccountResponseHttpResponse](docs/VerifyBankAccountResponseHttpResponse.md)
344410

345411

346-
## Documentation for Authorization
347-
348-
349-
Authentication schemes defined for the API:
350-
### x-api-key
351-
352-
353-
- **Type**: API key
354-
- **API key parameter name**: x-api-key
355-
- **Location**: HTTP header
356-
357-
### x-app-key
358-
359-
360-
- **Type**: API key
361-
- **API key parameter name**: x-app-key
362-
- **Location**: HTTP header
412+
</details>
363413

364-
### x-version
414+
---
365415

416+
## Authorization
366417

367-
- **Type**: API key
368-
- **API key parameter name**: x-version
369-
- **Location**: HTTP header
418+
Authentication is handled via API keys in HTTP headers:
370419

371-
### origin
420+
| Key | Location | Description |
421+
| ------------- | -------- | ----------------------- |
422+
| **x-api-key** | Header | Your API key |
423+
| **x-app-key** | Header | Your App key |
424+
| **x-version** | Header | API version (e.g., 2.3) |
425+
| **origin** | Header | Your public IP address |
372426

427+
---
373428

374-
- **Type**: API key
375-
- **API key parameter name**: origin
376-
- **Location**: HTTP header
429+
## Support & Versioning
377430

431+
* **API Environments:** Use UAT for testing; switch to Production only after validation.
432+
* **Issues:** Report bugs or request features via the [GitHub Issues](https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-Ruby/issues) page.

0 commit comments

Comments
 (0)