### Create Virtual Environment and Install Dependencies (Python) Source: https://github.com/ripple/payments-direct/blob/main/examples/python/README.md Sets up a Python virtual environment named 'venv1' and installs project dependencies from 'requirements.txt'. Requires Python 3.9+ and the Ripple Payments Direct SDK to be installed. ```bash cd examples/python python -m venv venv1 source venv1/bin/activate pip install -r requirements.txt ``` -------------------------------- ### Run Payment Workflow Example (Python) Source: https://github.com/ripple/payments-direct/blob/main/examples/python/README.md Executes the payment workflow example script. Requires the virtual environment to be activated and dependencies installed. This script initiates the payment process. ```python python payment_workflow.py ``` -------------------------------- ### Install Ripple Payments Direct SDK Locally (Python) Source: https://github.com/ripple/payments-direct/blob/main/examples/python/README.md Installs the Ripple Payments Direct SDK locally from the repository. Requires Python 3.9+ and Ripple API credentials. Installs the SDK package to the local Python environment. ```bash # From the repository root cd sdks/python pip install . ``` -------------------------------- ### Installation and Usage (Python) Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/README.md Instructions for installing and using the Ripple Payments Direct Python client library. ```APIDOC ## Installation & Usage (Python) ### pip install ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git ``` Then import the package: ```python import ripple_payments_direct ``` ### Setuptools ```sh python setup.py install --user ``` Then import the package: ```python import ripple_payments_direct ``` ### Getting Started ```python import ripple_payments_direct from ripple_payments_direct.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.test.ripple.com configuration = ripple_payments_direct.Configuration( host = "https://api.test.ripple.com" ) # Configure HTTP basic authorization (example): configuration = ripple_payments_direct.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` ``` -------------------------------- ### Install Python Client via Setuptools Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/README.md This code snippet demonstrates how to install the Ripple Payments Direct Python client package using Setuptools. It covers installation for the current user or for all users on the system. Python 3.9+ is required. ```sh python setup.py install --user # or for all users: sudo python setup.py install ``` -------------------------------- ### Go Client Installation and Dependencies Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md Installs necessary Go packages for the Payments Direct API client, including testing utilities and network context handling. These are required before importing the generated client package into your project. ```Go go get github.com/stretchr/testify/assert go get golang.org/x/net/context ``` -------------------------------- ### Install Payments Direct API Client (Maven) Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/README.md Installs the Payments Direct API client library to your local Maven repository. This command ensures the library is available for your project's build process. ```shell mvn clean install ``` -------------------------------- ### Install Python Client via Pip Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/README.md This code snippet shows how to install the Ripple Payments Direct Python client package from a Git repository using pip. It includes instructions for both regular and root installations. Ensure you have Python 3.9+ installed. ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git # or with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git ``` -------------------------------- ### Java Authentication API Example Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/README.md This Java code snippet demonstrates how to authenticate with the Ripple Payments Direct API using the AuthenticationApi. It configures API client, sets base path, and applies HTTP basic authentication. The example shows how to make a call to the `authenticate` method and handle potential API exceptions. It requires the ripple-payments-direct library. ```java import com.ripple.payments.direct.*; import com.ripple.payments.direct.auth.*; import com.ripple.payments.direct.model.*; import com.ripple.payments.direct.api.AuthenticationApi; public class AuthenticationApiExample { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.test.ripple.com"); // Configure HTTP basic authorization: BasicAuth HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); BasicAuth.setUsername("YOUR USERNAME"); BasicAuth.setPassword("YOUR PASSWORD"); AuthenticationApi apiInstance = new AuthenticationApi(defaultClient); AuthenticationRequestDTO authenticationRequestDTO = new AuthenticationRequestDTO(); // AuthenticationRequestDTO | String authorization = "Basic ZGVtbzpwQDU1dzByZA=="; // String | try { AuthenticationResponseDTO result = apiInstance.authenticate(authenticationRequestDTO, authorization); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AuthenticationApi#authenticate"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` -------------------------------- ### Get JSON Representation of GetBalances400ResponseErrorsInner in Python Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/docs/GetBalances400ResponseErrorsInner.md Provides an example of how to get the JSON string representation of a GetBalances400ResponseErrorsInner object. This is useful for logging or sending data. It requires the 'ripple-payments-direct' library. ```python from ripple_payments_direct.models.get_balances400_response_errors_inner import GetBalances400ResponseErrorsInner # Assume get_balances400_response_errors_inner_instance is already created # print the JSON string representation of the object print(GetBalances400ResponseErrorsInner.to_json()) ``` -------------------------------- ### Get Quote Collection using Ripple Payments Direct API Client Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/docs/QuoteApi.md This Python snippet illustrates how to fetch a quote collection using the QuoteApi client. It requires authentication setup (Bearer token example provided) and a quote collection ID. The code includes error handling for API requests and imports necessary models and exceptions. ```python import ripple_payments_direct import os from ripple_payments_direct.models.quote_collection import QuoteCollection from ripple_payments_direct.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to https://api.test.ripple.com # See configuration.py for a list of all supported configuration parameters. configuration = ripple_payments_direct.Configuration( host = "https://api.test.ripple.com" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (JWT): Bearer configuration = ripple_payments_direct.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with ripple_payments_direct.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = ripple_payments_direct.QuoteApi(api_client) quote_collection_id = '11111111-aaaa-2222-bbbb-222222222222' # str | The unique identifier of the quote collection you want to retrieve try: # Get quote collection api_response = api_instance.get_quote_collection(quote_collection_id) print("The response of QuoteApi->get_quote_collection:\n") pprint(api_response) except Exception as e: print("Exception when calling QuoteApi->get_quote_collection: %s\n" % e) ``` -------------------------------- ### Get Identity by ID Response (JSON) Source: https://context7.com/ripple/payments-direct/llms.txt Example JSON response detailing an identity, including its state, creation date, and partial PII data. ```json { "identityId": "146f3c51-c313-47ce-b6f2-691c5a238b3e", "identityType": "BENEFICIARY", "useCaseType": "BUSINESS", "nickName": "Acme Corp Mexico", "identityState": "ACTIVE", "version": 1, "createdAt": "2024-01-15T10:30:00.000Z", "piiData": { "Cdtr": { "Nm": "Botsford and Sons" } } } ``` -------------------------------- ### Get Payment by ID using Ripple Payments API (TypeScript) Source: https://github.com/ripple/payments-direct/blob/main/sdks/typescript/docs/PaymentsApi.md Provides an example of how to retrieve a specific payment by its ID using the PaymentsApi. This function returns detailed information about the payment. The 'paymentId' parameter is a string representing the unique identifier of the payment. ```typescript import { PaymentsApi, Configuration } from '@ripple/payments-direct-client'; const configuration = new Configuration(); const apiInstance = new PaymentsApi(configuration); let paymentId: string; //Unique identifier of the payment to get. (default to undefined) const { status, data } = await apiInstance.getPaymentById( paymentId ); ``` -------------------------------- ### Python SDK: Initialize Payment Workflow Source: https://context7.com/ripple/payments-direct/llms.txt Demonstrates the initial steps of setting up the Ripple Payments Direct Python SDK, including configuration, authentication, and initializing API clients for subsequent payment operations. This involves setting up the API endpoint, authenticating with provided credentials, and creating instances of various API services. ```python from ripple_payments_direct.configuration import Configuration from ripple_payments_direct.api_client import ApiClient from ripple_payments_direct.api.authentication_api import AuthenticationApi from ripple_payments_direct.api.quote_api import QuoteApi from ripple_payments_direct.api.identities_v2_api import IdentitiesV2Api from ripple_payments_direct.api.payments_api import PaymentsApi from ripple_payments_direct.models import * import time # Configure API client config = Configuration(host="https://api.test.ripple.com") api_client = ApiClient(configuration=config) # Authenticate auth_api = AuthenticationApi(api_client) auth_request = AuthenticationRequest( client_id="your_client_id", client_secret="your_client_secret", audience="urn:ripplexcurrent-test:your_tenant_id", grant_type="client_credentials" ) response = auth_api.authenticate(auth_request) api_client.configuration.access_token = response.access_token # Initialize APIs quote_api = QuoteApi(api_client) identity_api = IdentitiesV2Api(api_client) payments_api = PaymentsApi(api_client) # Create quote quote_request = QuoteCollectionRequest( source_currency="USD", destination_currency="MXN", quote_amount=100.0, quote_amount_type=QuoteAmountType("SOURCE_AMOUNT"), payin_category="FUNDED", payout_category="BANK" ) quote_response = quote_api.create_quote_collection(quote_request) quote_id = str(quote_response.quotes[0].quote_id) ``` -------------------------------- ### Get Quote using Java Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/QuoteApi.md This Java code snippet shows how to retrieve a specific quote using its unique identifier via the Ripple Payments Direct API. It involves client setup, authentication, and passing the quoteId. The function returns a QuoteDTO on success or throws an ApiException if the quote cannot be retrieved. ```java import com.ripple.payments.direct.ApiClient; import com.ripple.payments.direct.ApiException; import com.ripple.payments.direct.Configuration; import com.ripple.payments.direct.auth.*; import com.ripple.payments.direct.models.*; import com.ripple.payments.direct.api.QuoteApi; import java.util.UUID; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.test.ripple.com"); // Configure HTTP bearer authorization: Bearer HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); Bearer.setBearerToken("BEARER TOKEN"); QuoteApi apiInstance = new QuoteApi(defaultClient); UUID quoteId = UUID.fromString("22222222-aaaa-2222-bbbb-222222222222"); // UUID | The unique identifier of the quote to retrieve try { QuoteDTO result = apiInstance.getQuote(quoteId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling QuoteApi#getQuote"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` -------------------------------- ### Payments Direct API Client Library Installation (Gradle) Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/README.md Instructions for adding the Payments Direct API client library to a Gradle project. ```APIDOC ## Gradle Dependency ### Description To add the Payments Direct API client library as a dependency to your Gradle project, use the following instruction. ### Installation For Gradle users, add this dependency to your build file: ```groovy compile "com.ripple.payments:payments-direct-client:0.0.2" ``` ``` -------------------------------- ### Payments Direct API Client Library Installation (Maven) Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/README.md Instructions for adding the Payments Direct API client library to a Maven project. ```APIDOC ## Maven Dependency ### Description To install the API client library to your local Maven repository, or to add it as a dependency to your project, use the following instructions. ### Installation For Maven users, add this dependency to your project's POM: ```xml com.ripple.payments payments-direct-client 0.0.2 compile ``` To deploy to a remote Maven repository, configure the repository settings and execute `mvn clean deploy`. ``` -------------------------------- ### GET /v2/identities Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/docs/IdentitiesV2Api.md Get a list of identities. Retrieves a collection of all identities present in the system. ```APIDOC ## GET /v2/identities ### Description Get a list of identities. ### Method GET ### Endpoint /v2/identities ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of identities to return. - **offset** (integer) - Optional - The number of identities to skip before returning results. ### Response #### Success Response (200) - **GetIdentitiesResponse** (GetIdentitiesResponse) - A list of identities. #### Response Example ```json { "example": "response body" } ``` ### Authorization Bearer (JWT) ### HTTP Request Headers - Accept: application/json ``` -------------------------------- ### Go Client Configuration Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md Instructions on how to install and configure the Go client for the Payments Direct API, including setting server URLs. ```APIDOC ## Installation Install the following dependencies: ```sh go get github.com/stretchr/testify/assert go get golang.org/x/net/context ``` Put the package under your project folder and add the following in import: ```go import paymentsdirect "github.com/GIT_USER_ID/GIT_REPO_ID/paymentsdirect" ``` To use a proxy, set the environment variable `HTTP_PROXY`: ```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` ## Configuration of Server URL Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. ### Select Server Configuration For using other server than the one defined on index 0 set context value `paymentsdirect.ContextServerIndex` of type `int`. ```go ctx := context.WithValue(context.Background(), paymentsdirect.ContextServerIndex, 1) ``` ### Templated Server URL Templated server URL is formatted using default variables from configuration or from context value `paymentsdirect.ContextServerVariables` of type `map[string]string`. ```go ctx := context.WithValue(context.Background(), paymentsdirect.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` Note, enum values are always validated and all unused variables are silently ignored. ``` -------------------------------- ### Python SDK Payment Workflow Example Source: https://context7.com/ripple/payments-direct/llms.txt Demonstrates a complete end-to-end payment workflow using the Ripple Payments Direct Python SDK, including authentication, quoting, and initiating a payment. ```APIDOC ## Python SDK Payment Workflow ### Description Complete end-to-end payment workflow using the Python SDK. ### Code Example ```python from ripple_payments_direct.configuration import Configuration from ripple_payments_direct.api_client import ApiClient from ripple_payments_direct.api.authentication_api import AuthenticationApi from ripple_payments_direct.api.quote_api import QuoteApi from ripple_payments_direct.api.identities_v2_api import IdentitiesV2Api from ripple_payments_direct.api.payments_api import PaymentsApi from ripple_payments_direct.models import * import time # Configure API client config = Configuration(host="https://api.test.ripple.com") api_client = ApiClient(configuration=config) # Authenticate auth_api = AuthenticationApi(api_client) auth_request = AuthenticationRequest( client_id="your_client_id", client_secret="your_client_secret", audience="urn:ripplexcurrent-test:your_tenant_id", grant_type="client_credentials" ) response = auth_api.authenticate(auth_request) api_client.configuration.access_token = response.access_token # Initialize APIs quote_api = QuoteApi(api_client) identity_api = IdentitiesV2Api(api_client) payments_api = PaymentsApi(api_client) # Create quote quote_request = QuoteCollectionRequest( source_currency="USD", destination_currency="MXN", quote_amount=100.0, quote_amount_type=QuoteAmountType("SOURCE_AMOUNT"), payin_category="FUNDED", payout_category="BANK" ) quote_response = quote_api.create_quote_collection(quote_request) quote_id = str(quote_response.quotes[0].quote_id) # Further steps would involve creating an identity and then initiating a payment using the obtained quote_id. # For example: # # # Create identity (if not already existing) # create_identity_request = IdentityCreateRequest( # identity_type="BENEFICIARY", # account_holder_name="John Doe", # email_address="john.doe@example.com", # address="123 Main St", # country_code="US" # ) # create_identity_response = identity_api.create_identity(create_identity_request) # beneficiary_identity_id = str(create_identity_response.identity_id) # # # Initiate payment # payment_request = PaymentCollectionRequest( # quote_id=quote_id, # beneficiary_identity_id=beneficiary_identity_id, # source_amount=100.0, # source_currency="USD", # metadata={"order_id": "ORD-12345"} # ) # payment_response = payments_api.create_payment_collection(payment_request) # print(f"Payment initiated with ID: {payment_response.payment_id}") ``` ``` -------------------------------- ### GET /v2/identities/{identity-id} Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/docs/IdentitiesV2Api.md Get an identity by ID. Retrieves a specific identity using its unique identifier. ```APIDOC ## GET /v2/identities/{identity-id} ### Description Get an identity by ID. ### Method GET ### Endpoint /v2/identities/{identity-id} ### Parameters #### Path Parameters - **identity_id** (string) - Required - The unique UUID string of the identity to retrieve. ### Response #### Success Response (200) - **Identity** (Identity) - The details of the requested identity. #### Response Example ```json { "example": "response body" } ``` ### Authorization Bearer (JWT) ### HTTP Request Headers - Accept: application/json ``` -------------------------------- ### Basic Authentication Example (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md Illustrates how to configure and use HTTP basic authentication with a username and password in Go. It shows the creation of a BasicAuth struct and its inclusion in the request context. ```go auth := context.WithValue(context.Background(), paymentsdirect.ContextBasicAuth, paymentsdirect.BasicAuth{ UserName: "username", Password: "password", }) r, err := client.Service.Operation(auth, args) ``` -------------------------------- ### Initialize Ripple Payments Direct Client (Python) Source: https://github.com/ripple/payments-direct/blob/main/sdks/python/README.md This Python code illustrates how to initialize the Ripple Payments Direct API client. It shows how to set the host URL for the desired environment (e.g., test) and how to configure basic HTTP authentication using environment variables for username and password. Ensure Python 3.9+ is installed and environment variables are set. ```python import ripple_payments_direct from ripple_payments_direct.rest import ApiException from pprint import pprint import os # Defining the host is optional and defaults to https://api.test.ripple.com # See configuration.py for a list of all supported configuration parameters. configuration = ripple_payments_direct.Configuration( host = "https://api.test.ripple.com" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure HTTP basic authorization: BasicAuth configuration = ripple_payments_direct.Configuration( username = os.environ["USERNAME"], password = os.environ["PASSWORD"] ) ``` -------------------------------- ### GET /v2/identities - Get Identities Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/IdentitiesV2Api.md Retrieves a list of all identities associated with the account. This endpoint is useful for auditing and management purposes. ```APIDOC ## GET /v2/identities ### Description Get a list of identities. ### Method GET ### Endpoint /v2/identities ### Parameters *No specific parameters are listed for this endpoint in the provided text.* ### Response #### Success Response (200) - **Array of Identity objects** (Details not specified in provided text) ### Request Example ```java // Example using Java SDK (assuming a method exists for this) List identities = apiInstance.getIdentitiesV2(); System.out.println(identities); ``` ### Authorization Bearer token authentication is required. ### Headers - Accept: application/json ``` -------------------------------- ### Get Payment by ID (Bash) Source: https://context7.com/ripple/payments-direct/llms.txt Retrieves the details of a specific payment using its ID via a GET request. Requires an authorization token. ```bash curl -X GET https://api.test.ripple.com/v2/payments/7ea3399c-1234-5678-8d8f-d320ea406630 \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` -------------------------------- ### Create Payment with Ripple Payments API (Java) Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/PaymentsApi.md Demonstrates how to create a payment using the Ripple Payments API. It includes setting up the API client, authentication, and handling the payment request and response. Dependencies include the Ripple Payments Direct SDK. Inputs are a PaymentRequestDTO, and outputs are a PaymentDTO or an ApiException. ```java import com.ripple.payments.direct.ApiClient; import com.ripple.payments.direct.ApiException; import com.ripple.payments.direct.Configuration; import com.ripple.payments.direct.auth.*; import com.ripple.payments.direct.models.*; import com.ripple.payments.direct.api.PaymentsApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("https://api.test.ripple.com"); // Configure HTTP bearer authorization: Bearer HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer"); Bearer.setBearerToken("BEARER TOKEN"); PaymentsApi apiInstance = new PaymentsApi(defaultClient); PaymentRequestDTO paymentRequestDTO = new PaymentRequestDTO(); // PaymentRequestDTO | create payment request try { PaymentDTO result = apiInstance.createPayment(paymentRequestDTO); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PaymentsApi#createPayment"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } } ``` -------------------------------- ### GET /v2/identities/{identity-id} - Get Identity by ID Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/IdentitiesV2Api.md Retrieves a specific identity by its unique identifier. This endpoint provides detailed information about a single identity. ```APIDOC ## GET /v2/identities/{identity-id} ### Description Get an identity by ID. ### Method GET ### Endpoint /v2/identities/{identity-id} ### Parameters #### Path Parameters - **identity-id** (String) - Required - The unique UUID string that identifies the identity to retrieve. ### Response #### Success Response (200) - **Identity object** (Details not specified in provided text) ### Request Example ```java // Example using Java SDK (assuming a method exists for this) String identityId = "some-uuid-string"; Identity identity = apiInstance.getIdentityByIdV2(identityId); System.out.println(identity); ``` ### Authorization Bearer token authentication is required. ### Headers - Accept: application/json ``` -------------------------------- ### FeeSummary Constructor (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/FeeSummary.md Provides constructors for creating new FeeSummary objects. NewFeeSummary initializes with default values and required properties, while NewFeeSummaryWithDefaults initializes only with defined default values. ```Go func NewFeeSummary() *FeeSummary { } func NewFeeSummaryWithDefaults() *FeeSummary { } ``` -------------------------------- ### GET /ripple/payments-direct/quotes/{quoteCollectionId} Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/QuoteApi.md Retrieves a specific quote collection by its unique identifier. This endpoint is used to get detailed information about a previously generated quote collection. ```APIDOC ## GET /ripple/payments-direct/quotes/{quoteCollectionId} ### Description Retrieves a specific quote collection by its unique identifier. This endpoint is used to get detailed information about a previously generated quote collection. ### Method GET ### Endpoint `/ripple/payments-direct/quotes/{quoteCollectionId}` ### Parameters #### Path Parameters - **quoteCollectionId** (UUID) - Required - The unique identifier of the quote collection you want to retrieve ### Request Example ```json { "quoteCollectionId": "11111111-aaaa-2222-bbbb-222222222222" } ``` ### Response #### Success Response (200) - **QuoteCollectionDTO** (object) - Contains the details of the requested quote collection. #### Response Example ```json { "quoteCollectionId": "11111111-aaaa-2222-bbbb-222222222222", "quotes": [ { "quoteId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "amount": { "value": "100.00", "currency": "USD" }, "expiresAt": "2023-10-27T10:00:00Z" } ] } ``` ### Error Handling - **401**: Unauthorized request. - **403**: The principal identified by the authorization header doesn't have enough scopes to perform this operation. - **404**: Quote collection not found. - **500**: Internal server error. ``` -------------------------------- ### Generate and Package Payments Direct Client JAR (Maven) Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/README.md Generates the JAR file for the Payments Direct client library and packages it. This is a prerequisite for manual installation if not using Maven or Gradle for dependency management. ```shell mvn clean package ``` -------------------------------- ### Go: InternalId Management Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/Originator.md Methods for managing the `InternalId` field. Includes functions to get the ID, get it with a boolean indicating if it's set, set the ID, and check if it has been set. ```Go func (o *Originator) GetInternalId() string { // ... implementation details ... } func (o *Originator) GetInternalIdOk() (*string, bool) { // ... implementation details ... } func (o *Originator) SetInternalId(v string) { // ... implementation details ... } func (o *Originator) HasInternalId() bool { // ... implementation details ... } ``` -------------------------------- ### Go Client Select Server Configuration Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md Shows how to select a specific server configuration for the API client using a context value. This allows switching between different API environments (e.g., test, production) by providing the index of the desired server. ```Go ctx := context.WithValue(context.Background(), paymentsdirect.ContextServerIndex, 1) ``` -------------------------------- ### Go: OriginatorIdentityNickName Management Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/Originator.md Methods for managing the `OriginatorIdentityNickName` field. Includes functions to get the nickname, get it with a boolean indicating if it's set, set the nickname, and check if it has been set. ```Go func (o *Originator) GetOriginatorIdentityNickName() string { // ... implementation details ... } func (o *Originator) GetOriginatorIdentityNickNameOk() (*string, bool) { // ... implementation details ... } func (o *Originator) SetOriginatorIdentityNickName(v string) { // ... implementation details ... } func (o *Originator) HasOriginatorIdentityNickName() bool { // ... implementation details ... } ``` -------------------------------- ### Create IdentityResponseV2 Instance (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/IdentityResponseV2.md Provides constructors for creating new IdentityResponseV2 objects. NewIdentityResponseV2 is a primary constructor that ensures required fields are set, while NewIdentityResponseV2WithDefaults initializes an object with default values for optional fields. ```Go func NewIdentityResponseV2(identityId string, identityType IdentityTypeV2, createdAt time.Time, identityState StateType, piiData map[string]interface{}, version int32, useCaseType UseCaseType, ) *IdentityResponseV2 { // ... implementation ... } func NewIdentityResponseV2WithDefaults() *IdentityResponseV2 { // ... implementation ... } ``` -------------------------------- ### Go: OriginatorIdentityIdVersion Management Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/Originator.md Methods for managing the `OriginatorIdentityIdVersion` field. Includes functions to get the version, get it with a boolean indicating if it's set, set the version, and check if it has been set. ```Go func (o *Originator) GetOriginatorIdentityIdVersion() int32 { // ... implementation details ... } func (o *Originator) GetOriginatorIdentityIdVersionOk() (*int32, bool) { // ... implementation details ... } func (o *Originator) SetOriginatorIdentityIdVersion(v int32) { // ... implementation details ... } func (o *Originator) HasOriginatorIdentityIdVersion() bool { // ... implementation details ... } ``` -------------------------------- ### Go: OriginatorIdentityId Management Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/Originator.md Methods for managing the `OriginatorIdentityId` field. Includes functions to get the ID, get it with a boolean indicating if it's set, set the ID, and check if it has been set. ```Go func (o *Originator) GetOriginatorIdentityId() string { // ... implementation details ... } func (o *Originator) GetOriginatorIdentityIdOk() (*string, bool) { // ... implementation details ... } func (o *Originator) SetOriginatorIdentityId(v string) { // ... implementation details ... } func (o *Originator) HasOriginatorIdentityId() bool { // ... implementation details ... } ``` -------------------------------- ### Deploy Payments Direct API Client to Remote Repository (Maven) Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/README.md Deploys the Payments Direct API client library to a remote Maven repository. This requires prior configuration of your repository settings. ```shell mvn clean deploy ``` -------------------------------- ### Bearer Token Authentication Example (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md Demonstrates how to set up and use Bearer token authentication for API requests in Go. This involves creating a context with the access token and passing it to the client service operation. ```go auth := context.WithValue(context.Background(), paymentsdirect.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` -------------------------------- ### BusinessUseCase Management (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/TransactionDetails.md Methods for managing the BusinessUseCase field within TransactionDetails. Includes getting the value, checking if it's set, and getting a tuple with the value and a boolean indicating if it's set. ```go func (o *TransactionDetails) GetBusinessUseCase() string func (o *TransactionDetails) GetBusinessUseCaseOk() (*string, bool) ``` -------------------------------- ### Create New IdentityV2 Object (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/IdentityV2.md Provides constructors for creating new IdentityV2 objects. NewIdentityV2 takes all necessary fields as arguments, while NewIdentityV2WithDefaults initializes an object with default values. ```go func NewIdentityV2(identityId string, nickName string, createdAt time.Time, identityType IdentityTypeV2, useCaseType UseCaseType) *IdentityV2 { // ... implementation details ... return &IdentityV2{} } func NewIdentityV2WithDefaults() *IdentityV2 { // ... implementation details ... return &IdentityV2{} } ``` -------------------------------- ### Get and Set UseCaseType for IdentityResponseV2 (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/IdentityResponseV2.md Provides Go functions to get the UseCaseType field from IdentityResponseV2, either directly or with a boolean flag indicating if it's set. Also includes a function to set the UseCaseType. ```Go func (o *IdentityResponseV2) GetUseCaseType() UseCaseType // GetUseCaseType returns the UseCaseType field if non-nil, zero value otherwise. func (o *IdentityResponseV2) GetUseCaseTypeOk() (*UseCaseType, bool) // GetUseCaseTypeOk returns a tuple with the UseCaseType field if it's non-nil, zero value otherwise // and a boolean to check if the value has been set. func (o *IdentityResponseV2) SetUseCaseType(v UseCaseType) // SetUseCaseType sets UseCaseType field to given value. ``` -------------------------------- ### Instantiate GetBalances400Response (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/GetBalances400Response.md Provides functions to create new instances of the GetBalances400Response struct. NewGetBalances400Response is a constructor that initializes required fields, while NewGetBalances400ResponseWithDefaults creates an instance with default values. ```go func NewGetBalances400Response(status int32, errors []GetBalances400ResponseErrorsInner) *GetBalances400Response { // ... implementation details ... } func NewGetBalances400ResponseWithDefaults() *GetBalances400Response { // ... implementation details ... } ``` -------------------------------- ### Get and Set Version for IdentityResponseV2 (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/IdentityResponseV2.md Provides Go functions to get the Version field from IdentityResponseV2, either directly or with a boolean flag indicating if it's set. Also includes a function to set the Version. ```Go func (o *IdentityResponseV2) GetVersion() int32 // GetVersion returns the Version field if non-nil, zero value otherwise. func (o *IdentityResponseV2) GetVersionOk() (*int32, bool) // GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise // and a boolean to check if the value has been set. func (o *IdentityResponseV2) SetVersion(v int32) // SetVersion sets Version field to given value. ``` -------------------------------- ### API Environments Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md Information about the available environments for the Payments Direct API, including their base URLs and descriptions. ```APIDOC ## API Environments The Payments Direct API offers the following environments: | Environment | Base URL | Description | |---------------|-------------------------------|------------------------------------------| | Test | `https://api.test.ripple.com` | Test environment with simulated currency. | | Production | `https://api.ripple.com` | Production environment | ``` -------------------------------- ### Go: Get and Set ClientId for AuthenticationRequest Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/AuthenticationRequest.md Demonstrates how to retrieve and set the ClientId for an AuthenticationRequest object in Go. Includes methods to get the value directly or with a boolean indicating if it's set, and a method to set the value. ```go func (o *AuthenticationRequest) GetClientId() string { // ... implementation details ... } func (o *AuthenticationRequest) GetClientIdOk() (*string, bool) { // ... implementation details ... } func (o *AuthenticationRequest) SetClientId(v string) { // ... implementation details ... } ``` -------------------------------- ### Utility Methods for Pointer Creation Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/README.md This section outlines utility functions provided to easily obtain pointers to basic data types. These are useful when working with models that use pointers for their members. ```APIDOC ## Utility Methods for Pointer Creation ### Description This package provides utility functions to generate pointers to basic data types. These are particularly useful when the API models use pointers for all their members. ### Available Functions - `PtrBool` - `PtrInt` - `PtrInt32` - `PtrInt64` - `PtrFloat` - `PtrFloat32` - `PtrFloat64` - `PtrString` - `PtrTime Each function takes a value of the specified basic type and returns a pointer to it. ``` -------------------------------- ### Go: Get and Set Audience for AuthenticationRequest Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/AuthenticationRequest.md Explains the Go methods for retrieving and updating the Audience field within an AuthenticationRequest. This includes functions to get the audience string and a boolean indicating if it's set, as well as a function to set the audience. ```go func (o *AuthenticationRequest) GetAudience() string { // ... implementation details ... } func (o *AuthenticationRequest) GetAudienceOk() (*string, bool) { // ... implementation details ... } func (o *AuthenticationRequest) SetAudience(v string) { // ... implementation details ... } ``` -------------------------------- ### Instantiate QuoteCollection (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/QuoteCollection.md Provides functions to create a new QuoteCollection object. NewQuoteCollection requires essential parameters, while NewQuoteCollectionWithDefaults uses default values. These constructors are crucial for initializing QuoteCollection instances in Go applications. ```go func NewQuoteCollection(quoteCollectionId string, quotes []Quote) *QuoteCollection func NewQuoteCollectionWithDefaults() *QuoteCollection ``` -------------------------------- ### Instantiate SearchPaymentsRequest (Go) Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/SearchPaymentsRequest.md Provides constructors for creating new SearchPaymentsRequest objects. NewSearchPaymentsRequest assigns default values and ensures required fields are set, while NewSearchPaymentsRequestWithDefaults only sets default values. ```Go func NewSearchPaymentsRequest() *SearchPaymentsRequest { // ... implementation details ... } func NewSearchPaymentsRequestWithDefaults() *SearchPaymentsRequest { // ... implementation details ... } ``` -------------------------------- ### GET /v2/quotes/{quote-id} Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/QuoteAPI.md Retrieves a specific quote by its ID. ```APIDOC ## GET /v2/quotes/{quote-id} ### Description Get quote ### Method GET ### Endpoint /v2/quotes/{quote-id} ### Parameters #### Path Parameters - **quoteId** (string) - Required - The unique identifier of the quote to retrieve #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **Quote** (Quote) - The requested quote details. #### Response Example ```json { "example": "{\"id\": \"22222222-aaaa-2222-bbbb-222222222222\", \"amount\": 123.45, \"amount_type\": \"SOURCE_AMOUNT\", \"source_currency\": \"USD\", \"destination_currency\": \"MXN\", \"payment_method\": \"BANK\", \"payment_type\": \"FUNDED\", \"created_at\": \"2023-10-27T10:00:00Z\", \"expires_at\": \"2023-10-27T11:00:00Z\", \"status\": \"ACTIVE\"}" } ``` ### Authorization [Bearer](../README.md#Bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### Go: Create New PaymentFilter Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/PaymentFilter.md Provides constructors for creating a new PaymentFilter object. NewPaymentFilter initializes with default values and ensures required fields are set, while NewPaymentFilterWithDefaults only sets defined default values. ```go func NewPaymentFilter() *PaymentFilter { // ... implementation details ... } func NewPaymentFilterWithDefaults() *PaymentFilter { // ... implementation details ... } ``` -------------------------------- ### GET /v2/quotes/quote-collection/{quote-collection-id} Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/QuoteAPI.md Retrieves a specific quote collection by its ID. ```APIDOC ## GET /v2/quotes/quote-collection/{quote-collection-id} ### Description Get quote collection ### Method GET ### Endpoint /v2/quotes/quote-collection/{quote-collection-id} ### Parameters #### Path Parameters - **quoteCollectionId** (string) - Required - The unique identifier of the quote collection you want to retrieve #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **QuoteCollection** (QuoteCollection) - The requested quote collection details. #### Response Example ```json { "example": "{\"id\": \"11111111-aaaa-2222-bbbb-222222222222\", \"amount\": 123.45, \"amount_type\": \"SOURCE_AMOUNT\", \"source_currency\": \"USD\", \"destination_currency\": \"MXN\", \"payment_method\": \"BANK\", \"payment_type\": \"FUNDED\", \"created_at\": \"2023-10-27T10:00:00Z\", \"expires_at\": \"2023-10-27T11:00:00Z\", \"status\": \"ACTIVE\"}" } ``` ### Authorization [Bearer](../README.md#Bearer) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ``` -------------------------------- ### GET /ripple/payments-direct/{paymentId} Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/PaymentWithDetailsDTO.md Retrieves the details of a specific payment using its unique identifier. ```APIDOC ## GET /ripple/payments-direct/{paymentId} ### Description Retrieves the details of a specific payment using its unique identifier. ### Method GET ### Endpoint /ripple/payments-direct/{paymentId} ### Parameters #### Path Parameters - **paymentId** (UUID) - Required - The unique ID that identifies this payment. This value is the same as the quote ID. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **paymentId** (UUID) - The unique ID that identifies this payment. This value is the same as the quote ID. - **cryptoTransactionHash** (String) - Transaction hash of the crypto payment on the destination blockchain network [optional] - **initiatedAt** (OffsetDateTime) - The time at which the payment was initiated, specified in UTC. [optional] - **expiresAt** (OffsetDateTime) - The time at which this payment expires, specified in UTC. [optional] - **lastStateUpdatedAt** (OffsetDateTime) - The time at which the payment state was last updated for this payment, specified in UTC. [optional] - **paymentState** (PaymentStateDTO) - Payment state information. - **originator** (OriginatorDTO) - Originator details. [optional] - **destination** (DestinationDTO) - Destination details. [optional] - **adjustedExchangeRate** (AdjustedExchangeRateDTO) - Adjusted exchange rate information. [optional] - **fees** (List) - A summary of fees included in payment quote. [optional] - **sourceOfCash** (String) - Source of Cash may be required depending on corridor and payout partner. Valid Source of Cash values vary by corridor. [optional] - **purposeCode** (String) - Purpose Code may be required depending on corridor and payout partner. Valid Purpose Code values vary by corridor. [optional] - **transactionDetails** (TransactionDetailsDTO) - Transaction details. [optional] - **errors** (List) - A list of errors associated with the payment. [optional] - **paymentLabels** (List) - Application-defined labels for grouping and categorizing payments (e.g., campaign IDs, workflow tags, or batch identifiers). Labels are optional and mutable; they can be added or removed over the payment’s lifetime. [optional] #### Response Example ```json { "paymentId": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "cryptoTransactionHash": "0xabc123def456", "initiatedAt": "2023-10-27T10:00:00Z", "expiresAt": "2023-10-27T11:00:00Z", "lastStateUpdatedAt": "2023-10-27T10:30:00Z", "paymentState": { "status": "COMPLETED", "state": "SUCCEEDED" }, "originator": { "name": "Sender Name", "type": "INDIVIDUAL" }, "destination": { "accountId": "dest123", "type": "BANK_ACCOUNT" }, "fees": [ { "amount": { "currency": "USD", "value": "10.00" }, "type": "TRANSACTION_FEE" } ], "sourceOfCash": "SALARY", "purposeCode": "PERSONAL_TRANSFER", "paymentLabels": ["campaign_x", "batch_123"] } ``` ``` -------------------------------- ### Go: Create StateTransitionsResponse Source: https://github.com/ripple/payments-direct/blob/main/sdks/go/docs/StateTransitionsResponse.md Provides functions to instantiate a new StateTransitionsResponse object. NewStateTransitionsResponse allows for direct initialization with state transitions, while NewStateTransitionsResponseWithDefaults uses default values. ```Go func NewStateTransitionsResponse(stateTransitions []StateTransition) *StateTransitionsResponse { // ... implementation ... } func NewStateTransitionsResponseWithDefaults() *StateTransitionsResponse { // ... implementation ... } ``` -------------------------------- ### TypeScript Example: Instantiating PaymentWithDetails Source: https://github.com/ripple/payments-direct/blob/main/sdks/typescript/docs/PaymentWithDetails.md This TypeScript code snippet demonstrates how to create an instance of the PaymentWithDetails model. It imports the necessary type from the '@ripple/payments-direct-client' library and assigns values to each property of the PaymentWithDetails object. ```typescript import { PaymentWithDetails } from '@ripple/payments-direct-client'; const instance: PaymentWithDetails = { paymentId, cryptoTransactionHash, initiatedAt, expiresAt, lastStateUpdatedAt, paymentState, originator, destination, adjustedExchangeRate, fees, sourceOfCash, purposeCode, transactionDetails, errors, paymentLabels, }; ``` -------------------------------- ### Get Balances Source: https://github.com/ripple/payments-direct/blob/main/sdks/java/docs/GetBalances200ResponseBalancesInnerDTO.md Retrieves the customer's available prefund balance for a specific currency. ```APIDOC ## GET /ripple/payments-direct/balances ### Description Retrieves the customer's available prefund balance for a specific currency. ### Method GET ### Endpoint /ripple/payments-direct/balances ### Parameters #### Query Parameters - **currency** (String) - Required - The currency code for which to retrieve the balance. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **balances** (Array[GetBalances200ResponseBalancesInnerDTO]) - An array of balance objects, each containing funding type, currency, available balance, and reserved balance. ##### GetBalances200ResponseBalancesInnerDTO - **fundingType** (FundingTypeEnum) - The funding method associated with your account. - **currency** (String) - Currency code. - **availableBalance** (BigDecimal) - Available funded balance that you can use to initiate payments. - **reservedBalance** (BigDecimal) - Amount reserved to complete in-progress transactions. You can't use this amount to initiate new payments. ##### Enum: FundingTypeEnum - **FUNDED** (String) - "FUNDED" #### Response Example ```json { "balances": [ { "fundingType": "FUNDED", "currency": "USD", "availableBalance": "1000.50", "reservedBalance": "200.00" } ] } ``` ```