omise / omise-ios

Omise iOS SDK
https://www.opn.ooo
MIT License
74 stars 36 forks source link

Request Token, Omise sdk iOS #91

Closed nindipuri closed 4 years ago

nindipuri commented 4 years ago

Hi omise team,

I'm trying to tokenizing credit card and following the documentation as bellow. let tRequest = Request.init(parameter: Token.CreateParameter( name: "JOHN DOE", number: "4242424242424242", expirationMonth: 11, expirationYear: 2019, securityCode: "123" ))

But Request cannot be identified, it gives me error: Generic parameter 'T' could not be [inferred.]

Screenshot 2020-02-25 at 12 10 39 PM
igroomgrim commented 4 years ago

@nindipuri Sorry for the late reply. 🙇 You can create a request by add type of Generic parameter to be Token

        let tokenParameter = Token.CreateParameter(
            name: "JOHN DOE",
            number: "4242424242424242",
            expirationMonth: 11,
            expirationYear: 2019,
            securityCode: "123"
        )

        let request = Request<Token>(parameter: tokenParameter)

For tokenizing you can follow this instruction https://github.com/omise/omise-ios#tokenizing-a-credit-card