v.zero A 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
1. The server inits the transaction 
client_token = braintree.ClientToken.generate({ }) 
Unique Client Token for each transaction 
generated at Server…
2. The Braintree UI continues 
the transaction 
Braintree *braintree = [Braintree 
braintreeWithClientToken:self.clientToken]; 
[…] 
BTDropInViewController *dropInViewController = [braintree 
dropInViewControllerWithDelegate:self]; 
With Client Token the secure UI is created 
on mobile application
3. The server finishes 
the payment 
result = braintree.Transaction.sale({ 
"amount": "10.00", 
"payment_method_nonce": "nonce-from-the-client" 
}) 
With a nonce, gotten from UI and 
sent to server
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"]];
@albertuslm Source 
photo
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"]];
@albertuslm Source 
photo 
AGAIN!
OK, but how is 
the backside? 
Let’s 
go!
Conclusions 
@albertuslm
Source 
+ = 
Source
Great 
User Experience
Really 
Safe & Simple
True 
Native
TRULY 
Global
Original 
Source 
S 
@albertuslm
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…
Questions? 
Source 
photo
v.zero 
Alberto López (@albertusLM) 
alberto.lopez@braintreepayments.com

Braintree and our new v.zero SDK for iOS