PlusPayDevelopers

Payments

Start payments, cancel payments, EFT-POS payments and order payments.

This page covers the single-transaction payment operations. They all return a PPStartPaymentResponseModel (except order payment, which returns PPOrderPaymentResponseModel).

Each request is created with a toRequest(...) factory. Flutter and React Native use camelCase parameter names; the native Android package uses snake_case.

Start a payment

Starts a new payment on POS+ for an order.

The order must first be created via the API. The orderCode you pass must belong to that order; otherwise an order not found error is returned.

Parameters

ParameterTypeRequiredDescription
orderCodeStringyesYour unique order code
paymentTypePPPaymentTypeyese.g. POS, CASH
paymentMethodPPPaymentMethodyese.g. CC, QR, NFC
totalAmountdoubleyesTotal amount to charge
installmentintnoNumber of installments
isPartialboolnoPartial payment (default false)
partialTypePPPartialPaymentTypenoAMOUNT or PRODUCT
productsList<PPProduct>noLine items (id, qty)
billingInformationPPBillingInfonoInvoice / billing details
final result = await _pluspay.startPayment(
  PPStartPaymentRequestModel.toRequest(
    orderCode: 'ORD001',
    totalAmount: 11.9,
    paymentType: PPPaymentType.POS,
    paymentMethod: PPPaymentMethod.CC,
  ),
);

print(result.status);     // transaction status
print(result.id);         // POS+ transaction id
print(result.payment?.rrn); // bank reference number

For a partial payment set isPartial: true and provide partialType (AMOUNT or PRODUCT). For product-based partial payments also pass products.

Cancel a payment

Cancels a previously completed payment by its transaction id.

Parameters

ParameterTypeRequiredDescription
transactionIdStringyesId returned by the original payment
orderCodeStringyesThe original order code
noteStringnoFree-text cancellation note
await _pluspay.cancelPayment(
  PPCancelPaymentRequestModel.toRequest(
    orderCode: 'ORD001',
    transactionId: '539c5225-0741-4f0e-b460-1fdb842c2c16',
    note: 'Customer cancelled',
  ),
);

EFT-POS payment

Starts a payment directly on the EFT-POS device. Requires a tax rate.

Parameters

ParameterTypeRequiredDescription
totalAmountdoubleyesAmount to charge
paymentTypePPPaymentTypeyesPayment type
paymentMethodPPPaymentMethodyesPayment method
transactionIdStringyesYour transaction id
taxRateintyesApplied tax rate (%)
installmentintnoNumber of installments
await _pluspay.startEftPayment(
  PPEftPaymentRequestModel.toRequest(
    totalAmount: 3.0,
    paymentType: PPPaymentType.POS,
    paymentMethod: PPPaymentMethod.CC,
    transactionId: '27517a85-cfc3-4eee-b83b-63dc6bcb9fd6',
    taxRate: 0,
  ),
);

Cancel an EFT-POS payment

Parameters

ParameterTypeRequiredDescription
transactionIdStringyesThe EFT transaction id
totalAmountdoubleyesAmount of the EFT transaction
await _pluspay.cancelEftPayment(
  PPEftCancelRequestModel.toRequest(
    transactionId: 'a111ed26-ed2b-4f0b-9d6c-82056e52c96c',
    totalAmount: 3.0,
  ),
);

Pay an existing order

Pays an order that already exists in POS+, addressed only by its order code. Returns a PPOrderPaymentResponseModel containing the order totals and the list of transaction results.

Parameters

ParameterTypeRequiredDescription
orderCodeStringyesThe existing order code in POS+
final result = await _pluspay.startOrderPayment(
  PPOrderPaymentRequestModel.toRequest(
    orderCode: 'ORD001',
  ),
);

print(result.status);     // PPOrderStatusEnum
print(result.amountDue);
for (final r in result.results) {
  print('${r.completed} ${r.errorMessage}');
}

Next: Multi-payment for product-based orders with multiple transactions.