Back4app with Stripe using swift iOS

254 Views Asked by At

I'm trying to build an iOS app with back4app acting as the db. I've added Stripe to the cloud code and I've added all the relevant API keys to it.

I've been following https://www.back4app.com/docs/cloud-code-functions/stripe-android-app as documentation.

Being an Android app, I'm not sure which cloud code functions I should use when trying to test a payment using Swift.

Hope someone can help. Thanks.

1

There are 1 best solutions below

0
Tom Fox On

Back4App utilises the open source Parse Server and the wider Parse Platform including our open source client SDKs for iOS, Android, JavaScript, Flutter, PHP and more.

With this in mind much of our open source documentation is relevant to using Back4App. The extensive guides should help get you up to speed and answer most simple questions.

Following on from @Paul's suggestion, to call a cloud function using the iOS SDK you can do something like this...

PFCloud.callFunction(inBackground: "purchaseItem", withParameters: nil) { (result, error) in

    guard error == nil else {
        return
    }

    guard let result = result as? String else {
        return
    }

    print("Wow \(result).")

}