Class: Stripe::Issuing::Authorization::TestHelpers

Inherits:
APIResourceTestHelpers show all
Defined in:
lib/stripe/resources/issuing/authorization.rb

Constant Summary collapse

RESOURCE_CLASS =
Authorization

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

.capture(authorization, params = {}, opts = {}) ⇒ Object

Capture a test-mode authorization.



582
583
584
585
586
587
588
589
# File 'lib/stripe/resources/issuing/authorization.rb', line 582

def self.capture(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/capture", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

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

Create a test-mode authorization.



602
603
604
605
606
607
608
609
# File 'lib/stripe/resources/issuing/authorization.rb', line 602

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

.expire(authorization, params = {}, opts = {}) ⇒ Object

Expire a test-mode Authorization.



612
613
614
615
616
617
618
619
# File 'lib/stripe/resources/issuing/authorization.rb', line 612

def self.expire(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/expire", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.finalize_amount(authorization, params = {}, opts = {}) ⇒ Object

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.



632
633
634
635
636
637
638
639
# File 'lib/stripe/resources/issuing/authorization.rb', line 632

def self.finalize_amount(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/finalize_amount", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.increment(authorization, params = {}, opts = {}) ⇒ Object

Increment a test-mode Authorization.



652
653
654
655
656
657
658
659
# File 'lib/stripe/resources/issuing/authorization.rb', line 652

def self.increment(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/increment", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.resource_classObject



577
578
579
# File 'lib/stripe/resources/issuing/authorization.rb', line 577

def self.resource_class
  "Authorization"
end

.respond(authorization, params = {}, opts = {}) ⇒ Object

Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.



672
673
674
675
676
677
678
679
# File 'lib/stripe/resources/issuing/authorization.rb', line 672

def self.respond(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/fraud_challenges/respond", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.reverse(authorization, params = {}, opts = {}) ⇒ Object

Reverse a test-mode Authorization.



692
693
694
695
696
697
698
699
# File 'lib/stripe/resources/issuing/authorization.rb', line 692

def self.reverse(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/reverse", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

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

Capture a test-mode authorization.



592
593
594
595
596
597
598
599
# File 'lib/stripe/resources/issuing/authorization.rb', line 592

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

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

Expire a test-mode Authorization.



622
623
624
625
626
627
628
629
# File 'lib/stripe/resources/issuing/authorization.rb', line 622

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

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

Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount.



642
643
644
645
646
647
648
649
# File 'lib/stripe/resources/issuing/authorization.rb', line 642

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

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

Increment a test-mode Authorization.



662
663
664
665
666
667
668
669
# File 'lib/stripe/resources/issuing/authorization.rb', line 662

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

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

Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy.



682
683
684
685
686
687
688
689
# File 'lib/stripe/resources/issuing/authorization.rb', line 682

def respond(params = {}, opts = {})
  @resource.request_stripe_object(
    method: :post,
    path: format("/v1/test_helpers/issuing/authorizations/%<authorization>s/fraud_challenges/respond", { authorization: CGI.escape(@resource["id"]) }),
    params: params,
    opts: opts
  )
end

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

Reverse a test-mode Authorization.



702
703
704
705
706
707
708
709
# File 'lib/stripe/resources/issuing/authorization.rb', line 702

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