diff --git a/README.md b/README.md index ffef0a16a..8e78611f3 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ 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. -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. +Opn Payments Android SDK provides Android bindings for the Opn Payments [Token](https://docs.opn.ooo/tokens-api) +and [Source](https://docs.opn.ooo/sources-api) API, as well as components for entering credit card information. ## Requirements @@ -19,7 +19,7 @@ and [Source](https://www.omise.co/sources-api) API as well as components for ent ## Merchant Compliance **Card data should never transit through your server. We recommend that you follow our guide on how to safely -[collect credit information](https://www.omise.co/collecting-card-information).** +[collect credit information](https://docs.opn.ooo/collecting-card-information).** To be authorized to create tokens server-side you must have a currently valid PCI-DSS Attestation of Compliance (AoC) delivered by a certified QSA Auditor. @@ -43,7 +43,7 @@ implementation 'co.omise:omise-android:4.+' The simplest way to use this SDK is to integrate the provided `CreditCardActivity` directly into your application. This activity contains a pre-made credit form and will automatically [tokenize credit card -information](https://www.omise.co/security-best-practices) for you. +information](https://docs.opn.ooo/security-best-practices) for you. To use it, first declare the availability of the activity in your `AndroidManifest.xml` file as follows: @@ -70,7 +70,7 @@ private fun showCreditCardForm() { 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: +callback will be called, handle it as follows: ```kotlin override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { @@ -91,16 +91,16 @@ A number of results are returned from the activity. You can obtain them from the 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. + 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 Opn Payments API. * `data.getParcelableExtra(OmiseActivity.EXTRA_CARD_OBJECT)` - The `Card` object - which is part of the `Token` object returned from the Opn Payments API. + that is part of the `Token` object returned from the Opn Payments API. ### Custom Credit Card Form If you need to build your own credit card form, components inside `CreditCardActivity` -can be used on their own. For example, the `CreditCardEditText` can be used in XML in this way: +can be used on their own. For example, the `CreditCardEditText` can be used in XML as demonstrated: ```xml { @@ -209,7 +209,7 @@ Replace the string `pkey_test_123` with the public key obtained from your Opn Pa 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. -There are 2 options to retrieve the Capability object. +There are two options to retrieve the Capability object. 1. You can retrieve the Capability object from your account's capabilities through the [Capability](#retrieve-capabilities). @@ -226,7 +226,7 @@ There are 2 options to retrieve the Capability object. > **Note** > Ensure you are adding payment methods supported by the account. - > If not, you won't be able to create a source to continue the payment process.. + > If not, you won't be able to create a source to continue the payment process. After the end user selects and creates a payment source, the activity result callback will be called; handle it as follows: @@ -257,7 +257,7 @@ Two different results that could be returned are: ### Google Pay activity -We support GooglePay as a tokenization method in our payment gateway. This activity contains a pre-made `Pay with Google Pay` button and will automatically [tokenize the Google Pay token](https://www.omise.co/security-best-practices) for you. +We support GooglePay as a tokenization method in our payment gateway. This activity contains a pre-made `Pay with Google Pay` button and will automatically [tokenize the Google Pay token](https://docs.opn.ooo/security-best-practices) for you. To use it, first declare the availability of the activity in your `AndroidManifest.xml` file as follows: @@ -298,7 +298,7 @@ override fun navigateToGooglePayForm() { - 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. +- Replace the `cardBrands` with the list from our [capability api](https://docs.opn.ooo/capability-api) or leave blank to use default values. - Replace the `googlepayMerchantId` with your [Google Pay merchant ID](https://developers.google.com/pay/api/web/guides/setup) (not needed in test mode). - Set the `googlepayRequestBillingAddress` to `true` if you want to attach the cardholder's name and billing address to the token. - When the cardholder's billing address is requested, set the `googlepayRequestPhoneNumber` to `true` to also attach the cardholder's phone number to the token. @@ -313,19 +313,19 @@ resulting `Intent` with the following code: * `data.getParcelableExtra(OmiseActivity.EXTRA_TOKEN_OBJECT)` - The full `Token` 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 Opn Payments API. + that is part of the `Token` object returned from the Opn Payments API. #### Use your own activity You can use your own activity if you prefer to. We recommend that you follow [Google's tutorial and guidelines](https://developers.google.com/pay/api/android/overview) and make sure that you follow their [brand guidelines](https://developers.google.com/pay/api/android/guides/brand-guidelines) as well. -You can make use of our Google Pay request builder `request/GooglePay.kt`, which will include request builders you can use to request the Google Pay token. +You can make use of our Google Pay request builder `request/GooglePay.kt`, which includes request builders that you can use to request the Google Pay token. Configurations to the builders are modifiable through the class' constructor to suit your needs. However, you are also welcome to make your own integration and call our tokens builder yourself. ### Creating a source -If you need to create a payment source on your own and use it outside of the provided SDK context, you can do follow these steps. First build the Client and supply your public key in this manner: +If you need to create a payment source on your own and use it outside the provided SDK context, follow these steps. First build the Client and supply your public key in this manner: ```kotlin private val client = Client("pkey_test_123") @@ -358,7 +358,7 @@ client.send(request, object : RequestListener{ }) ``` -The `Client` class will automatically dispatch the network call on an internal background thread and will call listener methods on the thread that initially calls the send method. +The `Client` class will automatically dispatch the network call on an internal background thread, and will call listener methods on the thread that initially calls the send method. ### Retrieve Capabilities You can retrieve all of your capabilities and available payment sources through the SDK in the following manner. @@ -375,7 +375,7 @@ Then construct the Capability request: val request = Capability.GetCapabilitiesRequestBuilder().build() ``` -And then send the request using the client we constructed earlier: +And then send the request using the client that you constructed earlier: ```kotlin client.send(request, object : RequestListener { @@ -389,7 +389,7 @@ client.send(request, object : RequestListener { }) ``` -The `Client` class will automatically dispatch the network call on an internal background thread and will call listener methods on the thread that initially calls the send method. +The `Client` class will automatically dispatch the network call on an internal background thread, and will call listener methods on the thread that initially calls the send method. ### Theme customization If you wish to customize the elements on the `CreditCardActivity` in order to @@ -458,7 +458,7 @@ 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. Opn Payments 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://docs.opn.ooo/fraud-protection#3-d-secure), [Internet Banking payment](https://docs.opn.ooo/internet-banking), [Alipay](https://docs.opn.ooo/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. @@ -474,7 +474,7 @@ file as follows: android:theme="@style/OmiseTheme" /> ``` -Then in your activity, declare the method that will start this activity this way: +Then in your activity, declare the method that will start this activity as follows: ```kotlin private fun showAuthorizingPaymentForm() { @@ -488,7 +488,7 @@ private fun showAuthorizingPaymentForm() { Replace the string `AUTHORIZED_URL` with the authorized URL that comes with the created charge and the array of string `EXPECTED_URL_PATTERNS` with the expected pattern of redirected URLs array. After the end-user completes the authorizing payment process, the activity result -callback will be called, handle it in this manner: +callback will be called. Handle it in this manner: ```kotlin override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { @@ -502,7 +502,7 @@ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) ### Authorizing Payment via an external app -Some request methods allow the user to authorize the payment with an external app, for example Alipay. When a user would like to authorize the payment with an external app, `AuthorizingPaymentActivity` will automatically open an external app. However merchant developers must handle the `Intent` callback by themselves. +Some request methods allow the user to authorize the payment with an external app, for example Alipay. When a user needs to authorize the payment with an external app, `AuthorizingPaymentActivity` will automatically open an external app. However merchant developers must handle the `Intent` callback by themselves. ### 3D Secure 2 @@ -510,7 +510,7 @@ To support 3D Secure 2, you can check out the [3D Secure guide](docs/3d-secure-v ## ProGuard Rules -If you enable ProGuard, then add this rules in your ProGuard file. +If you enable ProGuard, then add these rules in your ProGuard file. ```ProGuard -dontwarn okio.**