Search code examples
iosbraintree

Braintree iOS drop in doesn't show PayPal


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


Solution

  • 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