Payment

public class Payment: Transaction, TransactionPath

When you want to process a payment transaction, you create a Payment object and start adding the necessary information. This transaction supports two types of Payments. You can process payments using a full set of card details, or by referencing a previously processed transaction.

  • Card Payment
    • For payments where you have the full card details including the card number.
  • Token Payment
    • For processing payments using a saved card (requires the Card token and Consumer token values).

Transaction contains all the necessary implementation of Payments and Pre-auths since these are very closely related.

Card payment

    muJudoSession.payment(correctJudoID, amount: amount, reference: references)
                 .card(card)
                 .location(location)
                 .contact(mobileNumber, emailAddress)
                 .completion({ (data, error) -> () in
                     if let  = error {
                         // failure
                     } else {
                         // success
                     }
    })
<a href=’#tokenpayment’ class=‘anchor’ aria-hidden=true>

Token payment

swift token payment muJudoSession.payment(correctJudoID, amount: amount, reference: references) .paymentToken(payToken) .location(location) .contact(mobileNumber, emailAddress) .completion({ (data, error) -> () in if let _ = error { // failure } else { // success } })

Learn more here

  • path variable for this class

    Declaration

    Swift

    public static var path: String { get { return "transactions/payments" } }
  • If you need to check a payment before actually processing it, you can use the validate call, we’ll perform our internal checks on the payment without sending it to consumer’s bank. We check if the merchant identified by the judo ID can accept the payment, if the card can be accepted and if the card number passes the LUHN test.

    Parameter

    Parameter block: a completion block that is called when the request finishes

    Returns

    reactive Self

    Declaration

    Swift

    public func validate(block: (JudoCompletionBlock)) throws -> Self

    Parameters

    block

    a completion block that is called when the request finishes

    Return Value

    reactive Self