Class: Devdraft::PaymentIntentsApi
- Inherits:
-
Object
- Object
- Devdraft::PaymentIntentsApi
- Defined in:
- lib/devdraft/api/payment_intents_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ PaymentIntentsApi
constructor
A new instance of PaymentIntentsApi.
-
#payment_intent_controller_create_bank_payment_intent(idempotency_key, create_bank_payment_intent_dto, opts = {}) ⇒ nil
Create a bank payment intent Creates a new bank payment intent for fiat-to-stablecoin transfers.
-
#payment_intent_controller_create_bank_payment_intent_with_http_info(idempotency_key, create_bank_payment_intent_dto, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create a bank payment intent Creates a new bank payment intent for fiat-to-stablecoin transfers.
-
#payment_intent_controller_create_stable_payment_intent(idempotency_key, create_stable_payment_intent_dto, opts = {}) ⇒ nil
Create a stable payment intent Creates a new stable payment intent for stablecoin-to-stablecoin transfers.
-
#payment_intent_controller_create_stable_payment_intent_with_http_info(idempotency_key, create_stable_payment_intent_dto, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create a stable payment intent Creates a new stable payment intent for stablecoin-to-stablecoin transfers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PaymentIntentsApi
Returns a new instance of PaymentIntentsApi.
19 20 21 |
# File 'lib/devdraft/api/payment_intents_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/devdraft/api/payment_intents_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#payment_intent_controller_create_bank_payment_intent(idempotency_key, create_bank_payment_intent_dto, opts = {}) ⇒ nil
Create a bank payment intent Creates a new bank payment intent for fiat-to-stablecoin transfers. This endpoint allows you to create payment intents for bank transfers (ACH, Wire, SEPA) that convert to stablecoins. Perfect for onboarding users from traditional banking to crypto. ## Supported Payment Rails - ACH_PUSH: US bank transfers (same-day or standard) - WIRE: International wire transfers - SEPA: European bank transfers ## Use Cases - USD bank account to USDC conversion - EUR bank account to EURC conversion - MXN bank account to stablecoin conversion - Flexible amount payment intents for variable pricing ## Supported Source Currencies - USD: US Dollar - EUR: Euro - MXN: Mexican Peso ## Example: USD Bank to USDC “‘json { "sourcePaymentRail": "ach_push", "sourceCurrency": "usd", "destinationCurrency": "usdc", "destinationNetwork": "ethereum", "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1", "amount": "1000.00", "customer_first_name": "John", "customer_last_name": "Doe", "customer_email": "[email protected]", "ach_reference": "INV12345" } “` ## Reference Fields Use appropriate reference fields based on the payment rail: - `ach_reference`: For ACH transfers (max 10 chars, alphanumeric + spaces) - `wire_message`: For wire transfers (max 256 chars) - `sepa_reference`: For SEPA transfers (6-140 chars, specific character set) ## Idempotency Include an `idempotency-key` header with a unique UUID v4 to prevent duplicate payments. Subsequent requests with the same key will return the original response.
28 29 30 31 |
# File 'lib/devdraft/api/payment_intents_api.rb', line 28 def payment_intent_controller_create_bank_payment_intent(idempotency_key, create_bank_payment_intent_dto, opts = {}) payment_intent_controller_create_bank_payment_intent_with_http_info(idempotency_key, create_bank_payment_intent_dto, opts) nil end |
#payment_intent_controller_create_bank_payment_intent_with_http_info(idempotency_key, create_bank_payment_intent_dto, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create a bank payment intent Creates a new bank payment intent for fiat-to-stablecoin transfers. This endpoint allows you to create payment intents for bank transfers (ACH, Wire, SEPA) that convert to stablecoins. Perfect for onboarding users from traditional banking to crypto. ## Supported Payment Rails - ACH_PUSH: US bank transfers (same-day or standard) - WIRE: International wire transfers - SEPA: European bank transfers ## Use Cases - USD bank account to USDC conversion - EUR bank account to EURC conversion - MXN bank account to stablecoin conversion - Flexible amount payment intents for variable pricing ## Supported Source Currencies - USD: US Dollar - EUR: Euro - MXN: Mexican Peso ## Example: USD Bank to USDC ```json { "sourcePaymentRail": "ach_push", "sourceCurrency": "usd", "destinationCurrency": "usdc", "destinationNetwork": "ethereum", "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1", "amount": "1000.00", "customer_first_name": "John", "customer_last_name": "Doe", "customer_email": "[email protected]", "ach_reference": "INV12345" } ``` ## Reference Fields Use appropriate reference fields based on the payment rail: - `ach_reference`: For ACH transfers (max 10 chars, alphanumeric + spaces) - `wire_message`: For wire transfers (max 256 chars) - `sepa_reference`: For SEPA transfers (6-140 chars, specific character set) ## Idempotency Include an `idempotency-key` header with a unique UUID v4 to prevent duplicate payments. Subsequent requests with the same key will return the original response.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/devdraft/api/payment_intents_api.rb', line 39 def payment_intent_controller_create_bank_payment_intent_with_http_info(idempotency_key, create_bank_payment_intent_dto, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.payment_intent_controller_create_bank_payment_intent ...' end # verify the required parameter 'idempotency_key' is set if @api_client.config.client_side_validation && idempotency_key.nil? fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling PaymentIntentsApi.payment_intent_controller_create_bank_payment_intent" end # verify the required parameter 'create_bank_payment_intent_dto' is set if @api_client.config.client_side_validation && create_bank_payment_intent_dto.nil? fail ArgumentError, "Missing the required parameter 'create_bank_payment_intent_dto' when calling PaymentIntentsApi.payment_intent_controller_create_bank_payment_intent" end # resource path local_var_path = '/api/v0/payment-intents/bank' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'idempotency-key'] = idempotency_key # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_bank_payment_intent_dto) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key'] = opts.merge( :operation => :"PaymentIntentsApi.payment_intent_controller_create_bank_payment_intent", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PaymentIntentsApi#payment_intent_controller_create_bank_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#payment_intent_controller_create_stable_payment_intent(idempotency_key, create_stable_payment_intent_dto, opts = {}) ⇒ nil
Create a stable payment intent Creates a new stable payment intent for stablecoin-to-stablecoin transfers. This endpoint allows you to create payment intents for transfers between different stablecoins and networks. Perfect for cross-chain stablecoin swaps and conversions. ## Use Cases - USDC to EURC conversions - Cross-chain stablecoin transfers (e.g., Ethereum USDC to Polygon USDC) - Flexible amount payment intents for dynamic pricing ## Example: USDC to EURC Conversion “‘json { "sourceCurrency": "usdc", "sourceNetwork": "ethereum", "destinationCurrency": "eurc", "destinationNetwork": "polygon", "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1", "amount": "100.00", "customer_first_name": "John", "customer_last_name": "Doe", "customer_email": "[email protected]" } “` ## Flexible Amount Payments Omit the `amount` field to create a flexible payment intent where users can specify the amount during payment. ## Idempotency Include an `idempotency-key` header with a unique UUID v4 to prevent duplicate payments. Subsequent requests with the same key will return the original response.
103 104 105 106 |
# File 'lib/devdraft/api/payment_intents_api.rb', line 103 def payment_intent_controller_create_stable_payment_intent(idempotency_key, create_stable_payment_intent_dto, opts = {}) payment_intent_controller_create_stable_payment_intent_with_http_info(idempotency_key, create_stable_payment_intent_dto, opts) nil end |
#payment_intent_controller_create_stable_payment_intent_with_http_info(idempotency_key, create_stable_payment_intent_dto, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Create a stable payment intent Creates a new stable payment intent for stablecoin-to-stablecoin transfers. This endpoint allows you to create payment intents for transfers between different stablecoins and networks. Perfect for cross-chain stablecoin swaps and conversions. ## Use Cases - USDC to EURC conversions - Cross-chain stablecoin transfers (e.g., Ethereum USDC to Polygon USDC) - Flexible amount payment intents for dynamic pricing ## Example: USDC to EURC Conversion ```json { "sourceCurrency": "usdc", "sourceNetwork": "ethereum", "destinationCurrency": "eurc", "destinationNetwork": "polygon", "destinationAddress": "0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8e1", "amount": "100.00", "customer_first_name": "John", "customer_last_name": "Doe", "customer_email": "[email protected]" } ``` ## Flexible Amount Payments Omit the `amount` field to create a flexible payment intent where users can specify the amount during payment. ## Idempotency Include an `idempotency-key` header with a unique UUID v4 to prevent duplicate payments. Subsequent requests with the same key will return the original response.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/devdraft/api/payment_intents_api.rb', line 114 def payment_intent_controller_create_stable_payment_intent_with_http_info(idempotency_key, create_stable_payment_intent_dto, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PaymentIntentsApi.payment_intent_controller_create_stable_payment_intent ...' end # verify the required parameter 'idempotency_key' is set if @api_client.config.client_side_validation && idempotency_key.nil? fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling PaymentIntentsApi.payment_intent_controller_create_stable_payment_intent" end # verify the required parameter 'create_stable_payment_intent_dto' is set if @api_client.config.client_side_validation && create_stable_payment_intent_dto.nil? fail ArgumentError, "Missing the required parameter 'create_stable_payment_intent_dto' when calling PaymentIntentsApi.payment_intent_controller_create_stable_payment_intent" end # resource path local_var_path = '/api/v0/payment-intents/stablecoin' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'idempotency-key'] = idempotency_key # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_stable_payment_intent_dto) # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['x-client-secret', 'x-client-key'] = opts.merge( :operation => :"PaymentIntentsApi.payment_intent_controller_create_stable_payment_intent", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PaymentIntentsApi#payment_intent_controller_create_stable_payment_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |