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



1777
1778
1779
1780
1781
1782
1783
1784
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1777

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



1772
1773
1774
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1772

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



1787
1788
1789
1790
1791
1792
1793
1794
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1787

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



1797
1798
1799
1800
1801
1802
1803
1804
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1797

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