#Jimit

1 messages · Page 1 of 1 (latest)

drifting stormBOT
tame tartan
#

Hi there, this is a beta feature, have you reached out to Stripe and ask for access?

sonic nest
#

Yes

#

And it is enable for the reader.

tame tartan
#

Can you share with me your merchant ID? you can find it from the Stripe Dashboard -> Settings ->Account Details

sonic nest
#

acct_1FCsKZEzGMAqDSOH

tame tartan
#

OK, are you using the beta SDK?

sonic nest
#

Yes

tame tartan
#

Can you share with me the relevant code that throws the error?

sonic nest
#

yes, give me a minute
I'll share

#
  1. Terminal initialization

Terminal.initTerminal(
requireContext(),
LogLevel.VERBOSE,
TokenProvider(requireActivity()),
TerminalEventListener(),
offlineListener = offlineListener
)

  1. 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.
        }
    }

}
#
  1. 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
         }
     }
    

    }

tame tartan
#

And where is the error thrown from?

sonic nest
#

Error is thrown from createPaymentIntentCallback -> onFailure

And error is

tame tartan
#

What's the CreateConfiguration that you pass to createPaymentIntent() ?

sonic nest
#

As per document, I pass the details

tame tartan
#

Can you log and see if it's false?

sonic nest
#

Yes it is flase

#

If I pass the amount of less then 1000 USD then is it false otherwise true

tame tartan
#

But the amount you specify is 1000, will it still be false?

sonic nest
#

I do payment of amount 15 or 10 USD