Skip to content
Hamon Ben Riazy edited this page Apr 25, 2016 · 3 revisions

To make a pre-Authorization without the need of a UI provided by judo, use the following snippet. BE AWARE that you need to make sure that the card number, date and security code information and in a correct format are valid.

do {
    let preAuth = try judo.preAuth(myJudoID, amount: oneGBPAmount, reference: validReference)
    
    preAuth.card(validVisaTestCard)
            
    try preAuth.completion({ (response, error) -> () in
        if let error = error {
            // handle transaction error
        }
    })
} catch {
    // handle exception thrown (eg. judoId is luhn invalid)
}

Clone this wiki locally