Module: QPay::Endpoints::Payments
- Included in:
- Client
- Defined in:
- lib/qpay/endpoints/payments.rb
Instance Method Summary collapse
-
#cancel_payment(payment_id, request: nil) ⇒ void
Cancels a payment (card transactions only).
-
#check_payment(request) ⇒ QPay::PaymentCheckResponse
Checks if a payment has been made for an invoice.
-
#get_payment(payment_id) ⇒ QPay::PaymentDetail
Retrieves payment details by payment ID.
-
#list_payments(request) ⇒ QPay::PaymentListResponse
Returns a list of payments matching the given criteria.
-
#refund_payment(payment_id, request: nil) ⇒ void
Refunds a payment (card transactions only).
Instance Method Details
#cancel_payment(payment_id, request: nil) ⇒ void
This method returns an undefined value.
Cancels a payment (card transactions only). DELETE /v2/payment/cancel/id
42 43 44 45 |
# File 'lib/qpay/endpoints/payments.rb', line 42 def cancel_payment(payment_id, request: nil) do_request("DELETE", "/v2/payment/cancel/#{payment_id}", body: request ? serialize(request) : nil) nil end |
#check_payment(request) ⇒ QPay::PaymentCheckResponse
Checks if a payment has been made for an invoice. POST /v2/payment/check
21 22 23 24 |
# File 'lib/qpay/endpoints/payments.rb', line 21 def check_payment(request) data = do_request("POST", "/v2/payment/check", body: serialize(request)) build_payment_check_response(data) end |
#get_payment(payment_id) ⇒ QPay::PaymentDetail
Retrieves payment details by payment ID. GET /v2/payment/id
11 12 13 14 |
# File 'lib/qpay/endpoints/payments.rb', line 11 def get_payment(payment_id) data = do_request("GET", "/v2/payment/#{payment_id}") build_payment_detail(data) end |
#list_payments(request) ⇒ QPay::PaymentListResponse
Returns a list of payments matching the given criteria. POST /v2/payment/list
31 32 33 34 |
# File 'lib/qpay/endpoints/payments.rb', line 31 def list_payments(request) data = do_request("POST", "/v2/payment/list", body: serialize(request)) build_payment_list_response(data) end |
#refund_payment(payment_id, request: nil) ⇒ void
This method returns an undefined value.
Refunds a payment (card transactions only). DELETE /v2/payment/refund/id
53 54 55 56 |
# File 'lib/qpay/endpoints/payments.rb', line 53 def refund_payment(payment_id, request: nil) do_request("DELETE", "/v2/payment/refund/#{payment_id}", body: request ? serialize(request) : nil) nil end |