Skip to content

MrOlolo/SBPPaymentsIOS

Repository files navigation

SBPPayment (old SBPWidget)

Preview

preview

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 13.0+
  • Swift 5.0+

Installation

To install it, simply add the following line to your Podfile:

s.dependency 'SBPPayment'

Quick Start

import UIKit
import SBPPayment

class ViewController: UIViewController {
  
  override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
  }
  
  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    
    SBPWidgetModule().show(on: self) { result in
        switch result {
            case .success(let scheme):
                print(scheme ?? "widget has been closed")
            case .failure(let error):
                print(error)
        }
    }
  }
}

also you need add LSApplicationQueriesSchemes key into you project info.plst

 <key>LSApplicationQueriesSchemes</key>
  <array>
    <string>bank100000000000</string>
    <string>bank100000000001</string>
    ...
    <string>bank100000000999</string>
    <string>bank100000001000</string>
  </array>

Warning! Starting with iOS 15 there's limit in maximum 50 entries in list, so you probably need to take first 50 entries from c2bmembers.json. Look for details here.

That's need for UIApplication.shared.canOpenURL method worked correctly. You can copy and paste all lines from example

License

SBPWidget is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published