<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.barion.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gerleisz</id>
	<title>Barion Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.barion.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gerleisz"/>
	<link rel="alternate" type="text/html" href="https://docs.barion.com/Special:Contributions/Gerleisz"/>
	<updated>2026-11-21T18:17:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3789</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3789"/>
		<updated>2023-02-03T14:29:15Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: /* 3.2. step - Add redirect scheme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion gateway client into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. This scheme will be given by the &#039;&#039;&#039;RedirectUrl  property&#039;&#039;&#039; of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
You can define the environment of the Barion System, which can be our TEST or PRODUCTION environment.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion.getInstance().environment = BarionEnvironment.TEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
val request = BarionStartPaymentRequest(&lt;br /&gt;
    posKey = &amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;, // the POSKey of the shop&lt;br /&gt;
    paymentType = PaymentType.IMMEDIATE,&lt;br /&gt;
    guestCheckOut = true,&lt;br /&gt;
    fundingSources = listOf(&amp;quot;All&amp;quot;),&lt;br /&gt;
    paymentRequestId = &amp;quot;12345&amp;quot;,&lt;br /&gt;
    locale = &amp;quot;hu-HU&amp;quot;,&lt;br /&gt;
    currency = &amp;quot;EUR&amp;quot;,&lt;br /&gt;
    transactions = listOf(&lt;br /&gt;
        PaymentTransaction(&lt;br /&gt;
            posTransactionId = &amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;,&lt;br /&gt;
            payee = &amp;quot;demouser@your-domain.com&amp;quot;,&lt;br /&gt;
            total = 200,&lt;br /&gt;
            comment = &amp;quot;The new App2App Library&amp;quot;,&lt;br /&gt;
            products = listOf( // list of your products&lt;br /&gt;
                Product(&lt;br /&gt;
                    name = &amp;quot;The history of money&amp;quot;,&lt;br /&gt;
                    description = &amp;quot;The evolution of money from the stoneage to Barion&amp;quot;,&lt;br /&gt;
                    quantity = 1.0,&lt;br /&gt;
                    unit = &amp;quot;db&amp;quot;,&lt;br /&gt;
                    price = 40.0,&lt;br /&gt;
                    sKU = &amp;quot;APP2APPDEMO_PENZTORT&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
    redirectUrl = &amp;quot;myredirecturl://&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Barion&lt;br /&gt;
    .getInstance()&lt;br /&gt;
    .startPayment(requireContext(), request)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Product]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The PaymentTransaction object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* The library will open the gateway web client to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library provides functionality to request the results of a payment. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion&lt;br /&gt;
   .getInstance()&lt;br /&gt;
   .getPaymentState(request)&lt;br /&gt;
&lt;br /&gt;
if (response.errors.isEmpty()) {&lt;br /&gt;
    // Handle success case&lt;br /&gt;
} else {&lt;br /&gt;
    // Handle error case&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3788</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3788"/>
		<updated>2023-02-03T14:28:07Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: /* 3.2. step - Add redirect scheme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion gateway client into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. This scheme will be given by a property of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
You can define the environment of the Barion System, which can be our TEST or PRODUCTION environment.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion.getInstance().environment = BarionEnvironment.TEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
val request = BarionStartPaymentRequest(&lt;br /&gt;
    posKey = &amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;, // the POSKey of the shop&lt;br /&gt;
    paymentType = PaymentType.IMMEDIATE,&lt;br /&gt;
    guestCheckOut = true,&lt;br /&gt;
    fundingSources = listOf(&amp;quot;All&amp;quot;),&lt;br /&gt;
    paymentRequestId = &amp;quot;12345&amp;quot;,&lt;br /&gt;
    locale = &amp;quot;hu-HU&amp;quot;,&lt;br /&gt;
    currency = &amp;quot;EUR&amp;quot;,&lt;br /&gt;
    transactions = listOf(&lt;br /&gt;
        PaymentTransaction(&lt;br /&gt;
            posTransactionId = &amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;,&lt;br /&gt;
            payee = &amp;quot;demouser@your-domain.com&amp;quot;,&lt;br /&gt;
            total = 200,&lt;br /&gt;
            comment = &amp;quot;The new App2App Library&amp;quot;,&lt;br /&gt;
            products = listOf( // list of your products&lt;br /&gt;
                Product(&lt;br /&gt;
                    name = &amp;quot;The history of money&amp;quot;,&lt;br /&gt;
                    description = &amp;quot;The evolution of money from the stoneage to Barion&amp;quot;,&lt;br /&gt;
                    quantity = 1.0,&lt;br /&gt;
                    unit = &amp;quot;db&amp;quot;,&lt;br /&gt;
                    price = 40.0,&lt;br /&gt;
                    sKU = &amp;quot;APP2APPDEMO_PENZTORT&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
    redirectUrl = &amp;quot;myredirecturl://&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Barion&lt;br /&gt;
    .getInstance()&lt;br /&gt;
    .startPayment(requireContext(), request)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Product]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The PaymentTransaction object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* The library will open the gateway web client to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library provides functionality to request the results of a payment. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion&lt;br /&gt;
   .getInstance()&lt;br /&gt;
   .getPaymentState(request)&lt;br /&gt;
&lt;br /&gt;
if (response.errors.isEmpty()) {&lt;br /&gt;
    // Handle success case&lt;br /&gt;
} else {&lt;br /&gt;
    // Handle error case&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3787</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3787"/>
		<updated>2023-02-03T14:24:53Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: /* 5. step - Get results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion application into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. It is &#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;, that this scheme must be the same as the &#039;&#039;&#039;redirectUrl&#039;&#039;&#039;  property of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
You can define the environment of the Barion System, which can be our TEST or PRODUCTION environment.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion.getInstance().environment = BarionEnvironment.TEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
val request = BarionStartPaymentRequest(&lt;br /&gt;
    posKey = &amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;, // the POSKey of the shop&lt;br /&gt;
    paymentType = PaymentType.IMMEDIATE,&lt;br /&gt;
    guestCheckOut = true,&lt;br /&gt;
    fundingSources = listOf(&amp;quot;All&amp;quot;),&lt;br /&gt;
    paymentRequestId = &amp;quot;12345&amp;quot;,&lt;br /&gt;
    locale = &amp;quot;hu-HU&amp;quot;,&lt;br /&gt;
    currency = &amp;quot;EUR&amp;quot;,&lt;br /&gt;
    transactions = listOf(&lt;br /&gt;
        PaymentTransaction(&lt;br /&gt;
            posTransactionId = &amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;,&lt;br /&gt;
            payee = &amp;quot;demouser@your-domain.com&amp;quot;,&lt;br /&gt;
            total = 200,&lt;br /&gt;
            comment = &amp;quot;The new App2App Library&amp;quot;,&lt;br /&gt;
            products = listOf( // list of your products&lt;br /&gt;
                Product(&lt;br /&gt;
                    name = &amp;quot;The history of money&amp;quot;,&lt;br /&gt;
                    description = &amp;quot;The evolution of money from the stoneage to Barion&amp;quot;,&lt;br /&gt;
                    quantity = 1.0,&lt;br /&gt;
                    unit = &amp;quot;db&amp;quot;,&lt;br /&gt;
                    price = 40.0,&lt;br /&gt;
                    sKU = &amp;quot;APP2APPDEMO_PENZTORT&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
    redirectUrl = &amp;quot;myredirecturl://&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Barion&lt;br /&gt;
    .getInstance()&lt;br /&gt;
    .startPayment(requireContext(), request)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Product]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The PaymentTransaction object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* The library will open the gateway web client to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library provides functionality to request the results of a payment. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion&lt;br /&gt;
   .getInstance()&lt;br /&gt;
   .getPaymentState(request)&lt;br /&gt;
&lt;br /&gt;
if (response.errors.isEmpty()) {&lt;br /&gt;
    // Handle success case&lt;br /&gt;
} else {&lt;br /&gt;
    // Handle error case&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3786</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3786"/>
		<updated>2023-02-03T14:21:09Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: /* 4. step - Initiate payment with the library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion application into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. It is &#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;, that this scheme must be the same as the &#039;&#039;&#039;redirectUrl&#039;&#039;&#039;  property of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
You can define the environment of the Barion System, which can be our TEST or PRODUCTION environment.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
Barion.getInstance().environment = BarionEnvironment.TEST&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
val request = BarionStartPaymentRequest(&lt;br /&gt;
    posKey = &amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;, // the POSKey of the shop&lt;br /&gt;
    paymentType = PaymentType.IMMEDIATE,&lt;br /&gt;
    guestCheckOut = true,&lt;br /&gt;
    fundingSources = listOf(&amp;quot;All&amp;quot;),&lt;br /&gt;
    paymentRequestId = &amp;quot;12345&amp;quot;,&lt;br /&gt;
    locale = &amp;quot;hu-HU&amp;quot;,&lt;br /&gt;
    currency = &amp;quot;EUR&amp;quot;,&lt;br /&gt;
    transactions = listOf(&lt;br /&gt;
        PaymentTransaction(&lt;br /&gt;
            posTransactionId = &amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;,&lt;br /&gt;
            payee = &amp;quot;demouser@your-domain.com&amp;quot;,&lt;br /&gt;
            total = 200,&lt;br /&gt;
            comment = &amp;quot;The new App2App Library&amp;quot;,&lt;br /&gt;
            products = listOf( // list of your products&lt;br /&gt;
                Product(&lt;br /&gt;
                    name = &amp;quot;The history of money&amp;quot;,&lt;br /&gt;
                    description = &amp;quot;The evolution of money from the stoneage to Barion&amp;quot;,&lt;br /&gt;
                    quantity = 1.0,&lt;br /&gt;
                    unit = &amp;quot;db&amp;quot;,&lt;br /&gt;
                    price = 40.0,&lt;br /&gt;
                    sKU = &amp;quot;APP2APPDEMO_PENZTORT&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
    redirectUrl = &amp;quot;myredirecturl://&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Barion&lt;br /&gt;
    .getInstance()&lt;br /&gt;
    .startPayment(requireContext(), request)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Product]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The PaymentTransaction object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* The library will open the gateway web client to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library will return with the results in the onActivityResult method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
   @Override&lt;br /&gt;
   public void onActivityResult(int requestCode, int resultCode, Intent data) {&lt;br /&gt;
      if (requestCode == Barion.REQUEST_CODE) {&lt;br /&gt;
         if (resultCode == Activity.RESULT_OK) {&lt;br /&gt;
            BarionGetPaymentStateResponse response = (BarionGetPaymentStateResponse) data.getSerializableExtra(Barion.BARION_PAYMENT_STATE_RESPONSE);&lt;br /&gt;
            if (response != null &amp;amp;&amp;amp; getActivity() != null) {&lt;br /&gt;
               Intent intent = new Intent(getActivity(), PaymentResultActivity.class);&lt;br /&gt;
               intent.putExtra(&amp;quot;PaymentState&amp;quot;, response);&lt;br /&gt;
               startActivity(intent);&lt;br /&gt;
               finish();&lt;br /&gt;
            }&lt;br /&gt;
         } else if (resultCode == Activity.RESULT_CANCELED) {&lt;br /&gt;
            ArrayList&amp;lt;BarionError&amp;gt; errors = (ArrayList&amp;lt;BarionError&amp;gt;) data.getSerializableExtra(Barion.ERROR);&lt;br /&gt;
            processBarionErrors(errors);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3785</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3785"/>
		<updated>2023-02-03T14:16:16Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: /* 4. step - Initiate payment with the library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion application into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. It is &#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;, that this scheme must be the same as the &#039;&#039;&#039;redirectUrl&#039;&#039;&#039;  property of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
val request = BarionStartPaymentRequest(&lt;br /&gt;
    posKey = &amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;, // the POSKey of the shop&lt;br /&gt;
    paymentType = PaymentType.IMMEDIATE,&lt;br /&gt;
    guestCheckOut = true,&lt;br /&gt;
    fundingSources = listOf(&amp;quot;All&amp;quot;),&lt;br /&gt;
    paymentRequestId = &amp;quot;12345&amp;quot;,&lt;br /&gt;
    locale = &amp;quot;hu-HU&amp;quot;,&lt;br /&gt;
    currency = &amp;quot;EUR&amp;quot;,&lt;br /&gt;
    transactions = listOf(&lt;br /&gt;
        PaymentTransaction(&lt;br /&gt;
            posTransactionId = &amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;,&lt;br /&gt;
            payee = &amp;quot;demouser@your-domain.com&amp;quot;,&lt;br /&gt;
            total = 200,&lt;br /&gt;
            comment = &amp;quot;The new App2App Library&amp;quot;,&lt;br /&gt;
            products = listOf( // list of your products&lt;br /&gt;
                Product(&lt;br /&gt;
                    name = &amp;quot;The history of money&amp;quot;,&lt;br /&gt;
                    description = &amp;quot;The evolution of money from the stoneage to Barion&amp;quot;,&lt;br /&gt;
                    quantity = 1.0,&lt;br /&gt;
                    unit = &amp;quot;db&amp;quot;,&lt;br /&gt;
                    price = 40.0,&lt;br /&gt;
                    sKU = &amp;quot;APP2APPDEMO_PENZTORT&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
    redirectUrl = &amp;quot;myredirecturl://&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Barion&lt;br /&gt;
    .getInstance()&lt;br /&gt;
    .startPayment(requireContext(), request)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Item]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The TransactionModel object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* If the debugMode is true the library will communicate with our sandbox environment.&lt;br /&gt;
* If the user didn&#039;t installed the Barion app on their device, the library will show the webview to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library will return with the results in the onActivityResult method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
   @Override&lt;br /&gt;
   public void onActivityResult(int requestCode, int resultCode, Intent data) {&lt;br /&gt;
      if (requestCode == Barion.REQUEST_CODE) {&lt;br /&gt;
         if (resultCode == Activity.RESULT_OK) {&lt;br /&gt;
            BarionGetPaymentStateResponse response = (BarionGetPaymentStateResponse) data.getSerializableExtra(Barion.BARION_PAYMENT_STATE_RESPONSE);&lt;br /&gt;
            if (response != null &amp;amp;&amp;amp; getActivity() != null) {&lt;br /&gt;
               Intent intent = new Intent(getActivity(), PaymentResultActivity.class);&lt;br /&gt;
               intent.putExtra(&amp;quot;PaymentState&amp;quot;, response);&lt;br /&gt;
               startActivity(intent);&lt;br /&gt;
               finish();&lt;br /&gt;
            }&lt;br /&gt;
         } else if (resultCode == Activity.RESULT_CANCELED) {&lt;br /&gt;
            ArrayList&amp;lt;BarionError&amp;gt; errors = (ArrayList&amp;lt;BarionError&amp;gt;) data.getSerializableExtra(Barion.ERROR);&lt;br /&gt;
            processBarionErrors(errors);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3784</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3784"/>
		<updated>2023-02-03T14:15:49Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: /* 4. step - Initiate payment with the library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion application into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. It is &#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;, that this scheme must be the same as the &#039;&#039;&#039;redirectUrl&#039;&#039;&#039;  property of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;kotlin&amp;quot;&amp;gt;&lt;br /&gt;
   val request = BarionStartPaymentRequest(&lt;br /&gt;
    posKey = &amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;, // the POSKey of the shop&lt;br /&gt;
    paymentType = PaymentType.IMMEDIATE,&lt;br /&gt;
    guestCheckOut = true,&lt;br /&gt;
    fundingSources = listOf(&amp;quot;All&amp;quot;),&lt;br /&gt;
    paymentRequestId = &amp;quot;12345&amp;quot;,&lt;br /&gt;
    locale = &amp;quot;hu-HU&amp;quot;,&lt;br /&gt;
    currency = &amp;quot;EUR&amp;quot;,&lt;br /&gt;
    transactions = listOf(&lt;br /&gt;
        PaymentTransaction(&lt;br /&gt;
            posTransactionId = &amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;,&lt;br /&gt;
            payee = &amp;quot;demouser@your-domain.com&amp;quot;,&lt;br /&gt;
            total = 200,&lt;br /&gt;
            comment = &amp;quot;The new App2App Library&amp;quot;,&lt;br /&gt;
            products = listOf( // list of your products&lt;br /&gt;
                Product(&lt;br /&gt;
                    name = &amp;quot;The history of money&amp;quot;,&lt;br /&gt;
                    description = &amp;quot;The evolution of money from the stoneage to Barion&amp;quot;,&lt;br /&gt;
                    quantity = 1.0,&lt;br /&gt;
                    unit = &amp;quot;db&amp;quot;,&lt;br /&gt;
                    price = 40.0,&lt;br /&gt;
                    sKU = &amp;quot;APP2APPDEMO_PENZTORT&amp;quot;&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
    redirectUrl = &amp;quot;myredirecturl://&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Barion&lt;br /&gt;
    .getInstance()&lt;br /&gt;
    .startPayment(requireContext(), EnvironmentProperties.ExampleRequest)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Item]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The TransactionModel object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* If the debugMode is true the library will communicate with our sandbox environment.&lt;br /&gt;
* If the user didn&#039;t installed the Barion app on their device, the library will show the webview to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library will return with the results in the onActivityResult method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
   @Override&lt;br /&gt;
   public void onActivityResult(int requestCode, int resultCode, Intent data) {&lt;br /&gt;
      if (requestCode == Barion.REQUEST_CODE) {&lt;br /&gt;
         if (resultCode == Activity.RESULT_OK) {&lt;br /&gt;
            BarionGetPaymentStateResponse response = (BarionGetPaymentStateResponse) data.getSerializableExtra(Barion.BARION_PAYMENT_STATE_RESPONSE);&lt;br /&gt;
            if (response != null &amp;amp;&amp;amp; getActivity() != null) {&lt;br /&gt;
               Intent intent = new Intent(getActivity(), PaymentResultActivity.class);&lt;br /&gt;
               intent.putExtra(&amp;quot;PaymentState&amp;quot;, response);&lt;br /&gt;
               startActivity(intent);&lt;br /&gt;
               finish();&lt;br /&gt;
            }&lt;br /&gt;
         } else if (resultCode == Activity.RESULT_CANCELED) {&lt;br /&gt;
            ArrayList&amp;lt;BarionError&amp;gt; errors = (ArrayList&amp;lt;BarionError&amp;gt;) data.getSerializableExtra(Barion.ERROR);&lt;br /&gt;
            processBarionErrors(errors);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
	<entry>
		<id>https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3783</id>
		<title>App2App integration with android library</title>
		<link rel="alternate" type="text/html" href="https://docs.barion.com/index.php?title=App2App_integration_with_android_library&amp;diff=3783"/>
		<updated>2023-02-03T14:09:33Z</updated>

		<summary type="html">&lt;p&gt;Gerleisz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
In this case of integration, you don&#039;t need to edit your server-side. In your mobile application, you don&#039;t have to implement network communication. We have already do it for you. If you use the Barion Android library you have to add a few lines of code to your existing codebase. The disadvantages are, that you have to notify your own server-side about the payments and your mobile app will contain the POSKey of the shop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: red&amp;quot;&amp;gt;It is highly recommended to obfuscate client applications! We recommend using [http://developer.android.com/tools/help/proguard.html ProGuard] or [https://www.guardsquare.com/dexguard DexGuard].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Downloads, example==&lt;br /&gt;
You can download the Barion Android Library from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The example project can be downloadable from [https://github.com/barion/barion-android-java-app2app/tree/master/examples/LibraryIntegration Barion&#039;s Github page].&lt;br /&gt;
&lt;br /&gt;
The library contains the necessary models, so you don&#039;t need to implement them.&lt;br /&gt;
&lt;br /&gt;
==Integration steps==&lt;br /&gt;
===1. step - Add the library to your project===&lt;br /&gt;
Download the .aar file from [https://github.com/barion/barion-android-java-app2app/tree/master/library Barion&#039;s Github page] and put it into your &#039;&#039;&#039;libs&#039;&#039;&#039; directory!&lt;br /&gt;
  &lt;br /&gt;
===2. step - Edit build.gradle file===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
   repositories {&lt;br /&gt;
      flatDir {&lt;br /&gt;
         dirs &#039;libs&#039;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   dependencies {&lt;br /&gt;
      compile(name:&#039;barionlibrary-1.1.0&#039;, ext:&#039;aar&#039;)&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===3. step - Edit the AndroidManifest.xml file===&lt;br /&gt;
At first, you need to edit the AndroidManifest.xml file.&lt;br /&gt;
&lt;br /&gt;
====3.1. step - Providing internet access ====&lt;br /&gt;
For the communication, your application must have internet access. So add the internet access permission to your AndroidManifest file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
   &amp;lt;manifest&lt;br /&gt;
      xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
      package=&amp;quot;com.barion.example.app2app.libraryintegration&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;uses-permission android:name=&amp;quot;android.permission.INTERNET&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;!-- The rest of your AndroidManifest.xml --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====3.2. step - Add redirect scheme====&lt;br /&gt;
In order to redirect from the Barion application into the integrator application, a redirect scheme is needed. You can choose anything, but it should be unique. In our example, this is &#039;&#039;&#039;myredirecturl&#039;&#039;&#039;. It is &#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;, that this scheme must be the same as the &#039;&#039;&#039;redirectUrl&#039;&#039;&#039;  property of the [[Payment-Start-v2|Payment/Start]] request. You need to add this scheme in intent-filter into your result activity section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;activity&lt;br /&gt;
      android:name=&amp;quot;.activities.PaymentResultActivity&amp;quot;&lt;br /&gt;
      android:label=&amp;quot;@string/app_name&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;action android:name=&amp;quot;android.intent.action.VIEW&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.DEFAULT&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;category android:name=&amp;quot;android.intent.category.BROWSABLE&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
         &amp;lt;data android:scheme=&amp;quot;myredirecturl&amp;quot; /&amp;gt;&lt;br /&gt;
      &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
   &amp;lt;/activity&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===4. step - Initiate payment with the library===&lt;br /&gt;
At any point in the mobile application - where the products that you want to pay are available - you should initiate the payment in the Barion System. The Barion Android Library will check the parameters and if anything is wrong, it will return with an error. The possible error codes can be found on [[Barion_Mobil_Library_Hibakódok|this page]].&lt;br /&gt;
&lt;br /&gt;
To initiate the payment you need to implement a few lines of code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
   ArrayList&amp;lt;BarionProduct&amp;gt; products;&lt;br /&gt;
   Intent intent = new Intent(getActivity(), BarionActivity.class);&lt;br /&gt;
&lt;br /&gt;
   intent.putExtra(Barion.PRODUCTS, products);&lt;br /&gt;
   intent.putExtra(Barion.PAYMENT_SETTINGS, new PaymentSettingsModel.Builder()&lt;br /&gt;
      // the POSKey of the shop&lt;br /&gt;
      .posKey(&amp;quot;f199e514-9199-40f9-a210-55a0c75be8cc&amp;quot;)&lt;br /&gt;
      // immediate payment&lt;br /&gt;
      .paymentType(PaymentSettingsModel.PaymentTypeEnum.Immediate)&lt;br /&gt;
      .guestCheckOut(true)&lt;br /&gt;
      // if the debugMode is true the library will communicate with our sandbox environment.&lt;br /&gt;
      .debugMode(true)&lt;br /&gt;
      .locale(&amp;quot;hu-HU&amp;quot;)&lt;br /&gt;
      .fundingSources(PaymentSettingsModel.FundingSourceTypeEnum.All)&lt;br /&gt;
      // this scheme must be the same as in your AndroidManifest.xml file&lt;br /&gt;
      .redirectUrl(&amp;quot;myredirecturl://&amp;quot;)&lt;br /&gt;
      .build());&lt;br /&gt;
&lt;br /&gt;
   intent.putExtra(Barion.TRANSACTION_SETTINGS, new TransactionModel.Builder()&lt;br /&gt;
      .posTransactionId(&amp;quot;f192e544-9199-46f9-a240-55a0c75be8cc&amp;quot;)&lt;br /&gt;
      .payee(&amp;quot;demouser@your-domain.com&amp;quot;)&lt;br /&gt;
      .total(200)&lt;br /&gt;
      .comment(&amp;quot;The new App2App Library&amp;quot;)&lt;br /&gt;
      .build());&lt;br /&gt;
&lt;br /&gt;
   startActivityForResult(intent, Barion.REQUEST_CODE);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The product list contain the products that [[Item]] type objects.&lt;br /&gt;
* The PaymentSettingsModel object contains the settings, you can read about it on the [[Payment-Start-v2|Payment/Start]] page. &lt;br /&gt;
* The TransactionModel object contains the settings of the transactions, you can read about it on the [[PaymentTransaction|PaymentTransaction]] page.&lt;br /&gt;
* If the debugMode is true the library will communicate with our sandbox environment.&lt;br /&gt;
* If the user didn&#039;t installed the Barion app on their device, the library will show the webview to the user.&lt;br /&gt;
&lt;br /&gt;
===5. step - Get results===&lt;br /&gt;
The library will return with the results in the onActivityResult method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
   @Override&lt;br /&gt;
   public void onActivityResult(int requestCode, int resultCode, Intent data) {&lt;br /&gt;
      if (requestCode == Barion.REQUEST_CODE) {&lt;br /&gt;
         if (resultCode == Activity.RESULT_OK) {&lt;br /&gt;
            BarionGetPaymentStateResponse response = (BarionGetPaymentStateResponse) data.getSerializableExtra(Barion.BARION_PAYMENT_STATE_RESPONSE);&lt;br /&gt;
            if (response != null &amp;amp;&amp;amp; getActivity() != null) {&lt;br /&gt;
               Intent intent = new Intent(getActivity(), PaymentResultActivity.class);&lt;br /&gt;
               intent.putExtra(&amp;quot;PaymentState&amp;quot;, response);&lt;br /&gt;
               startActivity(intent);&lt;br /&gt;
               finish();&lt;br /&gt;
            }&lt;br /&gt;
         } else if (resultCode == Activity.RESULT_CANCELED) {&lt;br /&gt;
            ArrayList&amp;lt;BarionError&amp;gt; errors = (ArrayList&amp;lt;BarionError&amp;gt;) data.getSerializableExtra(Barion.ERROR);&lt;br /&gt;
            processBarionErrors(errors);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything went fine you can get every [[Payment-GetPaymentState-v2|information]] about the payment from the response variable. If there was an error you will get it in the errors list.&lt;/div&gt;</summary>
		<author><name>Gerleisz</name></author>
	</entry>
</feed>