APIClient

@objc(PAYAPIClient)
public class APIClient : NSObject

PAY.JP API client. cf. https://pay.jp/docs/api/#introduction

  • Shared instance.

    Declaration

    Swift

    @objc(sharedClient)
    public static let shared: APIClient
  • Undocumented

    Declaration

    Swift

    public var tokenOperationObserver: TokenOperationObserverType { get }
  • Create PAY.JP Token

    Declaration

    Swift

    @nonobjc
    public func createToken(
        with token: PKPaymentToken,
        completion: @escaping (Result<Token, APIError>) -> Void
    )

    Parameters

    token

    ApplePay Token

    completion

    completion action

  • Create PAY.JP Token

    Declaration

    Swift

    @nonobjc
    public func createToken(
        with cardNumber: String,
        cvc: String,
        expirationMonth: String,
        expirationYear: String,
        name: String? = nil,
        tenantId: String? = nil,
        email: String? = nil,
        phone: String? = nil,
        useThreeDSecure: Bool = false,
        completion: @escaping (Result<Token, APIError>) -> Void
    )

    Parameters

    cardNumber

    Credit card number 1234123412341234

    cvc

    Credit card cvc e.g. 123

    expirationMonth

    Credit card expiration month 01

    expirationYear

    Credit card expiration year 2020

    name

    Credit card holder name TARO YAMADA

    email

    Credit card email (Extra Attributes) e.g. test@example.com

    phone

    Credit card phone number (Extra Attributes) E.164 e.g. +819012345678

    useThreeDSecure

    Whether use 3-D secure or not

    completion

    completion action

  • GET PAY.JP Token

    Declaration

    Swift

    @nonobjc
    public func getToken(
        with tokenId: String,
        completion: @escaping (Result<Token, APIError>) -> Void
    )

    Parameters

    tokenId

    identifier of the Token

    completion

    completion action

  • GET PAY.JP CardBrands

    Declaration

    Swift

    @nonobjc
    public func getAcceptedBrands(
        with tenantId: String?,
        completion: CardBrandsResult?
    )

    Parameters

    tenantId

    identifier of the Tenant

    completion

    completion action

  • Finish 3D Secure flow on tokenization

    Declaration

    Swift

    @nonobjc
    public func finishTokenThreeDSecure(
        with tokenId: String,
        completion: @escaping (Result<Token, APIError>) -> Void
    )

    Parameters

    tokenId

    identifier of the Token

    completion

    completion action

  • Undocumented

    Declaration

    Swift

    @objc
    public func createTokenWith(
        _ token: PKPaymentToken,
        completionHandler: @escaping (Token?, NSError?) -> Void
    )
  • Undocumented

    Declaration

    Swift

    @objc
    public func createTokenWith(
        _ cardNumber: String,
        cvc: String,
        expirationMonth: String,
        expirationYear: String,
        name: String?,
        tenantId: String?,
        email: String?,
        phone: String?,
        useThreeDSecure: Bool,
        completionHandler: @escaping (Token?, NSError?) -> Void
    )
  • Undocumented

    Declaration

    Swift

    @objc
    public func getTokenWith(_ tokenId: String,
                             completionHandler: @escaping (Token?, NSError?) -> Void)
  • Undocumented

    Declaration

    Swift

    @objc
    public func getAcceptedBrandsWith(
        _ tenantId: String?,
        completionHandler: @escaping ([NSString]?, NSError?) -> Void
    )
  • Undocumented

    Declaration

    Swift

    @objc
    public func finishTokenThreeDSecureWith(
        _ tokenId: String,
        completionHandler: @escaping (Token?, NSError?) -> Void
    )