Payment
final class Payment
Class providing methods linked with payments.
-
Contact InPlayer server and validate if purchase was successfull.
Declaration
Swift
public static func validate(receiptString: String, productIdentifier: String, brandingID: Int? = nil, success: @escaping ()-> Void, failure: @escaping (_ error: InPlayerError) -> Void)Parameters
receiptStringBase64EncodedString of the recept data stored on device after successfull in-app purchase.
productIdentifierString combination of
itemIdandaccessFeeId, connected with_brandingIDOptional parameter - system branding theme ID
successA closure to be executed once the request has finished successfully.
failureA closure to be executed once the request has finished with error.
errorContaining information about the error that occurred.
-
Contact InPlayer server and validate if purchase was successfull.
Declaration
Swift
public static func validateByProductName(productName: String, receipt: String, brandingID: Int? = nil, success: @escaping () -> Void, failure: @escaping (_ error: InPlayerError) -> Void)Parameters
productNamePurchased product name
receiptBase64EncodedString of the recept data stored on device after successfull in-app purchase.
brandingIDOptional parameter - system branding theme ID
successA closure to be executed once the request has finished successfully.
failureA closure to be executed once the request has finished with error.
errorContaining information about the error that occurred.
-
Gets the purchase history
Declaration
Swift
public static func getPurchaseHistory(status: PurchaseHistory = .all, page: Int, limit: Int, type: String? = nil, customerId: Int? = nil, success: @escaping (_ purchaseHistory: InPlayerCustomerPurchaseHistory) -> Void, failure: @escaping (_ error: InPlayerError) -> Void)Parameters
statusThe status of the purchase - all/active/inactive.
pageThe current pag
limitThe number of items per page
typeType
customerIdAccount’s id
successA closure to be executed once the request has finished successfully.
purchaseHistoryPurchase history model containing list of all purchased access items.
failureA closure to be executed once the request has finished with error.
errorContaining information about the error that occurred.
View on GitHub
Payment Class Reference