Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildManager-Nets committed Feb 2, 2021
1 parent 3ad510a commit 9470bec
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 21 deletions.
4 changes: 2 additions & 2 deletions MiaSample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ android {
compileSdkVersion 28
defaultConfig {
applicationId "eu.nets.mia.sample"
minSdkVersion 22
minSdkVersion 21
targetSdkVersion 28
versionCode Integer.parseInt(VERSION_CODE)
versionName VERSION_NAME
Expand Down Expand Up @@ -60,7 +60,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'org.nanohttpd:nanohttpd:2.3.1'

implementation('eu.nets.mia:mia-sdk:1.2.0@aar') { transitive = true; changing=true; }
implementation('eu.nets.mia:mia-sdk:1.2.1@aar') { transitive = true; changing=true; }
}

apply plugin: 'com.google.gms.google-services'
19 changes: 9 additions & 10 deletions MiaSample/app/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#Tue Dec 18 16:17:08 EET 2018
VERSION_NAME=1.2.0
VERSION_CODE=22
TEST_SECRET_KEY = "YOUR TEST SECRET KEY HERE"
#Tue Jun 02 08:47:08 EEST 2020
PROD_BASE_URL="https\://api.dibspayment.eu/"
VERSION_NAME=1.2.1
TEST_CHECKOUT_JS="https\://test.checkout.dibspayment.eu/v1/checkout.js?v\=1"
VERSION_CODE=26
PROD_CHECKOUT_KEY = "YOUR PROD CHECKOUT KEY HERE"
TEST_CHECKOUT_KEY ="YOUR TEST CHECKOUT KEY HERE"
TEST_BASE_URL = "https://test.api.dibspayment.eu/"
TEST_CHECKOUT_JS="https://test.checkout.dibspayment.eu/v1/checkout.js?v=1"

PROD_CHECKOUT_JS="https\://checkout.dibspayment.eu/v1/checkout.js?v\=1"
TEST_SECRET_KEY = "YOUR TEST SECRET KEY HERE"
TEST_BASE_URL="https\://test.api.dibspayment.eu/"
PROD_SECRET_KEY = "YOUR PROD SECRET KEY HERE"
PROD_CHECKOUT_KEY = "YOUR PROD CHECKOUT KEY HERE"
PROD_BASE_URL = "https://api.dibspayment.eu/"
PROD_CHECKOUT_JS = "https://checkout.dibspayment.eu/v1/checkout.js?v=1"
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,13 @@ class MainActivity : AppCompatActivity(), MainActivityView {
const val CURRENCY_SEK = "SEK"
const val CURRENCY_DKK = "DKK"
const val CURRENCY_NOK = "NOK"
const val CURRENCY_EUR = "EUR"

//end
//integration types
const val EASY_HOSTED_PAYMENT_WINDOW = "HostedPaymentPage"
const val MERCHANT_HOSTED_PAYMENT_WINDOW = "EmbeddedCheckout"

//end
//easy hosted payment window helper constants
const val RETURN_URL = "http://localhost/redirect.php"
Expand All @@ -74,6 +77,7 @@ class MainActivity : AppCompatActivity(), MainActivityView {
const val CONSUMER_DATA_NONE = "None"
const val CONSUMER_DATA_MERCHANT_INJECTED = "Injected by merchant"
const val CONSUMER_DATA_NO_SHIPPING_ADDR = "No shipping address"

//end
val SCREEN_SELECTED = "screen_selected"
val SCREEN_PROFILE = "screen_profile"
Expand Down Expand Up @@ -157,7 +161,8 @@ class MainActivity : AppCompatActivity(), MainActivityView {
val currencies: List<String> = ArrayList<String>(Arrays.asList(
CURRENCY_SEK,
CURRENCY_DKK,
CURRENCY_NOK
CURRENCY_NOK,
CURRENCY_EUR
))
val spinnerAdapter = CurrencyAdapter(this, android.R.layout.simple_spinner_item, currencies)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class HeaderInterceptor : Interceptor {

builder.addHeader("Content-Type", "application/json")
builder.addHeader("Authorization", APIManager.secretKey)

/**
* @param commercePlatformTag This is critical to identify the platform from which the payment is initiated
*/
builder.addHeader("commercePlatformTag", "AndroidSDK")
return builder.build()
}

Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Easy - Android SDK v1.2.0
# Easy - Android SDK v1.2.1
----
![Logo](readme-files/NetsLogo.jpg)

Expand All @@ -18,7 +18,7 @@ MiA Easy Android SDK is a library which facilitates the Embedded DIBS Easy Check
----
In your `build.gradle` application level file, add:
```gradle
implementation('eu.nets.mia:mia-sdk:1.2.0') { transitive = true;}
implementation('eu.nets.mia:mia-sdk:1.2.1') { transitive = true;}
```

**Note:** the library is available through both `jcenter()` and `mavenCentral()` repositories.
Expand Down Expand Up @@ -92,6 +92,21 @@ override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)
}
```

**IMPORTANT**: While making the API call for creating a payment or subscription, make sure you add **"commercePlatformTag" : "AndroidSDK"** in the request header. This is critical to identify the platform from which the payment is initiated.
```kotlin
private fun addHeader(request: Request): Request {
val builder = request.newBuilder().method(request.method(), request.body())

builder.addHeader("Content-Type", "application/json")
builder.addHeader("Authorization", APIManager.secretKey)
/**
* @param commercePlatformTag This is critical to identify the platform from which the payment is initiated
*/
builder.addHeader("commercePlatformTag", "AndroidSDK")
return builder.build()
}
```

# Contact
----
If you have any question or feedback, please contact us via email: [mobile-acceptance@nets.eu](mailto:mobile-acceptance@nets.eu)
Expand Down
2 changes: 1 addition & 1 deletion ReactNative/react-native-rn-mia/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies {
implementation 'com.facebook.react:react-native:+' // From node_modules

// Mia SDK
implementation 'eu.nets.mia:mia-sdk:1.2.0'
implementation 'eu.nets.mia:mia-sdk:1.2.1'
}

def configureReactNativePom(def pom) {
Expand Down
Binary file modified Xamarin/DLL Files/MiASDKBinding.dll
Binary file not shown.
Binary file not shown.
47 changes: 43 additions & 4 deletions documentation/Start - Overview of MiA Android SDK.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ <h2><a id="Table_of_contents_6"></a>MiA - EASY Android SDK v1.2.0</h2>
<li><strong>Nets Easy technical documentation</strong> can be found <a href="https://tech.dibspayment.com/easy">here.</a></li>
<li><strong>Nets Easy API documentation</strong> can be found <a href="http://tech.dibspayment.com/easy/api">here.</a></li>
<li><strong>Nets Easy checkout guide (Re-direct) </strong>can be found <a href="https://tech.dibspayment.com/node4555edit/checkout-introduction">here.</a></li>
<li><strong>Easy - Android SDK</strong> can be found <a href="https://github.com/Nets-mobile-acceptance/Easy-Android-SDK">here.</a></li>
<li><strong>Easy - iOS SDK</strong> can be found <a href="https://github.com/DIBS-Payment-Services/Easy-iOS-SDK">here.</a></li>
<br>
Requirements:<br>
Minimum compatible <strong>Android API</strong> version is <strong>22 - Android 5.1 Lollipop</strong>.
Minimum compatible <strong>Android API</strong> version is <strong>21 - Android 5.0 Lollipop</strong>.

<h1><a id="Table_of_contents_6"></a>Table of contents:</h1>
<hr>
Expand Down Expand Up @@ -76,7 +76,7 @@ <h1><a id="installation"></a>Installation</h1>
<li>Please add the following line in your application's <code>build.gradle</code> file.</li>
</ul>
<pre><code class="language-gradle"><span class="hljs-keyword">dependencies</span> {
implementation(<span class="hljs-string">'eu.nets.mia:mia-sdk:1.2.0'</span>) { transitive = <span class="hljs-keyword">true</span>;}
implementation(<span class="hljs-string">'eu.nets.mia:mia-sdk:1.2.1'</span>) { transitive = <span class="hljs-keyword">true</span>;}
</code></pre>
<h1><a id="getting-started"></a>Getting started</h1>
<hr>
Expand Down Expand Up @@ -305,7 +305,25 @@ <h1><a id="getting-started"></a>Getting started</h1>
"reservedAmount": 0
}
</code></pre>
<p><strong>Important:</strong> Once a purchase is completed, the customer must receive a confirmation of the order and a receipt in the form of an on-screen-display and e-mail. Meaning that after you call <a href="https://tech.dibspayment.com/easy/api/rest/charge-payment">Charge Payment</a>, you already have the payment information retrieved at previous step, and display it to the user.</p>
<p><strong>Important:</strong>
<ul>
<li>Once a purchase is completed, the customer must receive a confirmation of the order and a receipt in the form of an on-screen-display and e-mail. Meaning that after you call <a href="https://tech.dibspayment.com/easy/api/rest/charge-payment">Charge Payment</a>, you already have the payment information retrieved at previous step, and display it to the user.</p></li>

<li>While making the API call for creating a payment, make sure you add`<strong>"commercePlatformTag" : "AndroidSDK"</strong>`in the request header. This is critical to identify the platform from which the payment is initiated.</p>

<pre><code class="language-kotlin"> <span class="hljs-keyword">override</span> <span class="hljs-function"><span class="hljs-keyword">fun</span> <span class="hljs-title">addHeader</span><span class="hljs-params">(request: <span class="hljs-typename">Request): Request</span> {</span>
<span class="hljs-variable"><span class="hljs-keyword">val</span> builder</span> = request.newBuilder().method(request.method(), request.body())
builder.addHeader("Content-Type", "application/json")
builder.addHeader("Authorization", APIManager.secretKey)
/**
* @param commercePlatformTag This is critical to identify the platform from which the payment is initiated
*/
builder.addHeader("commercePlatformTag", "AndroidSDK")
<span class="hljs-keyword">return</span> builder.build()
}
</code></pre></li>
</ul>


<h1><a id="subscriptions"></a>Subscriptions <a href="https://tech.dibspayment.com/easy/integration/recurring">(Recurring API)</a></h1>
<hr>
Expand Down Expand Up @@ -422,6 +440,21 @@ <h1><a id="subscriptions"></a>Subscriptions <a href="https://tech.dibspayment.co

</code></pre>

<p><strong>Important:</strong> While making the API call for creating a subscription , make sure you add `<strong>"commercePlatformTag" : "AndroidSDK"</strong>` in the request header. This is critical to identify the platform from which the payment is initiated.</p>

<pre><code class="language-kotlin"> <span class="hljs-keyword">override</span> <span class="hljs-function"><span class="hljs-keyword">fun</span> <span class="hljs-title">addHeader</span><span class="hljs-params">(request: <span class="hljs-typename">Request): Request</span> {</span>
<span class="hljs-variable"><span class="hljs-keyword">val</span> builder</span> = request.newBuilder().method(request.method(), request.body())
builder.addHeader("Content-Type", "application/json")
builder.addHeader("Authorization", APIManager.secretKey)
/**
* @param commercePlatformTag This is critical to identify the platform from which the payment is initiated
*/
builder.addHeader("commercePlatformTag", "AndroidSDK")
<span class="hljs-keyword">return</span> builder.build()
}
</code></pre>


<p>After creating a subscription, merchant is responsible for storing and managing the subscription.</p>

<p>(Note that the MiaSample app stores subscriptions in the device for demo purposes but we recommend your app backend for storage)</p>
Expand Down Expand Up @@ -493,6 +526,12 @@ <h4><a id="Release_notes_268"></a>Release notes:</h4>
<li>Added a shared React Native wrapper for both iOS and Android SDK integration.</li>
</ul>

<h4><a id="v121_Released_TBD_267"></a>v1.2.1 Released: 25-Jan-2021</h4>
<h4><a id="Release_notes_268"></a>Release notes:</h4>
<ul>
<li>Support of Android API version extended to API 21 and above.</li>
</ul>

<h4><a id="notes_266"></a>Note:</h4>
<ul>
<li>For any bug reports or question, please contact: mobile-acceptance@nets.eu</li>
Expand Down
Binary file modified documentation/img/dibs_easy_flow.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 9470bec

Please sign in to comment.