#rob-terminal-wisepose
1 messages · Page 1 of 1 (latest)
Hey @fluid yoke can you provide a lot more details around which exact docs you are following, what your code looks like, what part is happening and where you get an error/issue, etc.
rob-terminal-wisepose
Yes:
Here is the doc I am following - https://stripe.com/docs/terminal/payments/collect-payment
here is the code:
val stripeData = viewModel.stripeData.value
clientSecret = stripeData?.paymentIntent?.clientSecret!!
Terminal.getInstance().retrievePaymentIntent(clientSecret, object: PaymentIntentCallback {
override fun onSuccess(paymentIntent: PaymentIntent) {
// Placeholder for collecting a payment method with paymentIntent
collectPaymentMethod(paymentIntent)
}
override fun onFailure(exception: TerminalException) {
// Placeholder for handling exception
}
})
}
private fun collectPaymentMethod(paymentIntent: PaymentIntent) {
val cancelable = Terminal.getInstance().collectPaymentMethod(paymentIntent,
object : PaymentIntentCallback {
override fun onSuccess(paymentIntent: PaymentIntent) {
// Payment method collection successful, you can proceed to process the payment
// Access the paymentIntent object with the updated state, if needed.
// validateAndPlaceOrder()
}
override fun onFailure(exception: TerminalException) {
// Placeholder for handling exception during payment method collection
// You might want to display an error to the user or try again.
}
})
}
I am not getting an error this is what appears in the logs -
D/StripeTerminal: class=Terminal message=collectPaymentMethod
I/StripeTerminal: class=TerminalStatusManager message=waitForInput.
D/StripeTerminal: class=ProxyTerminalListener message=onPaymentStatusChange(WAITING_FOR_INPUT)
I/PaymentStatusChange: WAITING_FOR_INPUT
I/StripeTerminal: class=TerminalStatusManager message="requestReaderInput Insert / Swipe / Tap."
I/StripeTerminal: class=ProxyReaderListener message="onRequestReaderInput(Insert / Swipe / Tap)"
I/StripeTerminal: class=TerminalStatusManager message="requestReaderDisplayMessage Remove Card."
I/StripeTerminal: class=ProxyReaderListener message="onRequestReaderDisplayMessage(Remove Card)"
the document says "When your application is ready to collect a payment, the Stripe Android SDK takes over the display to handle the collection process" but nothing is appearing on my display currently
Hello! I'm taking over and catching up...
Just before you call collectPaymentMethod can you log clientSecret and make sure it's the value you expect?
Sure I will try it
Sounds good
I am getting
D/CartActivty: payment intent: PaymentIntent(id=pi_3Na0oZIcwltjZIut0mzuJYHc, amount=872, amountCapturable=0, amountReceived=0, application=null, applicationFeeAmount=0, canceledAt=0, cancellationReason=null, captureMethod=manual, charges=ChargesList(data=[]), clientSecret=pi_3Na0oZIcwltjZIut0mzuJYHc_secret_vcXrvIzTV8lREerj7rs3Xh4Fq, confirmationMethod=automatic, created=1690828051, currency=cad, customer=cus_NbU0eVKYxfWZAL, description=null, invoice=null, lastPaymentError=null, livemode=false, metadata={}, onBehalfOf=null, paymentMethodUnion=null, receiptEmail=null, review=null, setupFutureUsage=null, statementDescriptor=null, status=REQUIRES_PAYMENT_METHOD, transferGroup=null, amountDetails=AmountDetails(tip=Tip(amount=null)), amountTip=null, statementDescriptorSuffix=null, paymentMethodOptions=PaymentMethodOptions(card=null, cardPresent=CardPresentOptions(routing=null)), stripeAccountId=null)
which looks correct
Yep, that looks good. Is it possbile you're connecting to a different reader than the one you think you are?
I don't believe so as I only have the one reader
In your connectInternetReader's onSuccess can you log out the reader and provide the output here?
D/cartactivity: READER com.stripe.stripeterminal.external.models.Reader$Companion@81a4f40
D/cartactivity: Connected to reader
not sure if this is correct - this is my code for it
Terminal.getInstance().connectBluetoothReader(
firstReader,
connectionConfig,
bluetoothReaderListener,
object : ReaderCallback {
override fun onSuccess(reader: Reader) {
Log.d("cartactivity", "READER $Reader")
Log.d("cartactivity" , "Connected to reader")
}
override fun onFailure(e: TerminalException) {
Log.d("cartactivity" , "Not connected to reader")
e.printStackTrace()
}
}
)
That's for bluetooth, but you said this was a WisePOS E, correct?
correct
The WisePOS E doesn't use the code you shared above, you would connect to it with connectInternetReader.
Not connectBluetoothReader.
Can you share your connectInternetReader code?
I never had the connectInternetReader - only connectBluetoothReader
Oh, that's the problem then. You need to add support to your app to connect to a smart/Internet connected reader.
sounds good I will try to switch it from bluetooth to internet