@@ -526,19 +526,39 @@ public struct RequestPurchaseIosProps: Codable {
526526 public var andDangerouslyFinishTransactionAutomatically : Bool ?
527527 /// App account token for user tracking
528528 public var appAccountToken : String ?
529+ /// External purchase URL for alternative billing on iOS
530+ public var externalPurchaseUrlOnIOS : String ?
529531 /// Purchase quantity
530532 public var quantity : Int ?
531533 /// Product SKU
532534 public var sku : String
533535 /// Discount offer to apply
534536 public var withOffer : DiscountOfferInputIOS ?
537+
538+ public init (
539+ andDangerouslyFinishTransactionAutomatically: Bool ? = nil ,
540+ appAccountToken: String ? = nil ,
541+ externalPurchaseUrlOnIOS: String ? = nil ,
542+ quantity: Int ? = nil ,
543+ sku: String ,
544+ withOffer: DiscountOfferInputIOS ? = nil
545+ ) {
546+ self . andDangerouslyFinishTransactionAutomatically = andDangerouslyFinishTransactionAutomatically
547+ self . appAccountToken = appAccountToken
548+ self . externalPurchaseUrlOnIOS = externalPurchaseUrlOnIOS
549+ self . quantity = quantity
550+ self . sku = sku
551+ self . withOffer = withOffer
552+ }
535553}
536554
537555public struct RequestPurchaseProps : Codable {
538556 public var request : Request
539557 public var type : ProductQueryType
558+ /// Enable alternative billing flow
559+ public var useAlternativeBilling : Bool ?
540560
541- public init ( request: Request , type: ProductQueryType ? = nil ) {
561+ public init ( request: Request , type: ProductQueryType ? = nil , useAlternativeBilling : Bool ? = nil ) {
542562 switch request {
543563 case . purchase:
544564 let resolved = type ?? . inApp
@@ -550,17 +570,20 @@ public struct RequestPurchaseProps: Codable {
550570 self . type = resolved
551571 }
552572 self . request = request
573+ self . useAlternativeBilling = useAlternativeBilling
553574 }
554575
555576 private enum CodingKeys : String , CodingKey {
556577 case requestPurchase
557578 case requestSubscription
558579 case type
580+ case useAlternativeBilling
559581 }
560582
561583 public init ( from decoder: Decoder ) throws {
562584 let container = try decoder. container ( keyedBy: CodingKeys . self)
563585 let decodedType = try container. decodeIfPresent ( ProductQueryType . self, forKey: . type)
586+ self . useAlternativeBilling = try container. decodeIfPresent ( Bool . self, forKey: . useAlternativeBilling)
564587 if let purchase = try container. decodeIfPresent ( RequestPurchasePropsByPlatforms . self, forKey: . requestPurchase) {
565588 let finalType = decodedType ?? . inApp
566589 guard finalType == . inApp else {
@@ -604,6 +627,11 @@ public struct RequestPurchasePropsByPlatforms: Codable {
604627 public var android : RequestPurchaseAndroidProps ?
605628 /// iOS-specific purchase parameters
606629 public var ios : RequestPurchaseIosProps ?
630+
631+ public init ( android: RequestPurchaseAndroidProps ? = nil , ios: RequestPurchaseIosProps ? = nil ) {
632+ self . android = android
633+ self . ios = ios
634+ }
607635}
608636
609637public struct RequestSubscriptionAndroidProps : Codable {
@@ -626,16 +654,39 @@ public struct RequestSubscriptionAndroidProps: Codable {
626654public struct RequestSubscriptionIosProps : Codable {
627655 public var andDangerouslyFinishTransactionAutomatically : Bool ?
628656 public var appAccountToken : String ?
657+ /// External purchase URL for alternative billing on iOS
658+ public var externalPurchaseUrlOnIOS : String ?
629659 public var quantity : Int ?
630660 public var sku : String
631661 public var withOffer : DiscountOfferInputIOS ?
662+
663+ public init (
664+ andDangerouslyFinishTransactionAutomatically: Bool ? = nil ,
665+ appAccountToken: String ? = nil ,
666+ externalPurchaseUrlOnIOS: String ? = nil ,
667+ quantity: Int ? = nil ,
668+ sku: String ,
669+ withOffer: DiscountOfferInputIOS ? = nil
670+ ) {
671+ self . andDangerouslyFinishTransactionAutomatically = andDangerouslyFinishTransactionAutomatically
672+ self . appAccountToken = appAccountToken
673+ self . externalPurchaseUrlOnIOS = externalPurchaseUrlOnIOS
674+ self . quantity = quantity
675+ self . sku = sku
676+ self . withOffer = withOffer
677+ }
632678}
633679
634680public struct RequestSubscriptionPropsByPlatforms : Codable {
635681 /// Android-specific subscription parameters
636682 public var android : RequestSubscriptionAndroidProps ?
637683 /// iOS-specific subscription parameters
638684 public var ios : RequestSubscriptionIosProps ?
685+
686+ public init ( android: RequestSubscriptionAndroidProps ? = nil , ios: RequestSubscriptionIosProps ? = nil ) {
687+ self . android = android
688+ self . ios = ios
689+ }
639690}
640691
641692// MARK: - Unions
0 commit comments