https://github.com/codenameone/braintreecodenameone
Braintree (paypal mobile) API bindings for Codename One
https://github.com/codenameone/braintreecodenameone
braintree braintree-sdk codenameone payment payment-integration
Last synced: 10 months ago
JSON representation
Braintree (paypal mobile) API bindings for Codename One
- Host: GitHub
- URL: https://github.com/codenameone/braintreecodenameone
- Owner: codenameone
- Created: 2017-05-01T07:48:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-06T05:46:02.000Z (over 5 years ago)
- Last Synced: 2025-04-30T10:49:59.208Z (10 months ago)
- Topics: braintree, braintree-sdk, codenameone, payment, payment-integration
- Language: Java
- Homepage: https://www.codenameone.com/
- Size: 89.8 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Braintree CodenameOne
Integrates the Braintree SDK's for iOS/Android. There is also a somewhat broken fallback implementation based on the JavaScript API. This SDK assumes you integrated braintree in the server and have a server side API to facilitate the payment processing.
Check out the [Braintree's docs](https://developers.braintreepayments.com/start/overview) to understand how this integrates with the server side which does most of the heavy lifting within this API.
The API for Braintree on the client includes one method: `Purchase.startOrder()` where a callback interface is passed to provide:
````java
Purchase.startOrder(new Purchase.Callback() {
public String fetchToken() {
// this method needs to return the token from the Brain tree server API.
// You need to use this code to connect to your server or return the data
// from a previous connection that fetched the token
}
public void onPurchaseSuccess(String nonce) {
// this is a callback that will be invoked when the purchase succeeds
}
public void onPurchaseFail(String errorMessage) {
// this is a callback that will be invoked when the purchase fails
}
public void onPurchaseCancel() {
// this is a callback that will be invoked when the purchase is canceled
}
});
````