Class: Stripe::SharedPayment::GrantedToken::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/shared_payment/granted_token.rb

Constant Summary collapse

RESOURCE_CLASS =
GrantedToken

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResourceTestHelpers

custom_method, #initialize, resource_url, #resource_url

Methods included from APIOperations::Request

included

Constructor Details

This class inherits a constructor from Stripe::APIResourceTestHelpers

Class Method Details

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

Creates a new test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to create SharedPaymentGrantedTokens for testing their integration



87
88
89
90
91
92
93
94
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 87

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/test_helpers/shared_payment/granted_tokens",
    params: params,
    opts: opts
  )
end

.resource_classObject



82
83
84
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 82

def self.resource_class
  "GrantedToken"
end

.revoke(shared_payment_granted_token, params = {}, opts = {}) ⇒ Object

Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration



97
98
99
100
101
102
103
104
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 97

def self.revoke(shared_payment_granted_token, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/shared_payment/granted_tokens/%<shared_payment_granted_token>s/revoke", { shared_payment_granted_token: CGI.escape(shared_payment_granted_token) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

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

Revokes a test SharedPaymentGrantedToken object. This endpoint is only available in test mode and allows sellers to revoke SharedPaymentGrantedTokens for testing their integration



107
108
109
110
111
112
113
114
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 107

def revoke(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/shared_payment/granted_tokens/%<shared_payment_granted_token>s/revoke", { shared_payment_granted_token: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end