#Jimit
1 messages · Page 1 of 1 (latest)
Hi there, this is a beta feature, have you reached out to Stripe and ask for access?
Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details
acct_1FCsKZEzGMAqDSOH
OK, are you using the beta SDK?
Yes
Can you share with me the relevant code that throws the error?
yes, give me a minute
I'll share
- Terminal initialization
Terminal.initTerminal(
requireContext(),
LogLevel.VERBOSE,
TokenProvider(requireActivity()),
TerminalEventListener(),
offlineListener = offlineListener
)
- Offline Listener
private val offlineListener = object : OfflineListener {
override fun onForwardingFailure(e: TerminalException) {
rootView!!.snack(e.errorMessage) {}
Log.e("offlineListener -> Failure", "** ${e.paymentIntent} ${e.errorMessage} ${e.errorCode}")
requireActivity().let {
requireActivity().supportFragmentManager.popBackStack()
}
}
override fun onNetworkStatusChange(networkStatus: NetworkStatus) {
Log.e("NetWork Status", "${networkStatus.name}")
}
override fun onPaymentIntentForwarded(paymentIntent: PaymentIntent, e: TerminalException?) {
Log.e("onPaymentIntentForwarded", "Forwarded")
if (e != null) {
// Handle the error appropriate for your application
} else if (paymentIntent.status == PaymentIntentStatus.REQUIRES_CAPTURE) {
// The paymentIntent is ready to be captured
capturePayment(paymentIntent)
} else {
// Handle the paymentIntent.status as appropriate.
}
}
}
-
Create payment intent
private val createPaymentIntentCallback by lazy {
object : PaymentIntentCallback {
override fun onSuccess(paymentIntent: PaymentIntent) {
this@DonationPageSquareConnectionPaymentFragment.paymentIntent = paymentIntent
val id = if (paymentIntent.id != null) {
Log.d("TAG", "created online")
} else {
paymentIntent.offlineDetails?.id
Log.d("TAG", "created offline with id: ${id ?: "Unexpected missing id"}")
}
stripePaymentStatus = paymentIntent.status?.name!!
val collectConfig = CollectConfiguration.Builder().build()collectTask = Terminal.getInstance().collectPaymentMethod(paymentIntent, collectPaymentMethodCallback, collectConfig) Log.e("TestToken", "111 ${paymentIntent.status?.name!!}") Log.e("TestToken", "111 ${paymentIntent.id}, Offline -> ${paymentIntent.offlineDetails?.id}") } override fun onFailure(e: TerminalException) { rootView!!.snack(e.errorMessage) {} Log.e("TestToken", "** ${e.paymentIntent} ${e.errorMessage} ${e.errorCode}") requireActivity().let { requireActivity().supportFragmentManager.popBackStack() } // Update UI w/ failure } }}
And where is the error thrown from?
Error is thrown from createPaymentIntentCallback -> onFailure
And error is
What's the CreateConfiguration that you pass to createPaymentIntent() ?
More importantly, is failIfOffline set to true or false? ref: https://stripe.com/docs/terminal/features/operate-offline/collect-payments?terminal-sdk-platform=android#create-payment-intent
As per document, I pass the details
Can you log and see if it's false?
Yes it is flase
If I pass the amount of less then 1000 USD then is it false otherwise true
But the amount you specify is 1000, will it still be false?
I do payment of amount 15 or 10 USD