Mobile SDK Dev Docs

Dev Console Proposed Updates

Adding additional Mobile Checkout SDK toggle

  • The "Return URL" field does not represent what the iOS / Android SDKs use this field for. THe copy around what the Return URL field is does is misleading to developers wanting to integrate with the native SDKs
  • "Use Native Checkout SDK" should be its own top level check box
    • When selected, user can then be prompted to provide any number of their own return URL values, with copy describing that these values are used as part of the authentication handshake, and not the transaction process
    • User can also be prompted here to provide privacy policy URL, user agreement URL, and to allow us to use personal full name and email address (so these scopes can be added to their acct)

Updating Developer Console Copy

  1. Update Return URL copy
    Existing copy: Return URL- Users are redirected to this URL after live transactions. Allow up to three hours for the change to take effect.
    Suggested copy:
  2. When saving SANDBOX APP SETTINGS (full name, email, privacy policy url, and user agreement url), the "CloseApplication was saved successfully" success message appears off screen. This would be confusing for merchants when opting in.

Current Developer Console Setup

  • Set Return URL
  • Under SANDBOX APP SETTINGS
    • Check Connect with PayPal (formerly Log In with PayPal)
    • Check Full name and Email
    • Enter Privacy policy URL and User agreement URL
    • Click save
  • Grab client id

SDK Setup

Project Prerequisites

  • Android
    • API 21 or later
    • Internet permission added to manifest
  • iOS - None?

Add the SDK dependency

  • Android - build.gradle updates to add SDK dependency
  • iOS - update Carthage, CocoaPods, and SPM dependency manager sections

Set Checkout Configuration

Android Code Snippet

val config = CheckoutConfigNew(
    application = this,
    clientId = BuildConfig.SANDBOX_CLIENT_ID,
    environment = environment,
    returnUrl = RETURN_URL,
    userAction = userAction,
    currencyCode = currencyCode
)
setConfig(config)

Start Checkout

Android Code Snippet

PayPalCheckout.start(
    CreateOrder { createOrderActions ->
        val order = Order()
        createOrderActions.create(order) { orderId ->
            // Invoked when the order is created
        }
        
        OR
        
        val token = "TOKEN VALUE"
        createOrderActions.set(token)
    },
    OnApprove { approval -> 
        // Invoked when buyer complets checkout
    },
    OnCancel {
        // Invoked when buyer cancels checkout
    },
    OnError { errorInfo ->
        // Error events
    }
)

Android Updates

Pages

  • Index
    • Adding the SDK Dependency
    • Configuring the Android SDK
    • Creating a Cart
      • Checkout with Token
      • Checkout with Order
    • Invoking Checkout
      • Adding a PaymentButton
      • Starting Checkout From Custom UI
    • Customizing Payment Buttons

Checkout Config Args

Arguments Description
application Your app's application instance
clientId Client ID that links the Checkout SDK to your app in the PayPal Developer Portal
environment The environment that the SDK will run in. Use Environment.SANDBOX for testing and Environment.LIVE for production
returnUrl Return URL value that was added to your app in the PayPal Developer Portal. This should match your app's package name appended with "://paypalpay"