Class: Stripe::Crypto::OnrampSessionService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/crypto/onramp_session_service.rb

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#checkout(id, params = {}, opts = {}) ⇒ Object

Completes a headless CryptoOnrampSession.

This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer.



10
11
12
13
14
15
16
17
18
# File 'lib/stripe/services/crypto/onramp_session_service.rb', line 10

def checkout(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/crypto/onramp_sessions/%<id>s/checkout", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#create(params = {}, opts = {}) ⇒ Object

Creates a CryptoOnrampSession object.

After the CryptoOnrampSession is created, display the onramp session modal using the client_secret.

Related guide: Set up an onramp integration



25
26
27
28
29
30
31
32
33
# File 'lib/stripe/services/crypto/onramp_session_service.rb', line 25

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/crypto/onramp_sessions",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#list(params = {}, opts = {}) ⇒ Object

Returns a list of onramp sessions that match the filter criteria. The onramp sessions are returned in sorted order, with the most recent onramp sessions appearing first.



36
37
38
39
40
41
42
43
44
# File 'lib/stripe/services/crypto/onramp_session_service.rb', line 36

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/crypto/onramp_sessions",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#quote(id, params = {}, opts = {}) ⇒ Object

Refreshes an executable quote for a CryptoOnrampSession.



47
48
49
50
51
52
53
54
55
# File 'lib/stripe/services/crypto/onramp_session_service.rb', line 47

def quote(id, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/crypto/onramp_sessions/%<id>s/quote", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Retrieves the details of a CryptoOnrampSession that was previously created.



58
59
60
61
62
63
64
65
66
# File 'lib/stripe/services/crypto/onramp_session_service.rb', line 58

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/crypto/onramp_sessions/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end