Class: Mercadopago::Point
- Defined in:
- lib/mercadopago/resources/point.rb
Overview
Manages payment intents on MercadoPago Point (POS) devices.
Enables in-person payment processing by creating payment intents that are sent to a physical Point device for the buyer to complete the transaction by inserting or tapping their card.
Note: The change_operating_mode operation (PATCH /point/integration-api/devices/{device_id}) is not included because the Ruby SDK HTTP client does not currently expose a PATCH method.
Instance Method Summary collapse
-
#cancel(device_id, payment_intent_id, request_options: nil) ⇒ Hash{Symbol => Object}
Cancels a pending payment intent on a specific device.
-
#create(device_id, payment_intent_data, request_options: nil) ⇒ Hash{Symbol => Object}
Creates a payment intent on a specific Point device.
-
#get(payment_intent_id, request_options: nil) ⇒ Hash{Symbol => Object}
Retrieves the current state of a payment intent by its ID.
-
#get_devices(filters: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Lists Point devices linked to the authenticated account.
Methods inherited from MPBase
#_check_headers, #_check_request_options, #_delete, #_get, #_post, #_put, #initialize
Constructor Details
This class inherits a constructor from Mercadopago::MPBase
Instance Method Details
#cancel(device_id, payment_intent_id, request_options: nil) ⇒ Hash{Symbol => Object}
Cancels a pending payment intent on a specific device.
Use this to abort a transaction before the buyer completes the payment on the device.
79 80 81 82 83 84 |
# File 'lib/mercadopago/resources/point.rb', line 79 def cancel(device_id, payment_intent_id, request_options: nil) _delete( uri: "/point/integration-api/devices/#{device_id}/payment-intents/#{payment_intent_id}", request_options: ) end |
#create(device_id, payment_intent_data, request_options: nil) ⇒ Hash{Symbol => Object}
Creates a payment intent on a specific Point device.
The payment intent is sent to the physical device, where the buyer completes the transaction.
42 43 44 45 46 47 48 49 50 |
# File 'lib/mercadopago/resources/point.rb', line 42 def create(device_id, payment_intent_data, request_options: nil) raise TypeError, 'Param payment_intent_data must be a Hash' unless payment_intent_data.is_a?(Hash) _post( uri: "/point/integration-api/devices/#{device_id}/payment-intents", data: payment_intent_data, request_options: ) end |
#get(payment_intent_id, request_options: nil) ⇒ Hash{Symbol => Object}
Retrieves the current state of a payment intent by its ID.
Use this to check whether the buyer has completed, cancelled, or is still processing the payment on the device.
62 63 64 65 66 67 |
# File 'lib/mercadopago/resources/point.rb', line 62 def get(payment_intent_id, request_options: nil) _get( uri: "/point/integration-api/payment-intents/#{payment_intent_id}", request_options: ) end |
#get_devices(filters: nil, request_options: nil) ⇒ Hash{Symbol => Object}
Lists Point devices linked to the authenticated account.
24 25 26 27 28 |
# File 'lib/mercadopago/resources/point.rb', line 24 def get_devices(filters: nil, request_options: nil) raise TypeError, 'Param filters must be a Hash' unless filters.nil? || filters.is_a?(Hash) _get(uri: '/point/integration-api/devices', filters: filters, request_options: ) end |