Class: Stripe::PaymentMethodDomainService

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

Defined Under Namespace

Classes: CreateParams, ListParams, RetrieveParams, UpdateParams, ValidateParams

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

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

Creates a payment method domain.



83
84
85
86
87
88
89
90
91
# File 'lib/stripe/services/payment_method_domain_service.rb', line 83

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

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

Lists the details of existing payment method domains.



94
95
96
97
98
99
100
101
102
# File 'lib/stripe/services/payment_method_domain_service.rb', line 94

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

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

Retrieves the details of an existing payment method domain.



105
106
107
108
109
110
111
112
113
# File 'lib/stripe/services/payment_method_domain_service.rb', line 105

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

#update(payment_method_domain, params = {}, opts = {}) ⇒ Object

Updates an existing payment method domain.



116
117
118
119
120
121
122
123
124
# File 'lib/stripe/services/payment_method_domain_service.rb', line 116

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

#validate(payment_method_domain, params = {}, opts = {}) ⇒ Object

Some payment methods might require additional steps to register a domain. If the requirements weren’t satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn’t appear in Elements or Embedded Checkout for this domain until it is active.

To activate a payment method on an existing payment method domain, complete the required registration steps specific to the payment method, and then validate the payment method domain with this endpoint.

Related guides: [Payment method domains](stripe.com/docs/payments/payment-methods/pmd-registration).



132
133
134
135
136
137
138
139
140
# File 'lib/stripe/services/payment_method_domain_service.rb', line 132

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