Sha256: aac48a010fb909b6948a54a1cb7e757350122357817e261bf8a27ca62f1f088e

Contents?: true

Size: 876 Bytes

Versions: 12

Compression:

Stored size: 876 Bytes

Contents

# frozen_string_literal: true

module Stripe
  class PaymentIntent < APIResource
    extend Stripe::APIOperations::Create
    extend Stripe::APIOperations::List
    include Stripe::APIOperations::Save

    OBJECT_NAME = "payment_intent".freeze

    custom_method :cancel, http_verb: :post
    custom_method :capture, http_verb: :post
    custom_method :confirm, http_verb: :post

    def cancel(params = {}, opts = {})
      resp, opts = request(:post, resource_url + "/cancel", params, opts)
      initialize_from(resp.data, opts)
    end

    def capture(params = {}, opts = {})
      resp, opts = request(:post, resource_url + "/capture", params, opts)
      initialize_from(resp.data, opts)
    end

    def confirm(params = {}, opts = {})
      resp, opts = request(:post, resource_url + "/confirm", params, opts)
      initialize_from(resp.data, opts)
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
stripe-4.22.0 lib/stripe/resources/payment_intent.rb
bongloy-4.21.3 lib/stripe/resources/payment_intent.rb
stripe-4.21.3 lib/stripe/resources/payment_intent.rb
stripe-4.21.2 lib/stripe/resources/payment_intent.rb
stripe-4.18.1 lib/stripe/payment_intent.rb
stripe-4.18.0 lib/stripe/payment_intent.rb
stripe-4.17.0 lib/stripe/payment_intent.rb
stripe-4.16.0 lib/stripe/payment_intent.rb
stripe-4.15.0 lib/stripe/payment_intent.rb
stripe-4.14.0 lib/stripe/payment_intent.rb
stripe-4.13.0 lib/stripe/payment_intent.rb
stripe-4.12.0 lib/stripe/payment_intent.rb