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



1721
1722
1723
1724
1725
1726
1727
1728
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1721

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



1716
1717
1718
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1716

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



1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1731

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



1741
1742
1743
1744
1745
1746
1747
1748
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 1741

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