GithubHelp home page GithubHelp logo

isabella232 / android-sdk-4 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paypal/android-sdk

0.0 0.0 0.0 832 KB

[WIP] One merchant integration point for all of PayPal's services

Kotlin 100.00%

android-sdk-4's Introduction

Welcome to the PayPal Android SDK. This library will help you accept Card, PayPal, and Venmo payments in your Android app.

FAQ

Availability

The SDK is currently in the development process. This product is being developed fully open source - throughout the development process, we welcome any and all feedback. Aspects of the SDK will likely change as we develop the SDK. We recommend using the SDK in the sandbox environment until an official release is available. This README will be updated with an official release date once it is generally available.

Contribution

As the SDK is moved to general availability, we will be adding a contribution guide for developers that would like to contribute to the SDK. If you have suggestions for features that you would like to see in future iterations of the SDK, please feel free to open an issue, PR, or discussion with suggestions. If you want to open a PR but are unsure about our testing strategy, we are more than happy to work with you to add tests to any PRs before work is merged.

Support

The PayPal Android SDK is available for Android SDK 21+. See our Client Deprecation policy to plan for updates.

Languages

This SDK is written in Kotlin and supports both Kotlin and Java integrations. See the [Java Demo App](#TODO: link demo when created) and Kotlin Demo App for sample integrations.

Including the SDK

You can support a specific payment method by adding its corresponding feature module as a dependency in your app's build.gradle file. For example, to support both Card and PayPal payments in your app include the following:

dependencies {
  implementation 'com.paypal.android:card:1.0.0'
  implementation 'com.paypal.android:paypal:1.0.0'
}

Sample Code

// TODO: Update code snippet after finalizing integration

// STEP 0: Fetch an ACCESS_TOKEN and ORDER_ID from your server.

// STEP 1: Create a PaymentConfig object
paymentConfig = PaymentConfig(ACCESS_TOKEN)

// STEP 2: Create payment method client objects
cardClient = CardClient(paymentConfig)

// STEP 3: Collect relevant payment method details
card = Card()
card.number = "4111111111111111"
card.cvv = "123"

// STEP 4: Call checkout method
lifecycleScope.launch {
  try {
    let result = cardClient.checkoutWithCard(ORDER_ID, card)
  
    // send orderID to your server to process the payment
    val orderID = result.orderID 
  
  } catch (e: PayPalSDKError) {
    // handle checkout error
  }
}

// STEP 5: Send orderID to your server to capture/authorize

Release Process

This SDK follows Semantic Versioning. This SDK is published to Maven Central. The release process is automated via GitHub Actions.

Snapshot Builds

Snapshot builds of the latest SDK features are published from the main branch weekly. The snapshot builds can be used to test upcoming features before they have been released. To include a snapshot build:

dependencies {
  implementation 'com.paypal.android:card:1.0.0-SNAPSHOT'
}

Testing

This repository includes unit tests, integration tests, and end-to-end tests.

// TODO: Add sections with commands for running each type of tests

Static Analysis Tools

Detekt

This project uses Detekt for Kotlin code analysis. To run the code analysis:

./gradlew detekt

This will output a list of violations, if any.

Running the gradle task with the -PdetektAutoCorrect parameter, will automatically correct formatting issues:

./gradlew detekt -PdetektAutoCorrect

Detekt rules are configured in detekt/detekt-config.yml.

Jacoco

This project uses Jacoco for gathering code coverage metrics. We leverage the 3rd-party jacoco-android-gradle-plugin to integrate Jacoco into our project.

To run code coverage analysis:

./gradlew jacocoTestReport

The results are then generated in each module's respective build/jacoco folder (e.g. Card/build/jacoco).

Contributing

See our [GitHub Guidelines](#TODO: determine where this document will live and update link) for git practices followed in this project.

android-sdk-4's People

Contributors

andrespelaezp avatar gesa avatar jcnoriega avatar kate-paypal avatar sarahkoop avatar sshropshire avatar tdchow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.