PayPal Credit is a customer credit offering from PayPal. It appears as an additional button in your checkout form and offers all available financing options to customers automatically through a PayPal UI – including Easy Payments in the US and Instalments in the UK, if those have been enabled for your PayPal account.

Before you get started

  1. See our PayPal Credit support article for full details on the availability and benefits of this feature
  2. Complete your PayPal client-side integration

Integration

Offering PayPal Credit is similar to offering regular PayPal payments.

  1. Add a PayPal Credit button
  2. Tokenize using PayPal Credit
    • On the BTPayPalRequest object, set the offerCredit option to true
  3. Submit the resulting payment method nonce to your server to create a transaction

Examples

PayPal and PayPal Credit with the Vault flow

Here is an example of a Vault flow integration with both PayPal and PayPal Credit buttons:

Objective-C Swift
#import "BraintreePayPal.h"

- (void)viewDidLoad {
    [super viewDidLoad];

    self.braintreeClient = [[BTAPIClient alloc] initWithAuthorization:@"<#CLIENT_AUTHORIZATION#>"];

    //-- PayPal Button --
    UIButton *customPayPalButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 120)];
    [customPayPalButton addTarget:self
                           action:@selector(customPayPalButtonTapped:)
                 forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:customPayPalButton];

    //-- PayPal Credit Button --
    UIButton *customPayPalCreditButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 180, 60, 120)];
    UIImage *paypalCreditImage = [UIImage imageNamed:@"paypal-credit-button.png"]; //-- Use the downloaded image asset here
    [customPayPalCreditButton setImage:paypalCreditImage forState:UIControlStateNormal];
    [customPayPalCreditButton addTarget:self
                                 action:@selector(customPayPalCreditButtonTapped:)
                       forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:customPayPalCreditButton];
}

// Regular PayPal tokenization
- (IBAction)customPayPalButtonTapped:(id)sender {
    // Start the Vault flow
    BTPayPalRequest *request = [[BTPayPalRequest alloc] init];

    [self startPayPal:request];
}

// PayPal Credit tokenization
- (IBAction)customPayPalCreditButtonTapped:(id)sender {
    // Start the Vault flow
    BTPayPalRequest *request = [[BTPayPalRequest alloc] init];

    request.offerCredit = YES; // Offer PayPal Credit

    [self startPayPal:request];
}

- (void)startPayPal:(BTPayPalRequest *)paypalRequest {
    BTPayPalDriver *paypalDriver = [[BTPayPalDriver alloc] initWithAPIClient:self.braintreeClient];
    paypalDriver.viewControllerPresentingDelegate = self;
    paypalDriver.appSwitchDelegate = self; // Optional

    [paypalDriver requestBillingAgreement:request
                            completion:^(BTPayPalAccountNonce *tokenizedPayPalAccount, NSError *error) {
        ...
    }];
}

PayPal and PayPal Credit with the Checkout flow

Here is an example of a Checkout flow integration with both PayPal and PayPal Credit buttons:

Objective-C Swift
#import "BraintreePayPal.h"

- (void)viewDidLoad {
    [super viewDidLoad];

    self.braintreeClient = [[BTAPIClient alloc] initWithAuthorization:@"<#CLIENT_AUTHORIZATION#>"];

    //-- PayPal Button --
    UIButton *customPayPalButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 120)];
    [customPayPalButton addTarget:self
                           action:@selector(customPayPalButtonTapped:)
                 forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:customPayPalButton];

    //-- PayPal Credit Button --
    UIButton *customPayPalCreditButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 180, 60, 120)];
    UIImage *paypalCreditImage = [UIImage imageNamed:@"paypal-credit-button.png"]; //-- Use the downloaded image asset here
    [customPayPalCreditButton setImage:paypalCreditImage forState:UIControlStateNormal];
    [customPayPalCreditButton addTarget:self
                                 action:@selector(customPayPalCreditButtonTapped:)
                       forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:customPayPalCreditButton];
}

// Regular PayPal tokenization
- (IBAction)customPayPalButtonTapped:(id)sender {
    // Start the Checkout flow
    BTPayPalRequest *request = [[BTPayPalRequest alloc] initWithAmount:@"10.00"];

    [self startPayPalCheckout:request];
}

// PayPal Credit tokenization
- (IBAction)customPayPalCreditButtonTapped:(id)sender {
    // Start the Checkout flow
    BTPayPalRequest *request = [[BTPayPalRequest alloc] initWithAmount:@"10.00"];

    request.offerCredit = YES; // Offer PayPal Credit

    [self startPayPalCheckout:request];
}

- (void)startPayPalCheckout:(BTPayPalRequest *)paypalRequest {
    BTPayPalDriver *paypalDriver = [[BTPayPalDriver alloc] initWithAPIClient:self.braintreeClient];
    paypalDriver.viewControllerPresentingDelegate = self;
    paypalDriver.appSwitchDelegate = self; // Optional

    [paypalDriver requestOneTimePayment:request
                            completion:^(BTPayPalAccountNonce *tokenizedPayPalAccount, NSError *error) {
        ...
    }];
}

See also

Next: Server-side →

Still have questions?

If you can’t find an answer, contact our Support team.