Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalInfoRequest ¶
type AdditionalInfoRequest struct {
ExternalReference string `json:"external_reference,omitempty"`
TicketNumber string `json:"ticket_number,omitempty"`
PrintOnTerminal bool `json:"print_on_terminal,omitempty"`
}
AdditionalInfoRequest contains the additional payment intent information.
type AdditionalInfoResponse ¶
type CancelResponse ¶
type CancelResponse struct {
ID string `json:"id"`
}
type Client ¶
type Client interface {
// Create a point payment intent.
// It is a post request to the endpoint: https://api.mercadopago.com/point/integration-api/devices/{device_id}/payment-intents
// Reference: https://www.mercadopago.com/developers/en/reference/integrations_api_paymentintent_mlb/_point_integration-api_devices_deviceid_payment-intents/post
Create(ctx context.Context, deviceID string, request Request) (*Response, error)
// Get a point payment intent.
// It is a get request to the endpoint: https://api.mercadopago.com/point/integration-api/payment-intents/{payment_intent_id}
// Reference: https://www.mercadopago.com/developers/en/reference/integrations_api/_point_integration-api_payment-intents_paymentintentid/get
Get(ctx context.Context, paymentIntentID string) (*Response, error)
// Cancel a point payment intent.
// It is a cancel request to the endpoint: https://api.mercadopago.com/point/integration-api/devices/{device_id}/payment-intents/{payment_intent_id}
// Reference: https://www.mercadopago.com/developers/en/reference/integrations_api/_point_integration-api_devices_deviceid_payment-intents_paymentintentid/delete
Cancel(ctx context.Context, deviceID, paymentIntentID string) (*CancelResponse, error)
// ListDevices retrieve devices.
// It is a get request to the endpoint: https://api.mercadopago.com/point/integration-api/devices
// Reference: https://www.mercadopago.com/developers/en/reference/integrations_api/_point_integration-api_devices/get
ListDevices(ctx context.Context) (*DevicesResponse, error)
// UpdateOperatingMode update operating mode from device.
// It is a patch request to the endpoint: https://api.mercadopago.com/point/integration-api/devices/{device-id}
// Reference: https://www.mercadopago.com/developers/en/reference/integrations_api/_point_integration-api_devices_device-id/patch
UpdateOperatingMode(ctx context.Context, deviceID, operatingMode string) (*OperatingModeResponse, error)
}
Client contains the methods to interact with the Point API.
type DeviceResponse ¶
type DevicesResponse ¶
type DevicesResponse struct {
Paging PagingResponse `json:"paging"`
Devices []DeviceResponse `json:"devices"`
}
type OperatingModeRequest ¶
type OperatingModeRequest struct {
OperatingMode string `json:"operating_mode,omitempty"`
}
OperatingModeRequest represents the operation mode to be changed of the device. The options are: PDV, which is when the device is used in integrated mode with our API, and STANDALONE, which is used when you want to process payments without our API.
type OperatingModeResponse ¶
type OperatingModeResponse struct {
OperatingMode string `json:"operating_mode"`
}
type PagingResponse ¶
type PaymentRequest ¶
type PaymentRequest struct {
Type string `json:"type,omitempty"`
InstallmentsCost string `json:"installments_cost,omitempty"`
ID int `json:"id,omitempty"`
Installments int `json:"installments,omitempty"`
}
PaymentRequest contains properties of Payment Intent.
type PaymentResponse ¶
type Request ¶
type Request struct {
AdditionalInfo *AdditionalInfoRequest `json:"additional_info,omitempty"`
Payment *PaymentRequest `json:"payment,omitempty"`
Description string `json:"description,omitempty"`
Amount int `json:"amount,omitempty"`
}
Request is used to create a payment intention, sending the details of a transaction.
type Response ¶
type Response struct {
Payment PaymentResponse `json:"payment"`
AdditionalInfo AdditionalInfoResponse `json:"additional_info"`
ID string `json:"id"`
Description string `json:"description"`
State string `json:"state"`
DeviceID string `json:"device_id"`
Amount int `json:"amount"`
}
Response contains the response of a payment intention.
Click to show internal directories.
Click to hide internal directories.