Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Braintree iOS drop in doesn't show PayPal

Tags:

ios

braintree

I am trying trying to use the Braintree Dropin UI in my iOS app.

I am testing in the sandbox, and it works fine, but only accepts cards - not PayPal?

I am just using the provided code for objective C.

The docs say Add the Drop-in UI with a few lines of code to get a full-featured checkout with credit card and PayPal payments. - but where is my PayPal button??

- (void)showDropIn:(NSString *)clientTokenOrTokenizationKey {
BTDropInRequest *request = [[BTDropInRequest alloc] init];
BTDropInController *dropIn = [[BTDropInController alloc] initWithAuthorization:clientTokenOrTokenizationKey request:request handler:^(BTDropInController * _Nonnull controller, BTDropInResult * _Nullable result, NSError * _Nullable error) {

    if (error != nil) {
        NSLog(@"ERROR");
    } else if (result.cancelled) {
        NSLog(@"CANCELLED");
    } else {
        // Use the BTDropInResult properties to update your UI
        // result.paymentOptionType
        // result.paymentMethod
        // result.paymentIcon
        // result.paymentDescription
    }
}];
[self presentViewController:dropIn animated:YES completion:nil];
}

iOS Screenshot (o

like image 213
markt Avatar asked Dec 19 '22 08:12

markt


1 Answers

As the developers page says:

By default, Drop-in only ships with support for cards. You can include additional payment methods by adding their respective pods.

You must add these options:

    Ruby
pod 'Braintree/PayPal'
pod 'Braintree/Venmo'
pod 'Braintree/Apple-Pay'
pod 'Braintree/3D-Secure'

https://developers.braintreepayments.com/guides/drop-in/ios/v4#pods

like image 174
Aitor Pagán Avatar answered Jan 07 '23 13:01

Aitor Pagán