Sha256: 58eedffb83bc36c39132e83d544faa8bccb46591058c6570ca40a08f43425d15

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

module Spree
  module API
    class Client
      module Payments
        def payments(order_number, options={})
          get("orders/#{order_number}/payments", options)['payments']
        end

        def payment(order_number, payment_id, options={})
          get("orders/#{order_number}/payments/#{payment_id}", options)
        end

        def new_payment(order_number, options={})
          get("orders/#{order_number}/payments/new", options)
        end

        def create_payment(order_number, options={})
          post("orders/#{order_number}/payments/", options)
        end

        def authorize_payment(order_number, payment_id, options={})
          put("orders/#{order_number}/payments/#{payment_id}/authorize", options)
        end

        def capture_payment(order_number, payment_id, options={})
          put("orders/#{order_number}/payments/#{payment_id}/capture", options)
        end

        def purchase_payment(order_number, payment_id, options={})
          put("orders/#{order_number}/payments/#{payment_id}/purchase", options)
        end
        
        def void_payment(order_number, payment_id, options={})
          put("orders/#{order_number}/payments/#{payment_id}.void", options)
        end
        
        def credit_payment(order_number, payment_id, options={})
          put("orders/#{order_number}/payments/#{payment_id}/credit", options)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree-api-client-0.0.2 lib/spree-api-client/payments.rb
spree-api-client-0.0.1 lib/spree-api-client/payments.rb