Code Monkey home page Code Monkey logo

braintreecodenameone's Introduction

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 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:

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
        }
    });

braintreecodenameone's People

Stargazers

 avatar

Watchers

 avatar  avatar

braintreecodenameone's Issues

How to add params to iOS native code?

Hi,

Thank you for making this library.

I was wondering if you could please guide me as to how to add extra parameters to the iOS native code; specifically adding a double and a boolean?

Right now I am attempting to build the project with this method signature but the build crashes during compilation:

-(void)showChargeUI:(NSString*)param val:(double)val before:(BOOL)before{ }

Can you please advise? I already modified the method that extends the NativeInterface in the main CN1 code, the .h class and the Android class. I have looked online for how to set up the method signature but am still having getting a build error so I realize something is wrong with my syntax. It would also be helpful to be able to add other params to the method in case of customizing the Drop-In Request.

Thank you again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.