|
@@ -240,11 +240,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
|
|
|
originalPriceLabel1.font = NSFont.SFProTextRegularFont(16.0)
|
|
|
discountPriceLabel1.textColor = NSColor(named: "KMPurchaseDiscountColor")
|
|
|
discountPriceLabel1.font = NSFont.SFProTextRegularFont(9.0)
|
|
|
- if productType == .ipaConvert_checkout || productType == .ipaAI {
|
|
|
+ if productType == .ipaConvert || productType == .ipaAI {
|
|
|
aiAddOnView.isHidden = true
|
|
|
extendedView.isHidden = true
|
|
|
|
|
|
- if productType == .ipaConvert_checkout {
|
|
|
+ if productType == .ipaConvert {
|
|
|
pdfReaderProLabel.stringValue = NSLocalizedString("PDF to Office", comment: "")
|
|
|
prmiumLabel.stringValue = NSLocalizedString("Export PDF to Word(.docx), Excel (.xlsx), PowerPoint(.pptx) and more offline. It's one time purchase.", comment: "")
|
|
|
oneLicenseLabel.isHidden = true
|
|
@@ -924,7 +924,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- self._buyProduct(productID, count: pdfCount, discountId: coupomTextField.stringValue, payment: paymentMethod, license: VerificationManager.default().licenseCode, email: emailTextField.stringValue) { [weak self] info, err in
|
|
|
+ var licenseCode = ""
|
|
|
+ if let license = VerificationManager.default().originLicenseCode, license.count > 0 {
|
|
|
+ licenseCode = license
|
|
|
+ }
|
|
|
+ self._buyProduct(productID, count: pdfCount, discountId: coupomTextField.stringValue, payment: paymentMethod, license: licenseCode, email: emailTextField.stringValue) { [weak self] info, err in
|
|
|
guard let self = self else { return }
|
|
|
if err != nil {return}
|
|
|
if let dataInfo = info {
|
|
@@ -1017,39 +1021,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
|
|
|
|
|
|
// MARK: ——
|
|
|
|
|
|
- @objc func btnAction() {
|
|
|
- // 升级产品
|
|
|
- let productCode = "com.brother.pdfreaderpro.windows.product_1"
|
|
|
- let email = "tangchao@kdanmobile.com"
|
|
|
- self._buyProduct(productCode, count: 1, discountId: "", payment: .alipay, license: "", email: email, username: "") { [weak self] info, err in
|
|
|
-// // paypal_order
|
|
|
-// // page_pay_url 链接
|
|
|
-// // https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-3V503434MD108282U
|
|
|
-// // trade_no 订单id 用于校验订单 【22024083006591098】
|
|
|
- if let dataInfo = info {
|
|
|
- let trade_no = info?["trade_no"]
|
|
|
- let page_pay_url = info?["page_pay_url"]
|
|
|
-
|
|
|
- DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
|
|
- self?._getOrderStatus(tradeNo: trade_no as? String ?? "", callback: { info, err in
|
|
|
- KMPrint("")
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 数据错误
|
|
|
- }
|
|
|
- }
|
|
|
- self._getProductDatas { info, err in
|
|
|
- /*
|
|
|
- activity_cny_price 优惠价(人民币)
|
|
|
- activity_price 优惠价(美元)
|
|
|
- price 原价(美元)
|
|
|
- cny_price 原价(人民币)
|
|
|
- */
|
|
|
- print("111")
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// 获取价格
|
|
|
private func _getProductDatas(callback: @escaping (([String:Any]?, Any?)->Void)) {
|
|
|
// func getPriceUrl() {
|