Skip to content

Commit c91e7c7

Browse files
adding brandingID support to validateProductByName
1 parent aa4c059 commit c91e7c7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Source/Payment/API/INPPaymentService.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,17 @@ class INPPaymentService {
4545

4646
static func validateByProductName(productName: String,
4747
receipt: String,
48+
brandingId: Int?,
4849
completion: @escaping RequestCompletion<Empty>) {
49-
let params: [String: Any] = [
50+
var params: [String: Any] = [
5051
PaymentParameters.receipt: receipt,
5152
PaymentParameters.productName: productName
5253
]
54+
55+
if let brandingID = brandingId {
56+
params[PaymentParameters.brandingID] = brandingID
57+
}
58+
5359
NetworkDataSource.performRequest(session: InPlayerSessionAPIManager.default.session,
5460
route: PaymentAPIRouter.validatePaymentByProductName(parameters: params),
5561
completion: completion)

Source/Payment/Payment.swift

+3
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,20 @@ public extension InPlayer {
4040
- Parameters:
4141
- productName: Purchased product name
4242
- receipt: Base64EncodedString of the recept data stored on device after successfull in-app purchase.
43+
- brandingID: Optional parameter - system branding theme ID
4344
- success: A closure to be executed once the request has finished successfully.
4445
- failure: A closure to be executed once the request has finished with error.
4546
- error: Containing information about the error that occurred.
4647
*/
4748

4849
public static func validateByProductName(productName: String,
4950
receipt: String,
51+
brandingID: Int? = nil,
5052
success: @escaping () -> Void,
5153
failure: @escaping (_ error: InPlayerError) -> Void) {
5254
INPPaymentService.validateByProductName(productName: productName,
5355
receipt: receipt,
56+
brandingId: brandingID,
5457
completion: { (_, error) in
5558
if let error = error {
5659
failure(error)

0 commit comments

Comments
 (0)