Module: Razorpay

Defined in:
lib/razorpay.rb,
lib/razorpay/iin.rb,
lib/razorpay/card.rb,
lib/razorpay/item.rb,
lib/razorpay/plan.rb,
lib/razorpay/addon.rb,
lib/razorpay/order.rb,
lib/razorpay/token.rb,
lib/razorpay/entity.rb,
lib/razorpay/refund.rb,
lib/razorpay/account.rb,
lib/razorpay/dispute.rb,
lib/razorpay/invoice.rb,
lib/razorpay/payment.rb,
lib/razorpay/product.rb,
lib/razorpay/qr_code.rb,
lib/razorpay/request.rb,
lib/razorpay/utility.rb,
lib/razorpay/webhook.rb,
lib/razorpay/customer.rb,
lib/razorpay/document.rb,
lib/razorpay/transfer.rb,
lib/razorpay/constants.rb,
lib/razorpay/collection.rb,
lib/razorpay/settlement.rb,
lib/razorpay/oauth_token.rb,
lib/razorpay/stakeholder.rb,
lib/razorpay/fund_account.rb,
lib/razorpay/payment_link.rb,
lib/razorpay/subscription.rb,
lib/razorpay/payment_method.rb,
lib/razorpay/virtual_account.rb,
lib/razorpay/payload_validator.rb,
lib/razorpay/validation_config.rb,
lib/razorpay/errors/server_error.rb,
lib/razorpay/errors/gateway_error.rb,
lib/razorpay/errors/razorpay_error.rb,
lib/razorpay/errors/bad_request_error.rb,
lib/razorpay/subscription_registration.rb

Overview

Version and other constants are defined here

Defined Under Namespace

Classes: Account, Addon, BadRequestError, Card, Collection, Customer, Dispute, Document, Entity, Error, FundAccount, GatewayError, Iin, Invoice, Item, OAuthToken, Order, PayloadValidator, Payment, PaymentLink, PaymentMethods, Plan, Product, QrCode, Refund, Request, ServerError, Settlement, Stakeholder, Subscription, SubscriptionRegistration, Token, Transfer, Utility, ValidationConfig, VirtualAccount, Webhook

Constant Summary collapse

BASE_URI =
'https://api.razorpay.com'.freeze
TEST_URL =
'https://api.razorpay.com/'.freeze
VERSION =
'3.2.4'.freeze
AUTH_URL =
'https://auth.razorpay.com'.freeze
API_HOST =
'API'.freeze
AUTH_HOST =
'AUTH'.freeze
PRIVATE_AUTH =
'Private'.freeze
OAUTH =
'OAuth'.freeze
ValidationType =
{
  non_null: :non_null,
  non_empty_string: :non_empty_string,
  url: :url,
  id: :id,
  mode: :mode,
  token_grant: :token_grant
}

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.access_tokenObject

Returns the value of attribute access_token.



36
37
38
# File 'lib/razorpay.rb', line 36

def access_token
  @access_token
end

.authObject

Returns the value of attribute auth.



36
37
38
# File 'lib/razorpay.rb', line 36

def auth
  @auth
end

.auth_typeObject

Returns the value of attribute auth_type.



36
37
38
# File 'lib/razorpay.rb', line 36

def auth_type
  @auth_type
end

.custom_headersObject

Returns the value of attribute custom_headers.



36
37
38
# File 'lib/razorpay.rb', line 36

def custom_headers
  @custom_headers
end

Class Method Details

.headers=(headers = {}) ⇒ Object



49
50
51
# File 'lib/razorpay.rb', line 49

def self.headers=(headers = {})
  self.custom_headers = headers
end

.setup(key_id, key_secret) ⇒ Object



39
40
41
42
# File 'lib/razorpay.rb', line 39

def self.setup(key_id, key_secret)
  self.auth = { username: key_id, password: key_secret }
  self.auth_type = Razorpay::PRIVATE_AUTH
end

.setup_with_oauth(access_token) ⇒ Object



44
45
46
47
# File 'lib/razorpay.rb', line 44

def self.setup_with_oauth(access_token)
  self.access_token = access_token
  self.auth_type = Razorpay::OAUTH
end