Sha256: 55a3a17380d54e1b265e83b3b3998006e7d39d0d5ae3fac961a996787048714d

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

module PayPal
  module Permissions
    class Api

      SITE_ENDPOINTS = {
         :sandbox => "https://www.sandbox.paypal.com/cgi-bin/webscr",
         :production => "https://www.paypal.com/cgi-bin/webscr"
      }

      API_ENDPOINTS = {
         :sandbox => "https://svcs.sandbox.paypal.com/Permissions",
         :production => "https://svcs.paypal.com/Permissions"
      }

      DATA_FORMATS = {
        :nvp  => 'NV',
        :xml  => 'XML',
        :json => 'JSON'
      }

      class << self
        def username
          PayPal::Api.instance.username
        end

        def password
          PayPal::Api.instance.password
        end

        def signature
          PayPal::Api.instance.signature
        end

        def app_id
          PayPal::Api.instance.app_id
        end

        def environment
          PayPal::Api.environment
        end

        def api_endpoint
          API_ENDPOINTS[environment]
        end

        def site_endpoint
          SITE_ENDPOINTS[environment]
        end

        def request_data_format
          DATA_FORMATS[:json]
        end

        def response_data_format
          DATA_FORMATS[:json]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paypal-payment-0.1.2 lib/paypal/permissions/api.rb