From ce8cfa6dab6291983ce19cf279a8cbf9ba9c14ac Mon Sep 17 00:00:00 2001 From: Osama Rabie <59433049+OsamaRabie@users.noreply.github.com> Date: Thu, 4 Jan 2024 16:01:00 +0300 Subject: [PATCH] Example --- .../Controllers/ExampleViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Example/goSellSDKExample/Controllers/ExampleViewController.swift b/Example/goSellSDKExample/Controllers/ExampleViewController.swift index 5c3e453..78dc9c8 100644 --- a/Example/goSellSDKExample/Controllers/ExampleViewController.swift +++ b/Example/goSellSDKExample/Controllers/ExampleViewController.swift @@ -86,6 +86,12 @@ internal class ExampleViewController: BaseViewController { session.dataSource = self session.delegate = self payButton?.dataSource = self + let topup:Topup = try! .init(walletID: "wallet_xx", reference: .init(transactionNumber: "trx_xx", orderNumber: "ord_xx"), application: .init(amount: 1, currency: .init(isoCode: "KWD")), metdata: ["key":"value"], post: .init(url: URL(string: "https://www.post.com")!)) + let encoder = JSONEncoder() + encoder.outputFormatting = .prettyPrinted + let data = try! encoder.encode(topup) + let output:String = String(data: data, encoding: .utf8)! + print(output) //session.appearance = self }