KMPurchaseEmbeddedWindowController.swift 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. //
  2. // KMPurchaseEmbeddedWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2024/8/29.
  6. //
  7. import Cocoa
  8. // paypal alipay wxpay paddle
  9. @objc enum KMPaymentType: UInt32 {
  10. case paypal = 1
  11. case alipay
  12. case wxpay
  13. case paddle
  14. }
  15. class KMPurchaseEmbeddedWindowController: NSWindowController {
  16. override func windowDidLoad() {
  17. super.windowDidLoad()
  18. // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
  19. #if DEBUG
  20. let btn = NSButton()
  21. let wh: CGFloat = 100
  22. let x = (NSWidth(self.window?.frame ?? .zero) - wh) * 0.5
  23. let y = (NSHeight(self.window?.frame ?? .zero) - wh) * 0.5
  24. btn.frame = NSMakeRect(x, y, wh, wh)
  25. btn.target = self
  26. btn.action = #selector(btnAction)
  27. self.window?.contentView?.addSubview(btn)
  28. #endif
  29. }
  30. override func showWindow(_ sender: Any?) {
  31. NSApp.runModal(for: self.window!)
  32. }
  33. @objc func btnAction() {
  34. // 升级产品
  35. let productCode = "com.brother.pdfreaderpro.windows.product_1"
  36. let email = "tangchao@kdanmobile.com"
  37. self._buyProduct(productCode, count: 1, discountId: "", payment: .alipay, license: "", email: email, username: "") { [weak self] info, err in
  38. // // paypal_order
  39. // // page_pay_url 链接
  40. // // https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-3V503434MD108282U
  41. // // trade_no 订单id 用于校验订单 【22024083006591098】
  42. if let dataInfo = info {
  43. let trade_no = info?["trade_no"]
  44. let page_pay_url = info?["page_pay_url"]
  45. DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
  46. self?._getOrderStatus(tradeNo: trade_no as? String ?? "", callback: { info, err in
  47. KMPrint("")
  48. })
  49. }
  50. } else {
  51. // 数据错误
  52. }
  53. }
  54. // let discountId = "E85B-9C31-6EAB"
  55. // self._getDiscount(productId: productCode, discountId: discountId) { info, err in
  56. // if let dataInfo = info {
  57. // let status = dataInfo["status"] as? String ?? ""
  58. // if status == "unused" {
  59. // // 折扣(eg. 0.7)
  60. // let discount = dataInfo["discount"]
  61. // // 价格 (应该是美元)
  62. // let price = dataInfo["price"]
  63. // }
  64. // }
  65. // }
  66. // self._getProductDatas { info, err in
  67. /*
  68. activity_cny_price 优惠价(人民币)
  69. activity_price 优惠价(美元)
  70. price 原价(美元)
  71. cny_price 原价(人民币)
  72. */
  73. // }
  74. }
  75. // 获取价格
  76. private func _getProductDatas(callback: @escaping (([String:Any]?, Any?)->Void)) {
  77. // func getPriceUrl() {
  78. let urlString = kVerificationServer + "/api/product/get-price/v2"
  79. KMAdvertisementRequestServer.requestServer.request(urlString: urlString, method: "GET", params: nil) { task, responseObject, error in
  80. if (error == nil && responseObject != nil) {
  81. let array = responseObject?["data"] as? NSDictionary
  82. if array != nil {
  83. //解析数据
  84. let productsDict = array?.object(forKey: "data") as? NSDictionary
  85. callback(productsDict as? [String : Any], nil)
  86. } else {
  87. callback([:], error.debugDescription)
  88. }
  89. } else {
  90. callback(nil, error.debugDescription)
  91. }
  92. }
  93. }
  94. // 获取优惠卷
  95. private func _getDiscount(productId: String, discountId: String, callback: @escaping (([String : Any]?, Any?)->Void)) {
  96. let urlString = kVerificationServer + "/api/coupons/retrieval"
  97. let app_code = MainBundle.km_infoDictionary()?["CFBundleIdentifier"] ?? ""
  98. let params = [
  99. // 优惠卷id
  100. "code" : discountId,
  101. "app_code" : app_code,
  102. "product_code" : productId]
  103. KMAdvertisementRequestServer.requestServer.request(urlString: urlString, method: "GET", params: params) { task, responseObject, error in
  104. if (error == nil && responseObject != nil) {
  105. if let dataDict = responseObject?["data"] as? NSDictionary {
  106. callback(dataDict as? [String : Any], nil)
  107. } else {
  108. callback([:], error.debugDescription)
  109. }
  110. } else {
  111. callback(nil, error.debugDescription)
  112. }
  113. }
  114. }
  115. // 获取订单状态
  116. private func _getOrderStatus(tradeNo: String, callback: @escaping (([String:Any]?, Any?)->Void)) {
  117. let urlString = kVerificationServer + "/api/orders/getOrderStatus"
  118. var jsonStr: String = ""
  119. if let jsonData = try?JSONSerialization.data(withJSONObject: ["trade_no" : tradeNo], options:[]),
  120. let data = String(data: jsonData, encoding: .utf8) {
  121. jsonStr = data
  122. }
  123. let rsa = KMVerificationRSA()
  124. let publicKey = rsa.loadPublicKey()
  125. let encryptedData = rsa.encrypt(plainText: jsonStr, publicKey: publicKey!)
  126. let tokenStr = encryptedData?.base64EncodedString()
  127. var postData = try!JSONSerialization.data(withJSONObject: ["token" : tokenStr])
  128. var request = URLRequest(url: URL(string: urlString)!,timeoutInterval: Double.infinity)
  129. request.addValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
  130. request.addValue("application/json", forHTTPHeaderField: "Content-Type")
  131. request.httpMethod = "POST"
  132. request.httpBody = postData
  133. let task = URLSession.shared.dataTask(with: request) { data, response, error in
  134. guard let data = data else {
  135. callback(nil, String(describing: error))
  136. return
  137. }
  138. if let jsonDict = try?JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary ?? [:] {
  139. let dataStr = jsonDict["data"] as? String
  140. let rsa = KMVerificationRSA()
  141. if let deData = (rsa.decrypt(source: dataStr as? NSString ?? "") as? String)?.data(using: .utf8) {
  142. if let dict = try?JSONSerialization.jsonObject(with: deData, options: []) as? NSDictionary ?? [:] {
  143. return callback(dict as? [String : Any], nil)
  144. }
  145. }
  146. callback([:], String(describing: error))
  147. } else {
  148. // 数据错误
  149. callback([:], String(describing: error))
  150. }
  151. }
  152. task.resume()
  153. }
  154. private func _buyProduct(_ productId: String, count: Int, discountId: String = "", payment: KMPaymentType, license: String = "", email: String, username: String = "", callback: @escaping (([String:Any]?, Any?)->Void)) {
  155. let urlString = kVerificationServer + "/api/subscriptions"
  156. let app_code = MainBundle.km_infoDictionary()?["CFBundleIdentifier"] ?? ""
  157. let paymentStr = self._paymentTypeString(type: payment)
  158. let paraDict = ["data" :
  159. ["product_code": productId,
  160. "app_code": app_code,
  161. // 购买数量
  162. "amount": "\(count)",
  163. // 优惠卷id
  164. "coupon_code": discountId,
  165. // 支付类型 paypal alipay wxpay paddle
  166. "payment": paymentStr,
  167. // 地区
  168. "customer_country": "US",
  169. // 邮编码
  170. "customer_postcode" : "20001",
  171. "unique_sn" : uuid(),
  172. // 序列码 标准包 升级 高级包 需要
  173. "upgrade_cdkey" : license,
  174. "email" : email,
  175. // 用户名
  176. "contact_name" : username]]
  177. var postData = try! JSONSerialization.data(withJSONObject: paraDict)
  178. var request = URLRequest(url: URL(string: urlString)!,timeoutInterval: Double.infinity)
  179. request.addValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
  180. request.addValue("application/json", forHTTPHeaderField: "Content-Type")
  181. request.httpMethod = "POST"
  182. request.httpBody = postData
  183. let task = URLSession.shared.dataTask(with: request) { data, response, error in
  184. guard let theData = data else {
  185. callback(nil, String(describing: error))
  186. return
  187. }
  188. if let jsonDict = try? JSONSerialization.jsonObject(with: theData, options: []) as? NSDictionary ?? [:] {
  189. let data1: NSDictionary = jsonDict["data"] as? NSDictionary ?? [:]
  190. let subscriptionInfo = data1.object(forKey: "subscription") as? NSDictionary
  191. let orderKey = self._paymentTypeString(type: payment) + "_order"
  192. let order_info = subscriptionInfo?.object(forKey: orderKey) as? NSDictionary
  193. if let dataInfo = order_info, dataInfo.count > 0 {
  194. callback(dataInfo as? [String : Any], nil)
  195. } else {
  196. // 数据错误
  197. callback([:], String(describing: error))
  198. }
  199. } else {
  200. // 数据错误
  201. callback([:], String(describing: error))
  202. }
  203. }
  204. task.resume()
  205. }
  206. // MARK: Private
  207. private func uuid() -> String {
  208. return GetHardwareUUID()!
  209. }
  210. private func _paymentTypeString(type: KMPaymentType) -> String {
  211. if type == .paddle {
  212. return "paddle"
  213. } else if type == .alipay {
  214. return "alipay"
  215. } else if type == .wxpay {
  216. return "wxpay"
  217. } else if type == .paddle {
  218. return "paddle"
  219. }
  220. return ""
  221. }
  222. }
  223. // /api/product/get-price/v2
  224. /*
  225. ▿ some : 1 element
  226. ▿ 0 : 2 elements
  227. - key : data
  228. ▿ value : 3 elements
  229. ▿ 0 : 2 elements
  230. - key : message
  231. - value : success
  232. ▿ 1 : 2 elements
  233. - key : data
  234. ▿ value : 37 elements
  235. ▿ 0 : 2 elements
  236. - key : com.cisdem.pdfmaster.cross.platform.product_3
  237. ▿ value : 4 elements
  238. ▿ 0 : 2 elements
  239. - key : activity_cny_price
  240. - value : 776
  241. ▿ 1 : 2 elements
  242. - key : activity_price
  243. - value : 119.98
  244. ▿ 2 : 2 elements
  245. - key : price
  246. - value : 119.98
  247. ▿ 3 : 2 elements
  248. - key : cny_price
  249. - value : 776
  250. ▿ 1 : 2 elements
  251. - key : com.filmage.pro-lite.mac.forever
  252. ▿ value : 4 elements
  253. ▿ 0 : 2 elements
  254. - key : activity_cny_price
  255. - value : 388
  256. ▿ 1 : 2 elements
  257. - key : activity_price
  258. - value : 59.99
  259. ▿ 2 : 2 elements
  260. - key : price
  261. - value : 59.99
  262. ▿ 3 : 2 elements
  263. - key : cny_price
  264. - value : 388
  265. ▿ 2 : 2 elements
  266. - key : com.brother.pdfreaderpro.windows.product_3+com.brother.pdfreaderpro.mac.product_3
  267. ▿ value : 4 elements
  268. ▿ 0 : 2 elements
  269. - key : activity_cny_price
  270. - value : 1036
  271. ▿ 1 : 2 elements
  272. - key : activity_price
  273. - value : 159.98
  274. ▿ 2 : 2 elements
  275. - key : price
  276. - value : 159.98
  277. ▿ 3 : 2 elements
  278. - key : cny_price
  279. - value : 1036
  280. ▿ 3 : 2 elements
  281. - key : com.brother.pdfreaderpro.cross.platform.product_3
  282. ▿ value : 4 elements
  283. ▿ 0 : 2 elements
  284. - key : activity_cny_price
  285. - value : 486
  286. ▿ 1 : 2 elements
  287. - key : activity_price
  288. - value : 74.98
  289. ▿ 2 : 2 elements
  290. - key : price
  291. - value : 119.98
  292. ▿ 3 : 2 elements
  293. - key : cny_price
  294. - value : 776
  295. ▿ 4 : 2 elements
  296. - key : com.cisdem.pdfmaster.ai.product_1
  297. ▿ value : 4 elements
  298. ▿ 0 : 2 elements
  299. - key : activity_cny_price
  300. - value : 99
  301. ▿ 1 : 2 elements
  302. - key : activity_price
  303. - value : 14.99
  304. ▿ 2 : 2 elements
  305. - key : price
  306. - value : 14.99
  307. ▿ 3 : 2 elements
  308. - key : cny_price
  309. - value : 99
  310. ▿ 5 : 2 elements
  311. - key : com.filmage.screen.mac
  312. ▿ value : 4 elements
  313. ▿ 0 : 2 elements
  314. - key : activity_cny_price
  315. - value : 92
  316. ▿ 1 : 2 elements
  317. - key : activity_price
  318. - value : 14.99
  319. ▿ 2 : 2 elements
  320. - key : price
  321. - value : 29.99
  322. ▿ 3 : 2 elements
  323. - key : cny_price
  324. - value : 189
  325. ▿ 6 : 2 elements
  326. - key : com.brother.pdfreaderpro.windows.product_3
  327. ▿ value : 4 elements
  328. ▿ 0 : 2 elements
  329. - key : activity_cny_price
  330. - value : 259
  331. ▿ 1 : 2 elements
  332. - key : activity_price
  333. - value : 39.99
  334. ▿ 2 : 2 elements
  335. - key : price
  336. - value : 79.99
  337. ▿ 3 : 2 elements
  338. - key : cny_price
  339. - value : 518
  340. ▿ 7 : 2 elements
  341. - key : com.brother.pdfreaderpro.combination.product
  342. ▿ value : 4 elements
  343. ▿ 0 : 2 elements
  344. - key : activity_cny_price
  345. - value : 600
  346. ▿ 1 : 2 elements
  347. - key : activity_price
  348. - value : 100
  349. ▿ 2 : 2 elements
  350. - key : price
  351. - value : 100
  352. ▿ 3 : 2 elements
  353. - key : cny_price
  354. - value : 600
  355. ▿ 8 : 2 elements
  356. - key : com.brother.pdfreaderpro.mac.product_2.checkout
  357. ▿ value : 4 elements
  358. ▿ 0 : 2 elements
  359. - key : activity_cny_price
  360. - value : 78
  361. ▿ 1 : 2 elements
  362. - key : activity_price
  363. - value : 12
  364. ▿ 2 : 2 elements
  365. - key : price
  366. - value : 20.00
  367. ▿ 3 : 2 elements
  368. - key : cny_price
  369. - value : 130.00
  370. ▿ 9 : 2 elements
  371. - key : com.brother.pdfreaderpro.windows.product_1
  372. ▿ value : 4 elements
  373. ▿ 0 : 2 elements
  374. - key : activity_cny_price
  375. - value : 388
  376. ▿ 1 : 2 elements
  377. - key : activity_price
  378. - value : 59.99
  379. ▿ 2 : 2 elements
  380. - key : price
  381. - value : 59.99
  382. ▿ 3 : 2 elements
  383. - key : cny_price
  384. - value : 388
  385. ▿ 10 : 2 elements
  386. - key : com.brother.pdfreaderpro.ai.product_1
  387. ▿ value : 4 elements
  388. ▿ 0 : 2 elements
  389. - key : activity_cny_price
  390. - value : 99
  391. ▿ 1 : 2 elements
  392. - key : activity_price
  393. - value : 14.99
  394. ▿ 2 : 2 elements
  395. - key : price
  396. - value : 14.99
  397. ▿ 3 : 2 elements
  398. - key : cny_price
  399. - value : 99
  400. ▿ 11 : 2 elements
  401. - key : com.brother.pdftecheditor.windows
  402. ▿ value : 4 elements
  403. ▿ 0 : 2 elements
  404. - key : activity_cny_price
  405. - value : 598
  406. ▿ 1 : 2 elements
  407. - key : activity_price
  408. - value : 89.99
  409. ▿ 2 : 2 elements
  410. - key : price
  411. - value : 89.99
  412. ▿ 3 : 2 elements
  413. - key : cny_price
  414. - value : 598
  415. ▿ 12 : 2 elements
  416. - key : com.imyfone.pdf.cross.platform.trail
  417. ▿ value : 4 elements
  418. ▿ 0 : 2 elements
  419. - key : activity_cny_price
  420. - value : 776
  421. ▿ 1 : 2 elements
  422. - key : activity_price
  423. - value : 1
  424. ▿ 2 : 2 elements
  425. - key : price
  426. - value : 1
  427. ▿ 3 : 2 elements
  428. - key : cny_price
  429. - value : 776
  430. ▿ 13 : 2 elements
  431. - key : com.brother.pdfreaderpro.mac.product_3
  432. ▿ value : 4 elements
  433. ▿ 0 : 2 elements
  434. - key : activity_cny_price
  435. - value : 259
  436. ▿ 1 : 2 elements
  437. - key : activity_price
  438. - value : 39.99
  439. ▿ 2 : 2 elements
  440. - key : price
  441. - value : 79.99
  442. ▿ 3 : 2 elements
  443. - key : cny_price
  444. - value : 518
  445. ▿ 14 : 2 elements
  446. - key : com.brother.pdfreaderpro.mac.product_2
  447. ▿ value : 4 elements
  448. ▿ 0 : 2 elements
  449. - key : activity_cny_price
  450. - value : 128
  451. ▿ 1 : 2 elements
  452. - key : activity_price
  453. - value : 19.99
  454. ▿ 2 : 2 elements
  455. - key : price
  456. - value : 19.99
  457. ▿ 3 : 2 elements
  458. - key : cny_price
  459. - value : 128
  460. ▿ 15 : 2 elements
  461. - key : com.brother.pdfreaderpro.windows.product_3+com.brother.pdfreaderpro.ai.product_1
  462. ▿ value : 4 elements
  463. ▿ 0 : 2 elements
  464. - key : activity_cny_price
  465. - value : 318
  466. ▿ 1 : 2 elements
  467. - key : activity_price
  468. - value : 48.98
  469. ▿ 2 : 2 elements
  470. - key : price
  471. - value : 94.98
  472. ▿ 3 : 2 elements
  473. - key : cny_price
  474. - value : 617
  475. ▿ 16 : 2 elements
  476. - key : com.filmage.pro-lite.mac
  477. ▿ value : 4 elements
  478. ▿ 0 : 2 elements
  479. - key : activity_cny_price
  480. - value : 259
  481. ▿ 1 : 2 elements
  482. - key : activity_price
  483. - value : 39.99
  484. ▿ 2 : 2 elements
  485. - key : price
  486. - value : 39.99
  487. ▿ 3 : 2 elements
  488. - key : cny_price
  489. - value : 259
  490. ▿ 17 : 2 elements
  491. - key : com.brother.pdfreaderpro.mac.product_3+com.filmage.screen.mac
  492. ▿ value : 4 elements
  493. ▿ 0 : 2 elements
  494. - key : activity_cny_price
  495. - value : 318
  496. ▿ 1 : 2 elements
  497. - key : activity_price
  498. - value : 49.98
  499. ▿ 2 : 2 elements
  500. - key : price
  501. - value : 109.98
  502. ▿ 3 : 2 elements
  503. - key : cny_price
  504. - value : 707
  505. ▿ 18 : 2 elements
  506. - key : com.brother.pdfreaderpro.mac.product_1
  507. ▿ value : 4 elements
  508. ▿ 0 : 2 elements
  509. - key : activity_cny_price
  510. - value : 388
  511. ▿ 1 : 2 elements
  512. - key : activity_price
  513. - value : 59.99
  514. ▿ 2 : 2 elements
  515. - key : price
  516. - value : 59.99
  517. ▿ 3 : 2 elements
  518. - key : cny_price
  519. - value : 388
  520. ▿ 19 : 2 elements
  521. - key : com.filmage.screen.mac.6_months
  522. ▿ value : 4 elements
  523. ▿ 0 : 2 elements
  524. - key : activity_cny_price
  525. - value : 99
  526. ▿ 1 : 2 elements
  527. - key : activity_price
  528. - value : 14.99
  529. ▿ 2 : 2 elements
  530. - key : price
  531. - value : 14.99
  532. ▿ 3 : 2 elements
  533. - key : cny_price
  534. - value : 99
  535. ▿ 20 : 2 elements
  536. - key : com.brother.pdfreaderpro.cross.platform.product_3+com.brother.pdfreaderpro.ai.product_1
  537. ▿ value : 4 elements
  538. ▿ 0 : 2 elements
  539. - key : activity_cny_price
  540. - value : 604
  541. ▿ 1 : 2 elements
  542. - key : activity_price
  543. - value : 92.96
  544. ▿ 2 : 2 elements
  545. - key : price
  546. - value : 149.96
  547. ▿ 3 : 2 elements
  548. - key : cny_price
  549. - value : 974
  550. ▿ 21 : 2 elements
  551. - key : com.brother.pdfreaderpro.windows.product_1+com.brother.pdfreaderpro.ai.product_1
  552. ▿ value : 4 elements
  553. ▿ 0 : 2 elements
  554. - key : activity_cny_price
  555. - value : 487
  556. ▿ 1 : 2 elements
  557. - key : activity_price
  558. - value : 74.98
  559. ▿ 2 : 2 elements
  560. - key : price
  561. - value : 74.98
  562. ▿ 3 : 2 elements
  563. - key : cny_price
  564. - value : 487
  565. ▿ 22 : 2 elements
  566. - key : com.imyfone.pdf.cross.platform.product_3
  567. ▿ value : 4 elements
  568. ▿ 0 : 2 elements
  569. - key : activity_cny_price
  570. - value : 776
  571. ▿ 1 : 2 elements
  572. - key : activity_price
  573. - value : 119.98
  574. ▿ 2 : 2 elements
  575. - key : price
  576. - value : 119.98
  577. ▿ 3 : 2 elements
  578. - key : cny_price
  579. - value : 776
  580. ▿ 23 : 2 elements
  581. - key : com.kdanmobile.mac.PDFReaderLite.perpetual_license_pack.002
  582. ▿ value : 4 elements
  583. ▿ 0 : 2 elements
  584. - key : activity_cny_price
  585. - value : 798
  586. ▿ 1 : 2 elements
  587. - key : activity_price
  588. - value : 119.99
  589. ▿ 2 : 2 elements
  590. - key : price
  591. - value : 119.99
  592. ▿ 3 : 2 elements
  593. - key : cny_price
  594. - value : 798
  595. ▿ 24 : 2 elements
  596. - key : com.brother.pdfreaderpro.windows.product_2
  597. ▿ value : 4 elements
  598. ▿ 0 : 2 elements
  599. - key : activity_cny_price
  600. - value : 128
  601. ▿ 1 : 2 elements
  602. - key : activity_price
  603. - value : 19.99
  604. ▿ 2 : 2 elements
  605. - key : price
  606. - value : 19.99
  607. ▿ 3 : 2 elements
  608. - key : cny_price
  609. - value : 128
  610. ▿ 25 : 2 elements
  611. - key : com.brother.pdfreaderpro.mac.product_1+com.brother.pdfreaderpro.ai.product_1
  612. ▿ value : 4 elements
  613. ▿ 0 : 2 elements
  614. - key : activity_cny_price
  615. - value : 487
  616. ▿ 1 : 2 elements
  617. - key : activity_price
  618. - value : 74.98
  619. ▿ 2 : 2 elements
  620. - key : price
  621. - value : 74.98
  622. ▿ 3 : 2 elements
  623. - key : cny_price
  624. - value : 487
  625. ▿ 26 : 2 elements
  626. - key : com.brother.pdfreaderpro.windows.product_2.checkout
  627. ▿ value : 4 elements
  628. ▿ 0 : 2 elements
  629. - key : activity_cny_price
  630. - value : 78
  631. ▿ 1 : 2 elements
  632. - key : activity_price
  633. - value : 12
  634. ▿ 2 : 2 elements
  635. - key : price
  636. - value : 20.00
  637. ▿ 3 : 2 elements
  638. - key : cny_price
  639. - value : 130.00
  640. ▿ 27 : 2 elements
  641. - key : com.filmage.converter.mac
  642. ▿ value : 4 elements
  643. ▿ 0 : 2 elements
  644. - key : activity_cny_price
  645. - value : 68
  646. ▿ 1 : 2 elements
  647. - key : activity_price
  648. - value : 9.99
  649. ▿ 2 : 2 elements
  650. - key : price
  651. - value : 9.99
  652. ▿ 3 : 2 elements
  653. - key : cny_price
  654. - value : 68
  655. ▿ 28 : 2 elements
  656. - key : com.brother.pdfreaderpro.mac.product_3+com.brother.pdfreaderpro.ai.product_1
  657. ▿ value : 4 elements
  658. ▿ 0 : 2 elements
  659. - key : activity_cny_price
  660. - value : 318
  661. ▿ 1 : 2 elements
  662. - key : activity_price
  663. - value : 48.98
  664. ▿ 2 : 2 elements
  665. - key : price
  666. - value : 94.98
  667. ▿ 3 : 2 elements
  668. - key : cny_price
  669. - value : 617
  670. ▿ 29 : 2 elements
  671. - key : com.cisdem.pdfmaster.windows.product_3
  672. ▿ value : 4 elements
  673. ▿ 0 : 2 elements
  674. - key : activity_cny_price
  675. - value : 518
  676. ▿ 1 : 2 elements
  677. - key : activity_price
  678. - value : 79.99
  679. ▿ 2 : 2 elements
  680. - key : price
  681. - value : 79.99
  682. ▿ 3 : 2 elements
  683. - key : cny_price
  684. - value : 518
  685. ▿ 30 : 2 elements
  686. - key : com.filmage.converter.mac+com.filmage.pro-lite.mac
  687. ▿ value : 4 elements
  688. ▿ 0 : 2 elements
  689. - key : activity_cny_price
  690. - value : 0.02
  691. ▿ 1 : 2 elements
  692. - key : activity_price
  693. - value : 49.98
  694. ▿ 2 : 2 elements
  695. - key : price
  696. - value : 49.98
  697. ▿ 3 : 2 elements
  698. - key : cny_price
  699. - value : 0.02
  700. ▿ 31 : 2 elements
  701. - key : com.brother.pdfreaderpro.cross.platform.product_1
  702. ▿ value : 4 elements
  703. ▿ 0 : 2 elements
  704. - key : activity_cny_price
  705. - value : 600
  706. ▿ 1 : 2 elements
  707. - key : activity_price
  708. - value : 100
  709. ▿ 2 : 2 elements
  710. - key : price
  711. - value : 100
  712. ▿ 3 : 2 elements
  713. - key : cny_price
  714. - value : 600
  715. ▿ 32 : 2 elements
  716. - key : com.brother.pdftecheditor
  717. ▿ value : 4 elements
  718. ▿ 0 : 2 elements
  719. - key : activity_cny_price
  720. - value : 598
  721. ▿ 1 : 2 elements
  722. - key : activity_price
  723. - value : 89.99
  724. ▿ 2 : 2 elements
  725. - key : price
  726. - value : 89.99
  727. ▿ 3 : 2 elements
  728. - key : cny_price
  729. - value : 598
  730. ▿ 33 : 2 elements
  731. - key : com.kdanmobile.mac.PDFReaderLite.standard_license_pack.002
  732. ▿ value : 4 elements
  733. ▿ 0 : 2 elements
  734. - key : activity_cny_price
  735. - value : 588
  736. ▿ 1 : 2 elements
  737. - key : activity_price
  738. - value : 89.99
  739. ▿ 2 : 2 elements
  740. - key : price
  741. - value : 89.99
  742. ▿ 3 : 2 elements
  743. - key : cny_price
  744. - value : 588
  745. ▿ 34 : 2 elements
  746. - key : com.filmage.screen.mac+com.filmage.pro-lite.mac
  747. ▿ value : 4 elements
  748. ▿ 0 : 2 elements
  749. - key : activity_cny_price
  750. - value : 0.02
  751. ▿ 1 : 2 elements
  752. - key : activity_price
  753. - value : 69.98
  754. ▿ 2 : 2 elements
  755. - key : price
  756. - value : 69.98
  757. ▿ 3 : 2 elements
  758. - key : cny_price
  759. - value : 0.02
  760. ▿ 35 : 2 elements
  761. - key : com.cisdem.pdfmaster.mac.product_3
  762. ▿ value : 4 elements
  763. ▿ 0 : 2 elements
  764. - key : activity_cny_price
  765. - value : 518
  766. ▿ 1 : 2 elements
  767. - key : activity_price
  768. - value : 79.99
  769. ▿ 2 : 2 elements
  770. - key : price
  771. - value : 79.99
  772. ▿ 3 : 2 elements
  773. - key : cny_price
  774. - value : 518
  775. ▿ 36 : 2 elements
  776. - key : com.brother.pdfreaderpro.cross.platform.product_2
  777. ▿ value : 4 elements
  778. ▿ 0 : 2 elements
  779. - key : activity_cny_price
  780. - value : 258
  781. ▿ 1 : 2 elements
  782. - key : activity_price
  783. - value : 39.99
  784. ▿ 2 : 2 elements
  785. - key : price
  786. - value : 79.99
  787. ▿ 3 : 2 elements
  788. - key : cny_price
  789. - value : 518
  790. ▿ 2 : 2 elements
  791. - key : code
  792. - value : 200
  793. */
  794. // /api/coupons/retrieval
  795. /*
  796. ▿ Optional<AnyObject>
  797. ▿ some : 2 elements
  798. ▿ 0 : 2 elements
  799. - key : app_code
  800. - value : com.brother.pdfreaderprofree.windows
  801. ▿ 1 : 2 elements
  802. - key : data
  803. ▿ value : 12 elements
  804. ▿ 0 : 2 elements
  805. - key : id
  806. - value : 5851c5d6-f43e-32b2-8660-a6222194fee4
  807. ▿ 1 : 2 elements
  808. - key : discount
  809. - value : <null>
  810. ▿ 2 : 2 elements
  811. - key : member
  812. ▿ value : 2 elements
  813. ▿ 0 : 2 elements
  814. - key : email
  815. - value : sec-2@drmail.in
  816. ▿ 1 : 2 elements
  817. - key : full_name
  818. - value : test-nilvbo2
  819. ▿ 3 : 2 elements
  820. - key : coupon_provider
  821. ▿ value : 15 elements
  822. ▿ 0 : 2 elements
  823. - key : id
  824. - value : 291
  825. ▿ 1 : 2 elements
  826. - key : category
  827. - value : presented
  828. ▿ 2 : 2 elements
  829. - key : start_date
  830. - value : <null>
  831. ▿ 3 : 2 elements
  832. - key : limit_product
  833. - value : 0
  834. ▿ 4 : 2 elements
  835. - key : total_amount
  836. - value : 59502
  837. ▿ 5 : 2 elements
  838. - key : rcode
  839. - value :
  840. ▿ 6 : 2 elements
  841. - key : end_date
  842. - value : <null>
  843. ▿ 7 : 2 elements
  844. - key : created_at
  845. - value : 2024-05-24 07:20:21
  846. ▿ 8 : 2 elements
  847. - key : discount
  848. - value : <null>
  849. ▿ 9 : 2 elements
  850. - key : limit_product_code
  851. - value :
  852. ▿ 10 : 2 elements
  853. - key : minimum_charge
  854. - value : 59.99
  855. ▿ 11 : 2 elements
  856. - key : price
  857. - value : 15
  858. ▿ 12 : 2 elements
  859. - key : valid_period
  860. - value : 336.hours
  861. ▿ 13 : 2 elements
  862. - key : product_id
  863. - value : 15
  864. ▿ 14 : 2 elements
  865. - key : received_amount
  866. - value : 39
  867. ▿ 4 : 2 elements
  868. - key : expire_date
  869. - value : 1718857051
  870. ▿ 5 : 2 elements
  871. - key : created_at
  872. - value : 2024-06-06 04:17:31
  873. ▿ 6 : 2 elements
  874. - key : source_type
  875. - value : event
  876. ▿ 7 : 2 elements
  877. - key : minimum_charge
  878. - value : 59.99
  879. ▿ 8 : 2 elements
  880. - key : price
  881. - value : 15
  882. ▿ 9 : 2 elements
  883. - key : coupon_provider_id
  884. - value : 291
  885. ▿ 10 : 2 elements
  886. - key : code
  887. - value : E85B-9C31-6EAB
  888. ▿ 11 : 2 elements
  889. - key : status
  890. - value : expired
  891. */