77
v.zero A modern foundation for accepting Payments Alberto López (@albertusLM)

Braintree and our new v.zero SDK for iOS

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Braintree and our new v.zero SDK for iOS

v.zeroA modern foundation for accepting Payments

Alberto López (@albertusLM)

Page 2: Braintree and our new v.zero SDK for iOS

Developing a mobile application

@albertuslm

Page 3: Braintree and our new v.zero SDK for iOS
Page 4: Braintree and our new v.zero SDK for iOS

style guide defined

Page 5: Braintree and our new v.zero SDK for iOS

Own code

Page 6: Braintree and our new v.zero SDK for iOS

Known libraries

Page 7: Braintree and our new v.zero SDK for iOS

Adding a payment method

@albertuslm

Page 8: Braintree and our new v.zero SDK for iOS
Page 9: Braintree and our new v.zero SDK for iOS
Page 10: Braintree and our new v.zero SDK for iOS

useless lines of code

Page 11: Braintree and our new v.zero SDK for iOS
Page 12: Braintree and our new v.zero SDK for iOS

old documentation

Page 13: Braintree and our new v.zero SDK for iOS
Page 14: Braintree and our new v.zero SDK for iOS

no examples

Page 15: Braintree and our new v.zero SDK for iOS
Page 16: Braintree and our new v.zero SDK for iOS

insecurity

Page 17: Braintree and our new v.zero SDK for iOS
Page 18: Braintree and our new v.zero SDK for iOS

No Native code

Page 19: Braintree and our new v.zero SDK for iOS
Page 20: Braintree and our new v.zero SDK for iOS

Not global

Page 21: Braintree and our new v.zero SDK for iOS
Page 22: Braintree and our new v.zero SDK for iOS

I only want to integrate

a payment method…

Page 23: Braintree and our new v.zero SDK for iOS

HELP

@albertuslm

Page 24: Braintree and our new v.zero SDK for iOS
Page 25: Braintree and our new v.zero SDK for iOS

A little bit of history

@albertuslm

Page 26: Braintree and our new v.zero SDK for iOS

2013

Page 27: Braintree and our new v.zero SDK for iOS

Features

@albertuslm

Page 28: Braintree and our new v.zero SDK for iOS

photo  source

Page 29: Braintree and our new v.zero SDK for iOS

++

Payments in one click

=

Page 30: Braintree and our new v.zero SDK for iOS

User Experience

Page 31: Braintree and our new v.zero SDK for iOS

Ultra slim

Invisible

Elegant

Page 32: Braintree and our new v.zero SDK for iOS

Safe & Simple

Page 33: Braintree and our new v.zero SDK for iOS

Mobile, born and raise

Page 34: Braintree and our new v.zero SDK for iOS

Native

Page 35: Braintree and our new v.zero SDK for iOS

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

Page 36: Braintree and our new v.zero SDK for iOS

Global

Page 37: Braintree and our new v.zero SDK for iOS

Talking about security…

@albertuslm

Page 38: Braintree and our new v.zero SDK for iOS

Unique Client Token for each transaction

generated at Server…

client_token = braintree.ClientToken.generate({ })

1. The server inits the transaction

Page 39: Braintree and our new v.zero SDK for iOS

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

Page 40: Braintree and our new v.zero SDK for iOS

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

Page 41: Braintree and our new v.zero SDK for iOS

It is Safe!

@albertuslm

Page 42: Braintree and our new v.zero SDK for iOS

How can it be implemented?

@albertuslm

Page 43: Braintree and our new v.zero SDK for iOS

Client Side

Page 44: Braintree and our new v.zero SDK for iOS

Server Side

Page 45: Braintree and our new v.zero SDK for iOS

And what do you do with BT?

@albertuslm

Page 46: Braintree and our new v.zero SDK for iOS

Types of payments

Simple payments Subscriptions Marketplaces Partnerships

Page 47: Braintree and our new v.zero SDK for iOS

Simple payments…

Common payment Payment from vault

Page 48: Braintree and our new v.zero SDK for iOS

How simple payments work?

@albertuslm

Page 49: Braintree and our new v.zero SDK for iOS

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

Page 50: Braintree and our new v.zero SDK for iOS

client_token = braintree.ClientToken.generate({})

Page 51: Braintree and our new v.zero SDK for iOS

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

Page 52: Braintree and our new v.zero SDK for iOS

Click!

(IBAction)tappedButton:(id)sender

Page 53: Braintree and our new v.zero SDK for iOS

- (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]; }

Page 54: Braintree and our new v.zero SDK for iOS

Click!

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

Page 55: Braintree and our new v.zero SDK for iOS

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

Page 56: Braintree and our new v.zero SDK for iOS

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

Page 57: Braintree and our new v.zero SDK for iOS

Source  photo@albertuslm

Page 58: Braintree and our new v.zero SDK for iOS

How payments from vault work?

@albertuslm

Page 59: Braintree and our new v.zero SDK for iOS

Click!

(IBAction)tappedButton:(id)sender

Page 60: Braintree and our new v.zero SDK for iOS

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

Page 61: Braintree and our new v.zero SDK for iOS

<looking for a ClientID related to clientHASH>

Page 62: Braintree and our new v.zero SDK for iOS

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

Page 63: Braintree and our new v.zero SDK for iOS

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

Page 64: Braintree and our new v.zero SDK for iOS

Source  photo@albertuslm

AGAIN!

Page 65: Braintree and our new v.zero SDK for iOS

OK, but how is the backside?

Let’s  go!

Page 66: Braintree and our new v.zero SDK for iOS

Conclusions

@albertuslm

Page 68: Braintree and our new v.zero SDK for iOS

User ExperienceGreat

Page 69: Braintree and our new v.zero SDK for iOS

Safe & SimpleReally

Page 70: Braintree and our new v.zero SDK for iOS

NativeTrue

Page 71: Braintree and our new v.zero SDK for iOS

GlobalTRULY

Page 73: Braintree and our new v.zero SDK for iOS

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

Page 74: Braintree and our new v.zero SDK for iOS

The end?

Page 75: Braintree and our new v.zero SDK for iOS

photo  source

Stay tuned…

Page 77: Braintree and our new v.zero SDK for iOS

v.zero Alberto López (@albertusLM)

[email protected]