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 }
-
createToken(with:
cvc: expirationMonth: expirationYear: name: tenantId: email: phone: useThreeDSecure: completion: ) 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 CardBrands
Declaration
Swift
@nonobjc public func getAcceptedBrands( with tenantId: String?, completion: CardBrandsResult? )
Parameters
tenantId
identifier of the Tenant
completion
completion action
-
Undocumented
Declaration
Swift
@objc public func createTokenWith( _ token: PKPaymentToken, completionHandler: @escaping (Token?, NSError?) -> Void )
-
createTokenWith(_:
cvc: expirationMonth: expirationYear: name: tenantId: email: phone: useThreeDSecure: completionHandler: ) 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 )