#mork-terminal-paymentmethodid

1 messages · Page 1 of 1 (latest)

fresh schoonerBOT
ancient thicket
#

mork-terminal-paymentmethodid

#

Hey @west salmon can you share which doc you are following and the code you have for Android?
Also what do you plan to do with the PaymentMethod id pm_ABC? It's not what we call "re-usable"

west salmon
#

I was following this doc here

#

this is my android code:

#

fun confirmSetupIntent() {
Terminal.getInstance().confirmSetupIntent(setupIntent!!, getConfirmSetupIntentCallback())
}

private fun getConfirmSetupIntentCallback() : SetupIntentCallback {
    val self = this
    return object : SetupIntentCallback {
        override fun onSuccess(setupIntent: SetupIntent) {
            self.setupIntent = setupIntent

            context.runOnUiThread {
                NativeMethodChannel.platformMessage(PlatformMessage(TerminalConstants.CONFIRM_SETUP_INTENT_SUCCESS, setupIntent.paymentMethodId!!))
            }
        }

        override fun onFailure(e: TerminalException) {
            context.runOnUiThread {
                NativeMethodChannel.platformMessage(PlatformMessage(TerminalConstants.CONFIRM_SETUP_INTENT_FAIL, e.errorMessage))
            }
        }
    }
}
#

we gonna send the payment method id to salesforce and salesforce will create a payment intent and processes the payment

ancient thicket
#

yeah you're misunderstnading how this works. The pm_123 you get can not be used for future payments.

#

The way it works is that you collect a card_present PaymentMethod pm_123 and that is one-time use. In turn, Stripe will also generate a separate card PaymentMethod pm_ABC with the same card details and that one can be re-used. That one would be automatically attached to the Customer for you (which is what the doc mention)

west salmon
#

hum, gotcha. So I just need to get this payment method from the customer and I can proceed with my payment

ancient thicket
#

yep

west salmon
#

awesome, It works for me

#

thank you very much for your help

ancient thicket
#

can you try now and let me know if that works in your code?

#

that way if you're blocked I can help right now

west salmon
#

I cant try now. I need to wait the salesforce guy to do it. I'm the mobile guy

#

I will pass the information for him and wait