Module: PayOS
- Defined in:
- lib/payOS.rb,
lib/payOS/client.rb,
lib/payOS/errors.rb,
lib/payOS/version.rb,
lib/payOS/constants.rb,
lib/payOS/configuration.rb,
lib/payOS/utils/formater.rb,
lib/payOS/models/response.rb,
lib/payOS/utils/signature.rb,
lib/payOS/services/payment_url.rb
Defined Under Namespace
Modules: Models, Services, Utils
Classes: APIError, Client, Configuration, Error, ForbiddenError, RateLimitError, SignatureVerificationError
Constant Summary
collapse
- VERSION =
"0.2.1"
- BASE_URL =
"https://api-merchant.payos.vn"
- API_VERSION =
"v2"
- PAYMENT_URL_PATH =
"payment-requests"
- CONFIRM_WEBHOOK_PATH =
"confirm-webhook"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
19
20
21
|
# File 'lib/payOS.rb', line 19
def configuration
@configuration
end
|
Class Method Details
.cancel_payment(payment_url_id) ⇒ Object
44
45
46
|
# File 'lib/payOS.rb', line 44
def self.cancel_payment(payment_url_id)
payment_service.cancel(payment_url_id)
end
|
.client ⇒ Object
21
22
23
|
# File 'lib/payOS.rb', line 21
def client
@client ||= Client.new(configuration)
end
|
30
31
32
33
34
|
# File 'lib/payOS.rb', line 30
def self.configure
self.configuration ||= Configuration.new
yield(configuration) if block_given?
configuration.validate!
end
|
.confirm_webhook(webhook_url) ⇒ Object
48
49
50
|
# File 'lib/payOS.rb', line 48
def self.confirm_webhook(webhook_url)
payment_service.confirm_webhook(webhook_url)
end
|
.create_payment_url(params) ⇒ Object
36
37
38
|
# File 'lib/payOS.rb', line 36
def self.create_payment_url(params)
payment_service.create(params)
end
|
.get_payment_info(payment_url_id) ⇒ Object
40
41
42
|
# File 'lib/payOS.rb', line 40
def self.get_payment_info(payment_url_id)
payment_service.get_info(payment_url_id)
end
|
.payment_service ⇒ Object
25
26
27
|
# File 'lib/payOS.rb', line 25
def payment_service
@payment_service ||= Services::PaymentUrl.new(client)
end
|
.verify_request!(data, signature) ⇒ Object