Braintree and our new v.zero SDK for iOS

Post on 11-Jun-2015

396 views 5 download

Tags:

description

Discover what is Braintree, how we work and our new v.zero SDK for iOS. Presentation made for Pragma Mark 2014 - Milan (Italy)

Transcript of Braintree and our new v.zero SDK for iOS

v.zeroA modern foundation for accepting Payments

Alberto López (@albertusLM)

Developing a mobile application

@albertuslm

style guide defined

Own code

Known libraries

Adding a payment method

@albertuslm

useless lines of code

old documentation

no examples

insecurity

No Native code

Not global

I only want to integrate

a payment method…

HELP

@albertuslm

A little bit of history

@albertuslm

2013

Features

@albertuslm

photo  source

++

Payments in one click

=

User Experience

Ultra slim

Invisible

Elegant

Safe & Simple

Mobile, born and raise

Native

148 millions of customers No redirection within application Tons of available payment sources

Global

Talking about security…

@albertuslm

Unique Client Token for each transaction

generated at Server…

client_token = braintree.ClientToken.generate({ })

1. The server inits the transaction

With Client Token the secure UI is created on mobile application

Braintree *braintree = [Braintree braintreeWithClientToken:self.clientToken];

[…]

BTDropInViewController *dropInViewController = [braintree dropInViewControllerWithDelegate:self];

2. The Braintree UI continues the transaction

With a nonce, gotten from UI and sent to server

result = braintree.Transaction.sale({ "amount": "10.00", "payment_method_nonce": "nonce-from-the-client" })

3. The server finishes the payment

It is Safe!

@albertuslm

How can it be implemented?

@albertuslm

Client Side

Server Side

And what do you do with BT?

@albertuslm

Types of payments

Simple payments Subscriptions Marketplaces Partnerships

Simple payments…

Common payment Payment from vault

How simple payments work?

@albertuslm

- (void)viewDidLoad { […] NAFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; [manager POST:@“http://url_for_getting_token” parameters: nil success: ^(AFHTTPRequestOperation *operation, id responseObject) […]

client_token = braintree.ClientToken.generate({})

[…] NSString *clientToken = [[NSString alloc] initWithString:responseObject[@"client_token"]]; self.braintree = [Braintree braintreeWithClientToken:clientToken]; […] }

Click!

(IBAction)tappedButton:(id)sender

- (IBAction)tappedButton:(id)sender { BTDropInViewController *dropInViewController = [self.braintree dropInViewControllerWithDelegate:self]; dropInViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(userDidCancelPayment)]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:dropInViewController]; [self presentViewController:navigationController animated:YES completion:nil]; }

Click!

(void)dropInViewController: (__unused BTDropInViewController *)viewController didSucceedWithPaymentMethod: (BTPaymentMethod *)paymentMethod

nonce = request.form[“payment_method_nonce”] […] result = braintree.Transaction.sale({ "amount": "10.00", "payment_method_nonce":"nonce-from-the-client" })

NSString *transactionID = [[NSString alloc] initWithString:responseObject[@"transaction_id"]];

Source  photo@albertuslm

How payments from vault work?

@albertuslm

Click!

(IBAction)tappedButton:(id)sender

[…] NAFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; [manager POST:@“http://url_for_getting_token” parameters: @"clientHASH": <theclientHASH> success: ^(AFHTTPRequestOperation *operation, id responseObject) […]

<looking for a ClientID related to clientHASH>

result = braintree.Transaction.sale({ "amount": "10.00", "clientID":"client-from-the-DB" })

NSString *transactionID = [[NSString alloc] initWithString:responseObject[@"transaction_id"]];

Source  photo@albertuslm

AGAIN!

OK, but how is the backside?

Let’s  go!

Conclusions

@albertuslm

User ExperienceGreat

Safe & SimpleReally

NativeTrue

GlobalTRULY

Braintree: https://www.braintreepayments.com/ Get Started with Braintree https://developers.braintreepayments.com/ios+php/start/overview One TouchTM overview: https://developers.braintreepayments.com/ios+php/guides/one-touch Braintree v.zero: https://www.braintreepayments.com/v.zero Sandbox environment: https://sandbox.braintreegateway.com/login

The end?

photo  source

Stay tuned…

v.zero Alberto López (@albertusLM)

alberto.lopez@braintreepayments.com