-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a515a4c
commit 93c33bd
Showing
1 changed file
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# Omise Android SDK | ||
# Opn Payments Android SDK | ||
|
||
[![](https://img.shields.io/maven-central/v/co.omise/omise-android.svg?style=flat-square)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22co.omise%22%20AND%20a%3A%22omise-android%22) | ||
[![](https://img.shields.io/badge/email-support-yellow.svg?style=flat-square)](mailto:[email protected]) | ||
[![Android CI](https://github.com/omise/omise-android/workflows/Android%20CI/badge.svg)](https://github.com/omise/omise-android/actions) | ||
|
||
Omise is a payment service provider currently operating in Thailand. Omise provides a set of clean APIs | ||
Opn Payments is a payment service provider currently operating in Thailand. Opn Payments provides a set of clean APIs | ||
that help merchants of any size accept credit cards online. | ||
|
||
Omise Android SDK provides Android bindings for the Omise [Token](https://www.omise.co/tokens-api) | ||
Opn Payments Android SDK provides Android bindings for the Opn Payments [Token](https://www.omise.co/tokens-api) | ||
and [Source](https://www.omise.co/sources-api) API as well as components for entering credit card information. | ||
|
||
## Requirements | ||
|
||
* Public key. [Register for an Omise account](https://dashboard.omise.co/signup) to obtain your API keys. | ||
* Public key. [Register for an Opn Payments account](https://dashboard.omise.co/signup) to obtain your API keys. | ||
* Android 5.0+ (API 21) target or higher. | ||
* Android Studio and Gradle build system. | ||
|
||
|
@@ -29,7 +29,7 @@ having to go through your server. | |
|
||
## Installation | ||
|
||
Add the following line to your project's build.gradle file inside the `dependencies` | ||
Add the following line to your project's `build.gradle` file inside the `dependencies` | ||
block: | ||
|
||
```gradle | ||
|
@@ -67,7 +67,7 @@ private fun showCreditCardForm() { | |
} | ||
``` | ||
|
||
Replace the string `pkey_test_123` with the public key obtained from your Omise dashboard. | ||
Replace the string `pkey_test_123` with the public key obtained from your Opn Payments dashboard. | ||
|
||
After the end-user completes entering credit card information, the activity result | ||
callback will be called, handle it like so: | ||
|
@@ -93,9 +93,9 @@ resulting `Intent` with the following code: | |
* `data.getStringExtra(OmiseActivity.EXTRA_TOKEN)` - The string ID of the token. Use | ||
this if you only needs the ID and not the card data. | ||
* `data.getParcelableExtra(OmiseActivity.EXTRA_TOKEN_OBJECT)` - The full `Token` | ||
object returned from the Omise API. | ||
object returned from the Opn Payments API. | ||
* `data.getParcelableExtra(OmiseActivity.EXTRA_CARD_OBJECT)` - The `Card` object | ||
which is part of the `Token` object returned from the Omise API. | ||
which is part of the `Token` object returned from the Opn Payments API. | ||
|
||
### Custom Credit Card Form | ||
|
||
|
@@ -175,10 +175,10 @@ thread and will call listener methods on the thread that initially calls the `se | |
method. | ||
|
||
### Payment Creator activity | ||
Another way to use the Omise Android SDK is to integrate the `PaymentCreatorActivity` | ||
Another way to use the Opn Payments Android SDK is to integrate the `PaymentCreatorActivity` | ||
to allow users to create a payment source from the list of sources available for the account. | ||
|
||
To use it, first declare the availability of the activity in your AndroidManifest.xml file as follows: | ||
To use it, first declare the availability of the activity in your `AndroidManifest.xml` file as follows: | ||
|
||
```xml | ||
<activity | ||
|
@@ -205,7 +205,7 @@ private fun showPaymentCreatorActivity() { | |
} | ||
``` | ||
|
||
Replace the string `pkey_test_123` with the public key obtained from your Omise dashboard. | ||
Replace the string `pkey_test_123` with the public key obtained from your Opn Payments dashboard. | ||
|
||
Declare a `capability` variable as a `Capability` object and pass it as the value for the `OmiseActivity.EXTRA_CAPABILITY` key for your `Intent`. This way, the `PaymentCreatorActivity` will display the payment methods contained in the `Capability` object. | ||
|
||
|
@@ -295,7 +295,7 @@ override fun navigateToGooglePayForm() { | |
} | ||
``` | ||
- Replace the `OMISE_PKEY` with your Omise public key obtained from our dashboard. | ||
- Replace the `OMISE_PKEY` with your Opn Payments public key obtained from our dashboard. | ||
- Replace the `amount` with the amount you want to charge with, in subunits. | ||
- Replace the `currency` with your currency in the ISO 4217 format. | ||
- Replace the `cardBrands` with the list from our [capability api](https://www.omise.co/capability-api) or leave blank to use default values. | ||
|
@@ -311,9 +311,9 @@ resulting `Intent` with the following code: | |
* `data.getStringExtra(OmiseActivity.EXTRA_TOKEN)` - The string ID of the token. Use | ||
this if you only need the ID and not the card data. | ||
* `data.getParcelableExtra(OmiseActivity.EXTRA_TOKEN_OBJECT)` - The full `Token` | ||
object returned from the Omise API. | ||
object returned from the Opn Payments API. | ||
* `data.getParcelableExtra(OmiseActivity.EXTRA_CARD_OBJECT)` - The `Card` object | ||
which is part of the `Token` object returned from the Omise API. | ||
which is part of the `Token` object returned from the Opn Payments API. | ||
|
||
#### Use your own activity | ||
|
||
|
@@ -458,7 +458,9 @@ style.xml | |
``` | ||
## Authorizing Payment | ||
Some payment methods require the customer to authorize the payment via an authorization URL. This includes the [3-D Secure verification](https://www.omise.co/fraud-protection#3-d-secure), [Internet Banking payment](https://www.omise.co/offsite-payment), [Alipay](https://www.omise.co/alipay), etc. Omise Android SDK provides a built in class to handle the authorization. | ||
Some payment methods require the customer to authorize the payment via an authorization URL. This includes the [3-D Secure verification](https://www.omise.co/fraud-protection#3-d-secure), [Internet Banking payment](https://www.omise.co/offsite-payment), [Alipay](https://www.omise.co/alipay), etc. Opn Payments Android SDK provides a built in class to handle the authorization. | ||
On payment methods that require opening the external app (e.g. mobile banking app) to authorize the transaction, set the *return_uri* to a **deeplink** or **applink** to be able to open the merchant app. Else, after the card holder completes authorizing the transaction on the external app, the flow redirects to the normal link in the *return_uri* and opens it on the browser app, and therefore results in the payment not being completed. | ||
### Authorizing Payment activity | ||
|