Skip to main content
Medianet runs the pinpad on Fire spark kiosks in Ecuador. One dashboard payment is one checkout button. The pinpad sits on the store LAN. The customer uses the pinpad; the kiosk waits for the answer. Android kiosk only. POS, web, and iOS do not use this package. The packages are public in the SDK at 0.12.5. They join npm on the next SDK release. A channel in this repository depends on them with workspace:*. Follow the sections below to wire it by hand. To hand the same work to an agent, copy the prompt in AI agent prompt.

Requirements

  • An Android kiosk and a development build. Expo Go does not load the native module.
  • A Medianet pinpad on the store LAN.
  • CajaPinPadLibrary_V3.jar (WPOSS), kept outside git. Medianet licenses the JAR.
Do not commit the JAR or a production IP, MID, TID, or cashier id. The kiosk template is public.

Activate it

  1. In the dashboard, open the merchant, go to Payments, and create a payment with the provider Medianet and the method PIN pad. The payment name is the label on the checkout button. See Checkout button.
  2. In Connection Settings, fill in:
  1. In Store settings, fill in each store that needs a different MID. Leave it empty to keep the payment MID. The API sends the kiosk only its own store row.
  1. On each kiosk, open the device and the Payments tab. Values live in settings_overrides.payment_settings, keyed by payment id. See Configure a device.
The MID resolves as device, then store, then payment.
A payment that is missing terminal_ip, terminal_port, terminal_id, cashier_id, or a MID never reaches the kiosk, so its button stays off the checkout. On the device list, the Payments column shows what is still empty. A device can also hide a payment with disabled_payment_ids.

Checkout button

Each Medianet payment is one button. The kiosk template already renders one card per payment from services.payments.list (CheckoutPaymentMethodCard). You do not add a button component and you do not add an illustration.
  • The label is payment.name. When the payment has no name, the card uses the method name.
  • The picture is the card illustration. paymentInstructionKind returns "card" for every PIN_PAD payment, and the hint under the label is checkout.method.cardHint (“Debit or credit on the pin pad”). Medianet has no modalities, so the card is never treated as Pix and the customer does not pick debit or credit on the kiosk. The pinpad does that.
  • Debit and credit are the same button. A second Medianet payment is a second card, with its own name and its own device fields.

Use it in the SDK

Add both packages to the kiosk app. They are not part of the public template. Pin them to the same version as @fire-spark/payments.
@fire-spark/payments-medianet-client is the Android module and the Expo config plugin. @fire-spark/payments-medianet-pinpad-rn is the adapter. Charge through the adapter. Do not open a socket or build frames yourself. In app.config.ts:
binariesDir is absolute, or relative to the app root. Point it at a folder outside git:
Then generate the Android project and run a development build:
The plugin copies the JAR into android/app/libs/, adds it to the app build.gradle, and adds the internet permission. Prebuild stops with [medianet] missing ... when the JAR is absent. medianet.available from @fire-spark/payments-medianet-client is true when the plugin is in the build. Register the adapter once per order, with device storage. Pass storage every time: it keeps the day’s batch (medianet:control:v1) and the reverse queue across restarts. Without it, the pinpad can ask to open the batch again, and a pending reverse is lost. The adapter already uses the shared client. Do not create another one.
kioskConfig is what getKioskConfig returns. Device values arrive on overrides.payment_settings. Frame dates use America/Guayaquil unless you pass timeZone. order.getMissingPaymentFields(payment) lists device fields that are still empty. The API already hides an incomplete payment. Use the helper on the kiosk admin screen when you want to show what is missing.

Waiting message

The adapter draws nothing. It sends one line, in Spanish, while the pinpad works:
The default payment UI ignores message. There is no select, input, confirm, or QR. Implement message only when that line should appear on the kiosk:

Charge

Charge the payment the customer picked:
payIntent({ payment }) still places one tender. To split Medianet with another method, call setTenders with an allocation and then payIntent(). See Use payments in the SDK. The first charge of the day sends the batch-open frame (PC) once. If that frame fails, there is no charge. A sale is approved only when the pinpad and the authorizer both answer 00. The amount is sent in cents; the adapter builds it. The charge window is 300 seconds. It covers the daily PC, the sale, and a reverse. Leave runtime.timeout_ms unset to keep that window. A value on the payment replaces it, so set 300000 or higher. To raise the adapter default, pass timeoutMs:
Use formatPaymentError from @fire-spark/payments for the message. Do not retry an AMBIGUOUS result.

What the customer sees

The card button, then the pinpad. The kiosk does not draw a pinpad screen and does not show a QR. On PAID, continue the order. Authorization code, brand, last 4, sequential (reference), batch, terminal id, and merchant id are on result.metadata.payment. The kiosk does not store them itself.

Shift start and pinpad setup

Call these from the admin screen, never during a charge. The adapter runs them one at a time. Open the day’s batch when the shift starts. This sends PC even when the day is already open. start also sends PC once per day when the shift did not:
It answers Medianet batch <batch> open. Write the pinpad network (IP, mask, gateway, port) only when those values are saved. This sends CP, then PC, and needs network_mask and gateway:
It answers Medianet pinpad configured. When the mask or the gateway is empty, it throws Medianet is missing network_mask, gateway. A charge does not need those two fields. Link test, native-module health, and pending reverses:
test answers Medianet link OK (hash valid) or Medianet link OK (hash invalid). retry_pending_reversals answers Reverses and voids completed: N, pending: M. There is no pinpad batch close. End of day stays with the store system. There is no last-transaction query. Do not build the frames yourself.

Webhooks

None.

Voids

order.cancel() voids an order that was not fulfilled. order.refund() refunds one that was. An approved sale is voided on the pinpad (03). An unknown result is reversed (04). A void is REFUNDED only when the pinpad and the authorizer both answer 00.

Common errors

Compatibility

AI agent prompt

Paste this into the agent that edits the kiosk app. It covers only Medianet. The sections above are the same work, written for a person.
Integration prompt