Sha256: 447ac6071246eb0a4f9b7c96be043b393c7e902422f91c4215e8119e23c38b0e

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: false

require 'cgi'

module PayPalCheckoutSdk
  module Orders
    #
    # Authorizes payment for an order. The response shows details
    # of authorizations. You can make this call only if you specified
    # `intent=AUTHORIZE` in the create order call.
    #
    class OrdersAuthorizeRequest
      attr_accessor :path, :body, :headers, :verb

      def initialize(order_id)
        @headers = {}
        @body = nil
        @verb = "POST"
        @path = "/v2/checkout/orders/{order_id}/authorize?"

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

      def pay_pal_client_metadata_id(pay_pal_client_metadata_id)
        @headers["PayPal-Client-Metadata-Id"] = pay_pal_client_metadata_id
      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(order_action_request)
        @body = order_action_request
      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/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-1.0.2 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-0.7.1 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-1.0.1 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-1.0.0 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-0.7.0 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-1.0.0.beta3 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-1.0.0.beta2 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-1.0.0.beta1 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb
solidus_paypal_commerce_platform-0.6.0 lib/paypal/paypal_checkout_sdk/orders/orders_authorize_request.rb