Class: Stripe::Crypto::OnrampSessionCreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Crypto::OnrampSessionCreateParams
- Defined in:
- lib/stripe/params/crypto/onramp_session_create_params.rb
Defined Under Namespace
Classes: KycDetails, WalletAddresses
Instance Attribute Summary collapse
-
#customer_ip_address ⇒ Object
The IP address of the customer the platform intends to onramp.
-
#destination_amount ⇒ Object
The default amount of crypto to exchange into.
-
#destination_currencies ⇒ Object
The list of destination cryptocurrencies a user can choose from.
-
#destination_currency ⇒ Object
The default destination cryptocurrency.
-
#destination_network ⇒ Object
The default destination crypto network.
-
#destination_networks ⇒ Object
The list of destination crypto networks user can choose from.
-
#expand ⇒ Object
Specifies which fields in the response should be expanded.
-
#kyc_details ⇒ Object
Pre-populate some of the required KYC information for the user if you've already collected it within your application.
-
#lock_wallet_address ⇒ Object
Whether or not to lock the suggested wallet address.
-
#metadata ⇒ Object
Set of key-value pairs that you can attach to an object.
-
#settlement_speed ⇒ Object
Speed at which the cryptocurrency is delivered to the wallet One of:
instant(default): crypto is delivered when payment is confirmedstandard: crypto is delivered when payment settles. -
#source_amount ⇒ Object
The default amount of fiat (in decimal) to exchange into crypto.
-
#source_currency ⇒ Object
The default source fiat currency for the onramp session.
-
#wallet_addresses ⇒ Object
The end customer's crypto wallet address (for each network) to use for this transaction.
Instance Method Summary collapse
-
#initialize(customer_ip_address: nil, destination_amount: nil, destination_currencies: nil, destination_currency: nil, destination_network: nil, destination_networks: nil, expand: nil, kyc_details: nil, lock_wallet_address: nil, metadata: nil, settlement_speed: nil, source_amount: nil, source_currency: nil, wallet_addresses: nil) ⇒ OnrampSessionCreateParams
constructor
A new instance of OnrampSessionCreateParams.
Methods inherited from RequestParams
attr_accessor, coerce_params, coerce_value, field_encodings, new, #to_h
Constructor Details
#initialize(customer_ip_address: nil, destination_amount: nil, destination_currencies: nil, destination_currency: nil, destination_network: nil, destination_networks: nil, expand: nil, kyc_details: nil, lock_wallet_address: nil, metadata: nil, settlement_speed: nil, source_amount: nil, source_currency: nil, wallet_addresses: nil) ⇒ OnrampSessionCreateParams
Returns a new instance of OnrampSessionCreateParams.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 89 def initialize( customer_ip_address: nil, destination_amount: nil, destination_currencies: nil, destination_currency: nil, destination_network: nil, destination_networks: nil, expand: nil, kyc_details: nil, lock_wallet_address: nil, metadata: nil, settlement_speed: nil, source_amount: nil, source_currency: nil, wallet_addresses: nil ) @customer_ip_address = customer_ip_address @destination_amount = destination_amount @destination_currencies = destination_currencies @destination_currency = destination_currency @destination_network = destination_network @destination_networks = destination_networks @expand = @kyc_details = kyc_details @lock_wallet_address = lock_wallet_address @metadata = @settlement_speed = settlement_speed @source_amount = source_amount @source_currency = source_currency @wallet_addresses = wallet_addresses end |
Instance Attribute Details
#customer_ip_address ⇒ Object
The IP address of the customer the platform intends to onramp.
If the user's IP is in a region we can't support, we return an HTTP 400 with an appropriate error code.
We support IPv4 and IPv6 addresses. Geographic supportability is checked again later in the onramp flow, which provides a way to hide the onramp option from ineligible users for a better user experience.
32 33 34 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 32 def customer_ip_address @customer_ip_address end |
#destination_amount ⇒ Object
The default amount of crypto to exchange into.
- When left null, a default value is computed if
source_amount,destination_currency, anddestination_networkare set. - When set, both
destination_currencyanddestination_networkmust also be set. All cryptocurrencies are supported to their full precisions (for example, 18 decimal places foreth). We validate and generate an error if the amount exceeds the supported precision based on the exchange currency. Settingsource_amountis mutually exclusive with settingdestination_amount(only one or the other is supported). Users can update the amount in the onramp UI.
37 38 39 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 37 def destination_amount @destination_amount end |
#destination_currencies ⇒ Object
The list of destination cryptocurrencies a user can choose from.
- When left null, all supported cryptocurrencies are shown in the onramp UI subject to
destination_networksif set. - When set, it must be a non-empty array where all values in the array are valid cryptocurrencies. You can use it to lock users to a specific cryptocurrency by passing a single value array. Users cannot override this parameter.
42 43 44 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 42 def destination_currencies @destination_currencies end |
#destination_currency ⇒ Object
The default destination cryptocurrency.
- When left null, the first value of
destination_currenciesis selected. - When set, if
destination_currenciesis also set, the value ofdestination_currencymust be present in that array. To lock adestination_currency, specify that value as the single value fordestination_currencies. Users can select a different cryptocurrency in the onramp UI subject todestination_currenciesif set.
47 48 49 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 47 def destination_currency @destination_currency end |
#destination_network ⇒ Object
The default destination crypto network.
- When left null, the first value of
destination_networksis selected. - When set, if
destination_networksis also set, the value ofdestination_networkmust be present in that array. To lock adestination_network, specify that value as the single value fordestination_networks. Users can select a different network in the onramp UI subject todestination_networksif set.
52 53 54 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 52 def destination_network @destination_network end |
#destination_networks ⇒ Object
The list of destination crypto networks user can choose from.
- When left null, all supported crypto networks are shown in the onramp UI.
- When set, it must be a non-empty array where values in the array are each a valid crypto network. It can be used to lock users to a specific network by passing a single value array. Users cannot override this parameter.
57 58 59 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 57 def destination_networks @destination_networks end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
59 60 61 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 59 def @expand end |
#kyc_details ⇒ Object
Pre-populate some of the required KYC information for the user if you've already collected it within your application.
Related guide: Using the API
63 64 65 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 63 def kyc_details @kyc_details end |
#lock_wallet_address ⇒ Object
Whether or not to lock the suggested wallet address. If destination tags are provided, this will also lock the destination tags.
65 66 67 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 65 def lock_wallet_address @lock_wallet_address end |
#metadata ⇒ Object
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.
67 68 69 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 67 def @metadata end |
#settlement_speed ⇒ Object
Speed at which the cryptocurrency is delivered to the wallet
One of:
instant (default): crypto is delivered when payment is confirmed
standard: crypto is delivered when payment settles
72 73 74 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 72 def settlement_speed @settlement_speed end |
#source_amount ⇒ Object
The default amount of fiat (in decimal) to exchange into crypto.
- When left null, a default value is computed if
destination_amountis set. - When set, setting
source_amountis mutually exclusive with settingdestination_amount(only one or the other is supported). We don't support fractional pennies. If fractional minor units of a currency are passed in, it generates an error. Users can update the value in the onramp UI.
77 78 79 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 77 def source_amount @source_amount end |
#source_currency ⇒ Object
The default source fiat currency for the onramp session.
- When left null, a default currency is selected based on user locale.
- When set, it must be one of the fiat currencies supported by onramp. Users can still select a different currency in the onramp UI.
82 83 84 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 82 def source_currency @source_currency end |
#wallet_addresses ⇒ Object
The end customer's crypto wallet address (for each network) to use for this transaction.
- When left null, the user enters their wallet in the onramp UI.
- When set, the platform must set either
destination_networksordestination_networkand we perform address validation. Users can still select a different wallet in the onramp UI.
87 88 89 |
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 87 def wallet_addresses @wallet_addresses end |