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

To make a payment 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 payment = try judo.payment(myJudoID, amount: oneGBPAmount, reference: validReference)
    
    payment.card(validVisaTestCard)
            
    try payment.completion({ (response, error) -> () in
        if let error = error {
            // handle transaction error
        }
    })
} catch {
    // handle exception thrown (eg. judoId is luhn invalid)
}

Clone this wiki locally