QvaPayApi es un SwiftPackage para el consumo de la pasarela de pago QvaPay.
- Obtener Transacciones 1
- Crear Una Transaccion
- Obtener el Balance
- Obtener la Info
- UI
- iOS 8.0+
- Xcode 7.3
Puedes usar Swift Package para instalar QvaPayApi
con esta URL:
https://github.com/asielcabrera/QvaPayApi.git
To get the full benefits import QvaPay
wherever you import UIKit
import SwiftUI
import QvaPay
- Download and drop
credentials.json
with the content {"app_id":"token_app_id", "app_secrect": "your_token_app_secrect" } in your project. - Congratulations!
First import a credentials.plis inside your proyect and them..
import QvaPay
struct QvaPayViewExample: View {
@StateObject private var qvpay: QvaPayApiNetwork = QvaPayApiNetwork()
var body: some View {
return VStack ( spacing: 10){
if let data = qvpay.MerchandInfo {
VStack(spacing: 15){
Text(data.name)
Text(data.uuid)
Text(data.desc)
}
VStack {
if let trans: Transaction = qvpay.transactions {
List(trans){ tra in
Text(tra.total)
}
}
Text("BALANCE -- \(self.qvpay.Balance)")
Button {
self.qvpay.getTransactions()
print(self.qvpay.transactions as Any)
} label: {
Text("Get Transaction")
}.padding()
.buttonStyle(PlainButtonStyle())
.background(Color.blue.opacity(0.7))
.cornerRadius(10)
Button {
self.qvpay.createInvoice(invoice: InvoiceRequest(amount: 45, description: "prueba numero uno"))
print("invoice")
} label: {
Text("Invoice")
}.padding()
.buttonStyle(PlainButtonStyle())
.background(Color.blue.opacity(0.7))
.cornerRadius(10)
}
} else {
Text("done")
}
}
}
}
We would love you for the contribution to QvaPayApi, check the LICENSE
file for more info.
Asiel Cabrera – @asiel_cabrera – cabrerasiel@gmail.com
Distributed under the XYZ license. See LICENSE
for more information.