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



636
637
638
639
640
641
642
643
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 636

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



631
632
633
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 631

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



646
647
648
649
650
651
652
653
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 646

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



656
657
658
659
660
661
662
663
# File 'lib/stripe/resources/shared_payment/granted_token.rb', line 656

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