Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
Update payjoin.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
22388o authored Mar 2, 2024
1 parent a422e09 commit 834fbd2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ios/app/payjoin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import UIKit
import PayJoin

class ViewController: UIViewController {
let payJoinService = PayJoinService()

override func viewDidLoad() {
super.viewDidLoad()

let payJoinButton = UIButton(type: .system)
payJoinButton.setTitle("Initiate PayJoin", for: .normal)
payJoinButton.addTarget(self, action: #selector(initiatePayJoin), for: .touchUpInside)
view.addSubview(payJoinButton)
}

@objc func initiatePayJoin() {
DispatchQueue.global().async {
let transactionData = Any() // Prepare transaction data
let response = self.payJoinService.initiatePayJoinTransaction(transactionData: transactionData)
// Handle response
}
}
}

0 comments on commit 834fbd2

Please sign in to comment.