Module: MangoApi::PreAuthorizations
- Extended by:
- UriProvider
- Defined in:
- lib/mangopay/api/service/pre_authorizations.rb
Overview
Provides API method delegates concerning the PreAuthorization
entity
Class Method Summary collapse
-
.cancel(id) ⇒ PreAuthorization
Cancels a Pre-Authorization entity.
-
.create(pre_auth, id_key = nil) ⇒ PreAuthorization
Creates a new Pre-Authorization entity.
-
.get(id) ⇒ PreAuthorization
Retrieves a Pre-Authorization entity.
-
.of_card(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves pre-authorization entities belonging to a certain card.
-
.of_user(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves pages of pre-authorization entities belonging to a certain user.
Methods included from UriProvider
Class Method Details
.cancel(id) ⇒ PreAuthorization
Cancels a Pre-Authorization entity.
entity object
73 74 75 76 77 78 |
# File 'lib/mangopay/api/service/pre_authorizations.rb', line 73 def cancel(id) uri = provide_uri(:cancel_pre_authorization, id) cancel_request = CancelRequest.new response = HttpClient.put(uri, cancel_request) parse response end |
.create(pre_auth, id_key = nil) ⇒ PreAuthorization
Creates a new Pre-Authorization entity.
PreAuthorization
properties:
-
Required
-
author_id
-
debited_funds
-
card_id
-
secure_mode_return_url
-
-
Optional
-
tag
-
secure_mode
-
data model object entity object
28 29 30 31 32 |
# File 'lib/mangopay/api/service/pre_authorizations.rb', line 28 def create(pre_auth, id_key = nil) uri = provide_uri(:create_pre_authorization) response = HttpClient.post(uri, pre_auth, id_key) parse response end |
.get(id) ⇒ PreAuthorization
Retrieves a Pre-Authorization entity.
entity object
39 40 41 42 43 |
# File 'lib/mangopay/api/service/pre_authorizations.rb', line 39 def get(id) uri = provide_uri(:get_pre_authorization, id) response = HttpClient.get(uri) parse response end |
.of_card(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves pre-authorization entities belonging to a certain card. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.
Allowed FilterRequest
params:
-
page
-
per_page
-
sort_field and sort_direction
-
result_code
-
status
-
payment_status
96 97 98 99 100 101 102 |
# File 'lib/mangopay/api/service/pre_authorizations.rb', line 96 def of_card(id) uri = provide_uri(:get_preauthorizations_for_card, id) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.of_user(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves pages of pre-authorization entities belonging to a certain user. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.
Allowed FilterRequest
params:
-
page
-
per_page
-
sort_field and sort_direction
-
status
-
result_code
-
payment_status
60 61 62 63 64 65 66 |
# File 'lib/mangopay/api/service/pre_authorizations.rb', line 60 def of_user(id) uri = provide_uri(:get_users_pre_authorizations, id) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |