Class: Stripe::Crypto::OnrampSessionCreateParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/crypto/onramp_session_create_params.rb

Defined Under Namespace

Classes: KycDetails, WalletAddresses

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = 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_addressObject

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_amountObject

The default amount of crypto to exchange into.

  • When left null, a default value is computed if source_amount, destination_currency, and destination_network are set.
  • When set, both destination_currency and destination_network must also be set. All cryptocurrencies are supported to their full precisions (for example, 18 decimal places for eth). We validate and generate an error if the amount exceeds the supported precision based on the exchange currency. Setting source_amount is mutually exclusive with setting destination_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_currenciesObject

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_networks if 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_currencyObject

The default destination cryptocurrency.

  • When left null, the first value of destination_currencies is selected.
  • When set, if destination_currencies is also set, the value of destination_currency must be present in that array. To lock a destination_currency, specify that value as the single value for destination_currencies. Users can select a different cryptocurrency in the onramp UI subject to destination_currencies if set.


47
48
49
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 47

def destination_currency
  @destination_currency
end

#destination_networkObject

The default destination crypto network.

  • When left null, the first value of destination_networks is selected.
  • When set, if destination_networks is also set, the value of destination_network must be present in that array. To lock a destination_network, specify that value as the single value for destination_networks. Users can select a different network in the onramp UI subject to destination_networks if set.


52
53
54
# File 'lib/stripe/params/crypto/onramp_session_create_params.rb', line 52

def destination_network
  @destination_network
end

#destination_networksObject

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

#expandObject

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
  @expand
end

#kyc_detailsObject

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_addressObject

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

#metadataObject

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_speedObject

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_amountObject

The default amount of fiat (in decimal) to exchange into crypto.

  • When left null, a default value is computed if destination_amount is set.
  • When set, setting source_amount is mutually exclusive with setting destination_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_currencyObject

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_addressesObject

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_networks or destination_network and 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