Skip to content

Commit

Permalink
Add screenshots of badge and button to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Rypac committed Aug 14, 2020
1 parent 0ca7d3f commit ca0d5f0
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ The Afterpay Android SDK makes it quick and easy to provide an excellent payment
- [Getting Started](#getting-started)
- [Configurating the SDK](#configuring-the-sdk)
- [Launching the Checkout](launching-the-checkout)
- [UI Components](#ui-components)
- [Badge](#badge)
- [Pay Now Button](#pay-now-button)
- [Price Breakdown](#price-breakdown)
- [Security](#security)
- [Examples](#examples)
- [Contributing](#contributing)
Expand Down Expand Up @@ -103,6 +107,49 @@ class ExampleActivity: Activity {
}
```

## UI Components

### Badge

![Black on Mint badge][badge-black-on-mint] ![Mint on Black badge][badge-mint-on-black] ![White on Black badge][badge-white-on-black] ![Black on White badge][badge-black-on-white]

### Pay Now Button

![Black on Mint pay now button][button-black-on-mint]
![Mint on Black pay now button][button-mint-on-black]
![White on Black pay now button][button-white-on-black]

### Price Breakdown

The price breakdown component displays information about Afterpay instalments and handles a number of common configurations.

A total payment amount (represented as a `BigDecimal`) must be programatically set on the component to display Afterpay instalment information.

```kotlin
val totalAmount: BigDecimal = getTotalAmount()

val paymentBreakdown = view.findViewById<AfterpayPriceBreakdown>(R.id.priceBreakdown)
paymentBreakdown.totalAmount = totalAmount
```

When the breakdown component is assigned a total amount that is valid for the merchant account, the 4 instalment amounts will be displayed.

![Price breakdown Afterpay instalments are available][breakdown-available]

When the total amount is not within the minimum and maximum payment values for the merchant account, the amounts available for Afterpay will be shown in the component.

![Price breakdown Afterpay instalments are unavailable][breakdown-unavailable-min-max]

When no minimum amount is set and the total amount is greater than the maximum payment values for the merchant account, the maximum amount available for Afterpay will be shown in the component.

![Price breakdown Afterpay instalments are unavailable][breakdown-unavailable-max]

When no payment amount has been set or the merchant account configuration has not been applied to the SDK, the component will default to a message stating Afterpay is available.

![Price breakdown no merchant account configuration][breakdown-no-configuration]

The **Info** link at the end of the component will display a window containing more information about Afterpay for the user.

## Security

To limit the possibility of a man-in-the-middle attack during the checkout process, certificate pinning can be configured for the Afterpay portal. Please refer to the Android [Network Security Configuration][network-config] documentation for more information.
Expand Down Expand Up @@ -138,6 +185,17 @@ This project is licensed under the terms of the Apache 2.0 license. See the [LIC
<!-- Links: -->
[badge-ci]: https://github.com/afterpay/sdk-android/workflows/Build%20and%20Test/badge.svg?branch=master&event=push
[badge-ktlint]: https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg
[badge-black-on-mint]: images/badge_black_on_mint.png
[badge-mint-on-black]: images/badge_mint_on_black.png
[badge-white-on-black]: images/badge_white_on_black.png
[badge-black-on-white]: images/badge_black_on_white.png
[breakdown-available]: images/price_breakdown_available.png
[breakdown-no-configuration]: images/price_breakdown_no_configuration.png
[breakdown-unavailable-min-max]: images/price_breakdown_unavailable_min_max.png
[breakdown-unavailable-max]: images/price_breakdown_unavailable_max.png
[button-black-on-mint]: images/button_black_on_mint.png
[button-mint-on-black]: images/button_mint_on_black.png
[button-white-on-black]: images/button_white_on_black.png
[contributing]: CONTRIBUTING.md
[docs-configuration]: https://github.com/afterpay/sdk-android/blob/master/afterpay/src/main/kotlin/com/afterpay/android/Afterpay.kt#L65
[example]: example
Expand Down
Binary file added images/badge_black_on_mint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/badge_black_on_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/badge_mint_on_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/badge_white_on_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/button_black_on_mint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/button_mint_on_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/button_white_on_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/price_breakdown_available.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/price_breakdown_no_configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/price_breakdown_unavailable_max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/price_breakdown_unavailable_min_max.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca0d5f0

Please sign in to comment.