How to Implement a Payment App with Braintree in iOS

How to implement a payment app with Braintree in iOS

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.

You can access the payment method nonce via the result object within showDropIn(). This is also where you may call postNonceToServer().

func showDropIn(clientTokenOrTokenizationKey: String) {
let request = BTDropInRequest()
request.amount = "\(total)"
request.currencyCode = "MXN"
let dropIn = BTDropInController(authorization: clientTokenOrTokenizationKey, request: request)
{ (controller, result, error) in
if (error != nil) {
print("ERROR")
} else if (result?.isCancelled == true) {
print("CANCELLED")
} else if let result = result {
let selectedPaymentMethod = result.paymentMethod! // retrieve the payment method.
self.postNonceToServer(paymentMethodNonce: selectedPaymentMethod.nonce) // call postNonceToServer() with the nonce from the selected payment method.
}
controller.dismiss(animated: true, completion: nil)
}
self.present(dropIn!, animated: true, completion: nil)
}

After you successfully call postNonceToServer() you can receive the payment method nonce and create a transaction on your server.

Braintree for iOS apps with paypal integration

I work at Braintree. If you have more questions, please reach out to our support team.

Yes, the Braintree iOS SDK includes PayPal support:

PayPal

Braintree offers a few options when accepting PayPal payments. First,
you'll need to choose whether you would like to use our Drop-In UI or
a custom integration.

Vault vs. Checkout

Next, you can choose between our Vault and Checkout flows. Below is a
comparison of the two options:

  • Vault Compatibility: iOS, Android, and web
  • Checkout Compatibility: Web only

How to integrate braintree to iOS or Android app using flutter?

The pub you posted is discontinued. Please move to this. Anyway, it's possible :)

Using Braintree for iOS subscriptions

In reading the App Store Review Guidelines, specifically section 11 (about purchasing), I'm pretty sure it would be rejected under rule 11.2:

11.2 Apps utilizing a system other than the In-App Purchase API (IAP) to purchase content, functionality, or services in an App will be rejected

I think Apple would categorize a subscription as a 'service', and PayPal isn't IAP, so your app would be rejected. Use IAP.

Braintree iOS Drop-in Payment UI customization

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact [support][support].

There is no way to change text or access fields in the Drop-In UI. To have more control over the interface, the developer docs for client-side payment processing have instructions on how to tokenize payment information without the Drop-In UI.



Related Topics



Leave a reply



Submit