Android Business Payment APIs
Business payment APIs for sending payment requests via BLE and accessing payment history. Access these APIs through Vipaso.payment.business.
Payment History
Fetch Payments
Retrieve a paginated list of payment transactions with optional filtering by status:
val payments: List<VipasoPayment> = Vipaso.payment.business.fetchPayments(
page = 0,
status = VipasoPaymentStatus.COMPLETED
)
Possible VipasoPaymentStatus values:
INITIATED: Payment has been created but processing hasn't startedIN_PROGRESS: Payment is currently being processedCOMPLETED: Payment has been successfully completed and funds transferredFAILED: Payment processing failed due to an errorCANCELLED: Payment was cancelled by the user, merchant, or system
Fetch Payment
Fetch the complete details of a specific payment by its ID:
val paymentDetails: VipasoPayment = Vipaso.payment.business.fetchPayment(paymentId = "payment_id")
Possible VipasoPaymentStatus values:
INITIATED: Payment has been created but processing hasn't startedIN_PROGRESS: Payment is currently being processedCOMPLETED: Payment has been successfully completed and funds transferredFAILED: Payment processing failed due to an errorCANCELLED: Payment was cancelled by the user, merchant, or system
BLE Nearby Payment (Send)
Send a nearby payment request
Send a payment request via BLE to all potential payers in range. The method returns when the first payer successfully accepts the payment.
val result: VipasoPaymentResult = Vipaso.payment.business.sendNearbyPaymentRequest(
amount = "12.00",
currency = "USD",
paymentReference = null // or a custom reference string
)
Possible VipasoPaymentResult outcomes:
-
PaymentSuccessful(paymentId: UUID, amount: String, tip: String, currency: String)- The payment was approved by both Business and Customer.
- Example amounts:
"100.00"for amount,"0.00"for tip.
-
PaymentCancelled(paymentId: UUID)- The payment was cancelled on the Business device.
-
PaymentFailed(paymentId: UUID, error: Throwable)- There was an unrecoverable error on the Business side.
Cancel Payment
Cancel the current payment operation and terminate BLE.
Vipaso.payment.business.cancelPayment()
Stop BLE
Stop BLE without cancelling the current payment.
Vipaso.payment.business.stopBle()
BLE Contactless Payment (Send)
Contactless Payment allows sending a payment request via BLE to a specific customer device identified by a tag ID. This is a targeted, one-to-one BLE payment session.
Send a contactless payment request
Send a payment request via BLE to a specific merchant terminal identified by its tag ID. The method returns the result when the payer accepts or the operation completes.
val tagId = UUID.fromString("terminal-tag-id")
val result: VipasoPaymentResult = Vipaso.payment.business.sendContactlessPaymentRequest(
tagId = tagId,
amount = "25.00",
currency = "USD",
paymentReference = null // or a custom reference string
)
Possible VipasoPaymentResult outcomes:
-
PaymentSuccessful(paymentId: UUID, amount: String, tip: String, currency: String)- The payment was approved by both Business and Customer.
- Example amounts:
"100.00"for amount,"0.00"for tip.
-
PaymentCancelled(paymentId: UUID)- The payment was cancelled on the Business device.
-
PaymentFailed(paymentId: UUID, error: Throwable)- There was an unrecoverable error on the Business side.
Cancel Payment
Cancel the current contactless payment operation and terminate BLE.
Vipaso.payment.business.cancelPayment()
Stop BLE
Stop BLE without cancelling the current contactless payment.
Vipaso.payment.business.stopBle()