Sha256: b7bf4569eff8f754865709203f17f5118945071367d3fc13e2d20c76c9398527

Contents?: true

Size: 840 Bytes

Versions: 10

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: false

require 'cgi'

module PayPalCheckoutSdk
  module Payments
    #
    # Captures an authorized payment, by ID.
    #
    class AuthorizationsCaptureRequest
      attr_accessor :path, :body, :headers, :verb

      def initialize(authorization_id)
        @headers = {}
        @body = nil
        @verb = "POST"
        @path = "/v2/payments/authorizations/{authorization_id}/capture?"

        @path = @path.gsub("{authorization_id}", CGI.escape(authorization_id.to_s))
        @headers["Content-Type"] = "application/json"
      end

      def pay_pal_request_id(pay_pal_request_id)
        @headers["PayPal-Request-Id"] = pay_pal_request_id
      end

      def prefer(prefer)
        @headers["Prefer"] = prefer
      end

      def request_body(capture)
        @body = capture
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
solidus_paypal_commerce_platform-1.0.3 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-1.0.2 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-0.7.1 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-1.0.1 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-1.0.0 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-0.7.0 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-1.0.0.beta3 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-1.0.0.beta2 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-1.0.0.beta1 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb
solidus_paypal_commerce_platform-0.6.0 lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb