#Suleman Hassan

1 messages ยท Page 1 of 1 (latest)

azure grottoBOT
scarlet marlin
#

๐Ÿ‘‹ happy to help

i have a question regarding add card in stripe
i want to add card in stripe using swift
generate the token in stripe but card is not added in stripe account

#

please remove the other messages from the main channel and we can continue here

tranquil drift
#

removed

scarlet marlin
#

are you using your own inputs?

tranquil drift
#

nop

#

visa card inputs

#

i want to test card is added or not but card is not added but stripe token generated

scarlet marlin
#

are you using Stripe SDK?

tranquil drift
#

yes

scarlet marlin
tranquil drift
#

let cardParams = STPCardParams()
cardParams.number = "4242424242424242"
cardParams.expMonth = UInt(11)
cardParams.expYear = UInt(24)
cardParams.cvc = "123"
// self.showSpinner(onView: self.view)
STPAPIClient.shared().createToken(withCard: cardParams) { (token: STPToken?, error: Error?) in
guard let token = token, error == nil else {

            return
        }
        let Token = token.tokenId
        print(Token)
    
    }
scarlet marlin
#

this is an old API

#

what I shared is the newer/simpler way of handling collecting a payment method and directly attaching it to a customer

tranquil drift
#

reason of card not added is old API

scarlet marlin
#

in all cases what you did here is just what we call a tokenization

#

once your token is created you need to then attach it to a customer

#

otherwise it wouldn't show in your dashboard

tranquil drift
#

i can attach information of user as well but not showing the card in stripe dashboard

scarlet marlin