├── flow-base-api ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── aevi │ │ │ └── sdk │ │ │ └── flow │ │ │ ├── model │ │ │ ├── DeviceAudience.java │ │ │ ├── config │ │ │ │ ├── FlowAppConditions.java │ │ │ │ └── AppExecutionType.java │ │ │ ├── Device.java │ │ │ ├── BaseIdNameEntity.java │ │ │ └── BaseModel.java │ │ │ ├── constants │ │ │ ├── InternalDataKeys.java │ │ │ ├── ResponseMechanisms.java │ │ │ ├── ServiceInfoErrors.java │ │ │ ├── FlowServiceEventDataKeys.java │ │ │ ├── AppMessageTypes.java │ │ │ └── IntentActions.java │ │ │ ├── util │ │ │ └── ComparisonUtil.java │ │ │ └── service │ │ │ ├── BaseGenericService.java │ │ │ ├── BaseStatusUpdateService.java │ │ │ ├── BasePostGenericService.java │ │ │ └── BaseResponseListenerService.java │ └── test │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── flow │ │ ├── ContextHelper.java │ │ ├── service │ │ └── BaseServiceInfoProviderTest.java │ │ ├── TestHelper.java │ │ └── model │ │ └── FlowEventTest.java └── build.gradle ├── sample-commons ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── bool.xml │ │ │ ├── colors.xml │ │ │ └── dimens.xml │ │ ├── values-sw720dp │ │ │ ├── bool.xml │ │ │ └── dimens.xml │ │ ├── color │ │ │ └── item_button_text_color.xml │ │ ├── drawable │ │ │ ├── shadow_gradient.xml │ │ │ ├── ic_code_black_24dp.xml │ │ │ ├── ic_code_white_24dp.xml │ │ │ ├── ic_description_black_24dp.xml │ │ │ ├── ic_description_white_24dp.xml │ │ │ ├── item_background.xml │ │ │ ├── ic_help_outline_white_24dp.xml │ │ │ ├── item_background_states.xml │ │ │ └── flow_stage_selector.xml │ │ ├── layout │ │ │ ├── snippet_list_header.xml │ │ │ ├── activity_model_details.xml │ │ │ ├── fragment_model_details.xml │ │ │ └── snippet_list_item.xml │ │ └── menu │ │ │ └── flow_menu.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── pos │ │ └── flow │ │ └── sample │ │ ├── ui │ │ ├── SectionHeaderViewHolder.java │ │ ├── LabelValueViewHolder.java │ │ ├── ModelDisplay.java │ │ └── HelpActivity.java │ │ ├── AmountFormatter.java │ │ └── CustomerProducer.java ├── proguard-rules.pro └── build.gradle ├── FlowServiceSample ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap │ │ │ └── ic_launcher.png │ │ ├── values-sw720dp │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── integers.xml │ │ │ └── styles.xml │ │ ├── layout │ │ │ ├── layout_split.xml │ │ │ ├── layout_pre_flow.xml │ │ │ ├── layout_pre_txn.xml │ │ │ ├── view_pre_flow_fields.xml │ │ │ ├── view_split_fields.xml │ │ │ ├── activity_pre_txn.xml │ │ │ └── activity_pre_flow.xml │ │ └── layout-sw720dp │ │ │ ├── layout_split.xml │ │ │ ├── layout_pre_flow.xml │ │ │ └── layout_pre_txn.xml │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── pos │ │ └── flow │ │ ├── stage │ │ └── StageModelHelper.java │ │ └── flowservicesample │ │ ├── ui │ │ ├── adapter │ │ │ └── PaymentPropertiesAdapter.java │ │ ├── PostCardActivity.java │ │ └── PreTransactionActivity.java │ │ └── service │ │ └── PostGenericSampleService.java ├── proguard-rules.pro └── build.gradle ├── PaymentServiceSample ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap │ │ │ └── ic_launcher.png │ │ ├── values-sw720dp │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── array.xml │ │ │ └── styles.xml │ │ ├── layout │ │ │ ├── layout_select_card.xml │ │ │ ├── layout_payment_response.xml │ │ │ ├── view_select_card_fields.xml │ │ │ ├── view_payment_response_fields.xml │ │ │ └── activity_select_card.xml │ │ └── layout-sw720dp │ │ │ ├── layout_select_card.xml │ │ │ └── layout_payment_response.xml │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── pos │ │ └── flow │ │ └── paymentservicesample │ │ └── util │ │ ├── IdProvider.java │ │ └── InMemoryStore.java ├── proguard-rules.pro └── build.gradle ├── PaymentInitiationSample ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap │ │ │ └── ic_launcher.png │ │ ├── values-sw720dp │ │ │ ├── dimens.xml │ │ │ └── styles.xml │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── array.xml │ │ ├── layout │ │ │ ├── snippet_checkbox.xml │ │ │ ├── activity_popup.xml │ │ │ ├── activity_main.xml │ │ │ ├── fragment_json_display.xml │ │ │ ├── snippet_recycler_view_header.xml │ │ │ ├── activity_payment.xml │ │ │ ├── fragment_recycler_view.xml │ │ │ ├── snippet_two_line_item_medium_title.xml │ │ │ ├── snippet_event_info.xml │ │ │ ├── snippet_two_line_item_large_title.xml │ │ │ ├── snippet_result_line.xml │ │ │ ├── activity_request.xml │ │ │ ├── activity_generic_result.xml │ │ │ ├── activity_payment_approved.xml │ │ │ └── snippet_transaction.xml │ │ ├── anim │ │ │ ├── exit_to_left.xml │ │ │ ├── exit_to_right.xml │ │ │ ├── enter_from_left.xml │ │ │ └── enter_from_right.xml │ │ ├── drawable │ │ │ ├── ic_close.xml │ │ │ ├── ic_check_circle_amber.xml │ │ │ ├── ic_check_circle.xml │ │ │ ├── ic_question_answer.xml │ │ │ ├── ic_error_circle.xml │ │ │ └── ic_event.xml │ │ └── layout-sw720dp │ │ │ ├── activity_payment.xml │ │ │ └── activity_request.xml │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── pos │ │ └── flow │ │ └── paymentinitiationsample │ │ ├── ui │ │ ├── MainActivity.java │ │ ├── fragment │ │ │ ├── BaseFragment.java │ │ │ ├── SystemEventFragment.java │ │ │ └── BaseItemFragment.java │ │ └── adapter │ │ │ ├── ApiFunctionsAdapter.java │ │ │ ├── DevicesAdapter.java │ │ │ └── FlowServicesAdapter.java │ │ ├── model │ │ ├── SystemEventHandler.java │ │ ├── ApiFunction.java │ │ └── SystemOverview.java │ │ └── ConfirmationActionReceiver.java ├── proguard-rules.pro └── build.gradle ├── payment-flow-service-api ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── aevi │ │ │ └── sdk │ │ │ └── pos │ │ │ └── flow │ │ │ └── PaymentFlowServiceApi.java │ └── test │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── pos │ │ └── flow │ │ └── model │ │ ├── FlowResponseTest.java │ │ ├── TransactionResponseBuilderTest.java │ │ ├── ContextHelper.java │ │ └── CardBuilderTest.java └── build.gradle ├── payment-initiation-api ├── .gitignore ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── aevi │ │ │ └── sdk │ │ │ └── pos │ │ │ └── flow │ │ │ ├── model │ │ │ ├── RoundingStrategy.java │ │ │ ├── events │ │ │ │ ├── FinalAmountStatusType.java │ │ │ │ ├── ProgressMessage.java │ │ │ │ ├── NotifyAction.java │ │ │ │ ├── FinalAmountRequest.java │ │ │ │ └── ConfirmationOption.java │ │ │ ├── Merchant.java │ │ │ └── Measurement.java │ │ │ └── service │ │ │ └── BasePaymentResponseListenerService.java │ └── test │ │ ├── resources │ │ └── error_response.json │ │ └── java │ │ └── com │ │ └── aevi │ │ └── sdk │ │ └── pos │ │ └── flow │ │ ├── model │ │ ├── events │ │ │ ├── ReceiptTest.java │ │ │ ├── ConfirmationRequestTest.java │ │ │ └── FinalAmountRequestTest.java │ │ ├── CardTest.java │ │ ├── BasketItemModifierTest.java │ │ └── BasketItemTest.java │ │ ├── PaymentApiTest.java │ │ └── ApiTestBase.java └── build.gradle ├── publishLocally.sh ├── samples-key.jks ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── installSamples.sh ├── .idea └── codeStyles │ └── codeStyleConfig.xml ├── uninstallSamples.sh ├── .gitignore ├── settings.gradle ├── dist.gradle ├── .github └── workflows │ └── pr-build-test.yml ├── gradle.properties └── CHANGELOG.md /flow-base-api/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample-commons/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /FlowServiceSample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /PaymentServiceSample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /PaymentInitiationSample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /payment-flow-service-api/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /payment-initiation-api/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /publishLocally.sh: -------------------------------------------------------------------------------- 1 | ./gradlew jar publishApiJarPublicationToMavenLocal 2 | -------------------------------------------------------------------------------- /flow-base-api/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples-key.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AEVI-AppFlow/pos-android-sdk/HEAD/samples-key.jks -------------------------------------------------------------------------------- /payment-flow-service-api/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /payment-initiation-api/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AEVI-AppFlow/pos-android-sdk/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /sample-commons/src/main/res/values/bool.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | false 5 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/mipmap/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AEVI-AppFlow/pos-android-sdk/HEAD/FlowServiceSample/src/main/res/mipmap/ic_launcher.png -------------------------------------------------------------------------------- /sample-commons/src/main/res/values-sw720dp/bool.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/mipmap/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AEVI-AppFlow/pos-android-sdk/HEAD/PaymentServiceSample/src/main/res/mipmap/ic_launcher.png -------------------------------------------------------------------------------- /installSamples.sh: -------------------------------------------------------------------------------- 1 | ./gradlew :PaymentServiceSample:installRelease 2 | ./gradlew :FlowServiceSample:installRelease 3 | ./gradlew :PaymentInitiationSample:installRelease 4 | 5 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/mipmap/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AEVI-AppFlow/pos-android-sdk/HEAD/PaymentInitiationSample/src/main/res/mipmap/ic_launcher.png -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/values-sw720dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 40dp 4 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /uninstallSamples.sh: -------------------------------------------------------------------------------- 1 | adb uninstall com.aevi.sdk.pos.flow.paymentinitiationsample 2 | adb uninstall com.aevi.sdk.pos.flow.flowservicesample 3 | adb uninstall com.aevi.sdk.pos.flow.paymentservicesample 4 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/values-sw720dp/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/values-sw720dp/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/values-sw720dp/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | documentation 12 | artifacts 13 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':payment-flow-service-api', 2 | ':flow-base-api', 3 | ':payment-initiation-api', 4 | ':sample-commons', 5 | ':PaymentInitiationSample', 6 | ':PaymentServiceSample', 7 | ':FlowServiceSample' -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #1b685b 5 | #737373 6 | #00688B 7 | 8 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 3 4 | 50 5 | 500 6 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #b20000 5 | #737373 6 | #00688B 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jan 21 11:54:58 GMT 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 7 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 8dp 5 | 20dp 6 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/color/item_button_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/shadow_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/layout/snippet_checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/anim/exit_to_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/anim/exit_to_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/anim/enter_from_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/anim/enter_from_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /dist.gradle: -------------------------------------------------------------------------------- 1 | task publishJavadocsAsLatest(type: Exec, dependsOn: javadocs) { 2 | commandLine 'aws', '--region', 'eu-west-1', 's3', 'sync', 'documentation/public/javadocs', 's3://pos-flow-docs/javadocs/latest', '--acl', 'public-read' 3 | } 4 | 5 | task publishJavadocsByVersion(type: Exec, dependsOn: javadocs) { 6 | commandLine 'aws', '--region', 'eu-west-1', 's3', 'sync', 'documentation/public/javadocs', "s3://pos-flow-docs/javadocs/${rootProject.version}", '--acl', 'public-read' 7 | } -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/drawable/ic_check_circle_amber.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/ic_code_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/ic_code_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/drawable/ic_check_circle.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/layout/activity_popup.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/drawable/ic_question_answer.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #00688B 5 | #737373 6 | #00688B 7 | 8 | #f1fff1 9 | #f1ffff 10 | #fff1f1 11 | 12 | #eeeeee 13 | 14 | 15 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/java/com/aevi/sdk/pos/flow/paymentservicesample/util/IdProvider.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.pos.flow.paymentservicesample.util; 2 | 3 | public final class IdProvider { 4 | 5 | private IdProvider() { 6 | 7 | } 8 | 9 | public static String getTerminalId() { 10 | return "12345678"; 11 | } 12 | 13 | public static String getMerchantId() { 14 | return "87654321"; 15 | } 16 | 17 | public static String getMerchantName() { 18 | return "Sample Merchant"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/values-sw720dp/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Approve with token 5 | Payment Service Sample - Transaction processing step 6 | Payment Service Sample - Payment card reading step 7 | Payment Service Sample - Select token 8 | Payment Service Sample - Batch closure 9 | -------------------------------------------------------------------------------- /payment-initiation-api/src/main/java/com/aevi/sdk/pos/flow/model/RoundingStrategy.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.pos.flow.model; 2 | 3 | /** 4 | * Strategies for rounding decimal numbers. 5 | */ 6 | public enum RoundingStrategy { 7 | /** 8 | * Always round down. Both 15.2 and 15.9 is rounded to 15. 9 | */ 10 | DOWN, 11 | /** 12 | * Round to nearest. 15.2 is rounded to 15, and 15.9 is rounded to 16. 13 | */ 14 | NEAREST, 15 | /** 16 | * Always round up. Both 15.2 and 15.9 is rounded to 16. 17 | */ 18 | UP 19 | } 20 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/drawable/ic_error_circle.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/ic_description_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/ic_description_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/drawable/ic_event.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/layout/layout_split.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/layout/layout_pre_flow.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/layout/layout_pre_txn.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/item_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/values/array.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | VISA 6 | MASTERCARD 7 | AMEX 8 | 9 | 10 | 11 | card 12 | cash 13 | bitcoin 14 | 15 | 16 | 17 | GBP 18 | EUR 19 | USD 20 | 21 | 22 | -------------------------------------------------------------------------------- /payment-initiation-api/src/test/resources/error_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "request": { 3 | "id": "d5766283-2853-4e0d-aa6a-e0d6999f9ed4", 4 | "amounts": { 5 | "base": { 6 | "value": 1000, 7 | "currency": "GBP" 8 | }, 9 | "tip": { 10 | "value": 0, 11 | "currency": "GBP" 12 | }, 13 | "other": { 14 | "value": 0, 15 | "currency": "GBP" 16 | } 17 | }, 18 | "currency": "GBP", 19 | "type": "pay" 20 | }, 21 | "transactions": [ 22 | ], 23 | "options": { 24 | }, 25 | "errorCode": "678", 26 | "status": "COMPLETE" 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/layout/layout_select_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/layout/layout_payment_response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /PaymentServiceSample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/ic_help_outline_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/layout/fragment_json_display.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /FlowServiceSample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /sample-commons/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /PaymentServiceSample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /flow-base-api/src/main/java/com/aevi/sdk/flow/model/DeviceAudience.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.aevi.sdk.flow.model; 16 | 17 | /** 18 | * Represents the audience of a device. 19 | */ 20 | public enum DeviceAudience { 21 | MERCHANT, 22 | CUSTOMER 23 | } 24 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/values-sw720dp/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Flow Service Sample - Pre-transaction 5 | Flow Service Sample - Loyalty Balance 6 | Flow Service Sample - Pre-flow 7 | Flow Service Sample - Post-transaction 8 | Flow Service Sample - Post-card-reading 9 | Flow Service Sample - Post-flow 10 | Flow Service Sample - Split 11 | Cancel payment 12 | Process split 13 | bypass split 14 | -------------------------------------------------------------------------------- /PaymentInitiationSample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 12 | 13 | 17 | 18 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/layout/snippet_recycler_view_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /PaymentInitiationSample/src/main/res/values/array.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tokenisation 6 | reversal 7 | receiptDelivery 8 | showLoyaltyPointsBalance 9 | basketStatusUpdate 10 | batchClosure 11 | 12 | 13 | 14 | @string/receipts_cash 15 | @string/receipts_redeliver 16 | 17 | 18 | 19 | 10.00 20 | 10.00, tip: 5.00 21 | 10.00, cashback: 5.00 22 | 10.00, tip: 5.00, cashback: 2.50 23 | 0.00 24 | 25 | 26 | -------------------------------------------------------------------------------- /payment-initiation-api/src/main/java/com/aevi/sdk/pos/flow/model/events/FinalAmountStatusType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.aevi.sdk.pos.flow.model.events; 15 | 16 | /** 17 | * Enum representing final amount response statuses 18 | */ 19 | public enum FinalAmountStatusType { 20 | KNOWN, 21 | UNKNOWN, 22 | ABORT 23 | } 24 | -------------------------------------------------------------------------------- /flow-base-api/src/main/java/com/aevi/sdk/flow/constants/InternalDataKeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.aevi.sdk.flow.constants; 16 | 17 | /** 18 | * Keys for internal data. 19 | */ 20 | public interface InternalDataKeys { 21 | 22 | String FLOW_STAGE = "flowStage"; 23 | String FLOW_INITIATOR = "flowInitiator"; 24 | } 25 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/layout/snippet_list_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /flow-base-api/src/main/java/com/aevi/sdk/flow/constants/ResponseMechanisms.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.aevi.sdk.flow.constants; 16 | 17 | /** 18 | * Collection of supported response mechanism. 19 | */ 20 | public interface ResponseMechanisms { 21 | String MESSENGER_CONNECTION = "messengerConnection"; 22 | String RESPONSE_SERVICE = "responseService"; 23 | } 24 | -------------------------------------------------------------------------------- /flow-base-api/src/main/java/com/aevi/sdk/flow/model/config/FlowAppConditions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.aevi.sdk.flow.model.config; 16 | 17 | /** 18 | * Conditions that can be associated with a flow app for it to be eligible to be called in a flow. 19 | */ 20 | public interface FlowAppConditions { 21 | 22 | String OUTCOME_PARTIALLY_FULFILLED = "outcomePartiallyFulfilled"; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /payment-initiation-api/src/test/java/com/aevi/sdk/pos/flow/model/events/ReceiptTest.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.pos.flow.model.events; 2 | 3 | import com.aevi.sdk.flow.model.FlowEvent; 4 | 5 | import org.junit.Test; 6 | 7 | import static com.aevi.sdk.flow.constants.events.FlowEventTypes.EVENT_RECEIPT; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | public class ReceiptTest { 11 | 12 | @Test 13 | public void canSerialiseAsPayload() { 14 | String receiptText = "{ \"blah\": \"blah\" }"; 15 | Receipt receipt = new Receipt("customer", receiptText); 16 | receipt.setReceiptData("json", receiptText); 17 | FlowEvent fe = new FlowEvent(EVENT_RECEIPT, receipt); 18 | 19 | String json = fe.toJson(); 20 | System.out.println(json); 21 | FlowEvent result = FlowEvent.fromJson(json); 22 | 23 | Receipt resultData = result.getEventData(Receipt.class); 24 | assertThat(resultData).isEqualTo(receipt); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/values-sw720dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 40dp 6 | 16dp 7 | 4dp 8 | 6dp 9 | 6dp 10 | 11 | 25dp 12 | 13 | 22sp 14 | 200dp 15 | 3dp 16 | 17 | 300dp 18 | 3dp 19 | 30dp 20 | 18sp 21 | 0dp 22 | 50dp 23 | -------------------------------------------------------------------------------- /payment-initiation-api/src/test/java/com/aevi/sdk/pos/flow/model/CardTest.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.pos.flow.model; 2 | 3 | 4 | import org.junit.Test; 5 | 6 | import static org.assertj.core.api.Java6Assertions.assertThat; 7 | 8 | public class CardTest { 9 | 10 | @Test(expected = IllegalArgumentException.class) 11 | public void shouldNotAllowPanWithMoreThan10Digits() throws Exception { 12 | new Card("1234567890123456", "Mr T", "0102", null, null); 13 | } 14 | 15 | @Test 16 | public void shouldAllowPanWithLessThan10Digits() throws Exception { 17 | Card card = new Card("123456789XXXXXX", "Mr T", "0102", null, null); 18 | assertThat(card.getMaskedPan()).isEqualTo("123456789XXXXXX"); 19 | } 20 | 21 | @Test 22 | public void shouldFormatExpiryDateCorrectly() throws Exception { 23 | Card card = new Card("123456789XXXXXX", "Mr T", "2010", null, null); 24 | assertThat(card.getFormattedExpiryDate("MM/yyyy")).isEqualTo("10/2020"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample-commons/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 19 | 20 | 21 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /payment-flow-service-api/src/test/java/com/aevi/sdk/pos/flow/model/FlowResponseTest.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.pos.flow.model; 2 | 3 | 4 | import org.junit.Test; 5 | 6 | public class FlowResponseTest { 7 | 8 | @Test(expected = IllegalArgumentException.class) 9 | public void shouldNotAllowAmountsPaidLargerThanUpdatedAmounts() throws Exception { 10 | FlowResponse flowResponse = new FlowResponse(); 11 | 12 | flowResponse.updateRequestAmounts(new Amounts(1000, "GBP")); 13 | flowResponse.setAmountsPaid(new Amounts(2000, "GBP"), "cash"); 14 | flowResponse.validate(); 15 | } 16 | 17 | @Test(expected = IllegalArgumentException.class) 18 | public void shouldNotAllowDifferentAmountCurrencies() throws Exception { 19 | FlowResponse flowResponse = new FlowResponse(); 20 | 21 | flowResponse.setAmountsPaid(new Amounts(1000, "GBP"), "cash"); 22 | flowResponse.updateRequestAmounts(new Amounts(1000, "EUR")); 23 | flowResponse.validate(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.github/workflows/pr-build-test.yml: -------------------------------------------------------------------------------- 1 | name: Build & Test Pull Requests 2 | 3 | env: 4 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 5 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 6 | GITHUB_ACTOR: ${{ secrets.CI_BOT_USERNAME }} 7 | GITHUB_TOKEN: ${{ secrets.CI_BOT_PAT }} 8 | 9 | on: 10 | pull_request: 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | 20 | - name: Cache Gradle Dependencies 21 | uses: actions/cache@v2 22 | with: 23 | path: | 24 | ~/.gradle/caches 25 | ~/.gradle/wrapper 26 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} 27 | restore-keys: | 28 | ${{ runner.os }}-gradle- 29 | 30 | - name: Set up JDK 11 31 | uses: actions/setup-java@v2 32 | with: 33 | distribution: zulu 34 | java-version: 11 35 | 36 | - name: Build 37 | run: ./gradlew build 38 | -------------------------------------------------------------------------------- /payment-flow-service-api/src/test/java/com/aevi/sdk/pos/flow/model/TransactionResponseBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.pos.flow.model; 2 | 3 | 4 | import org.junit.Test; 5 | 6 | import static org.assertj.core.api.Java6Assertions.assertThat; 7 | 8 | public class TransactionResponseBuilderTest { 9 | 10 | @Test(expected = IllegalArgumentException.class) 11 | public void shouldThrowIllegalArgumentIfIdNotSet() throws Exception { 12 | new TransactionResponseBuilder(null).approve().build(); 13 | } 14 | 15 | @Test(expected = IllegalArgumentException.class) 16 | public void shouldThrowIllegalArgumentIfOutcomeNotSet() throws Exception { 17 | new TransactionResponseBuilder("1234").build(); 18 | } 19 | 20 | @Test 21 | public void checkIsValid() { 22 | TransactionResponseBuilder trb = new TransactionResponseBuilder("1234"); 23 | 24 | assertThat(trb.isValid()).isFalse(); 25 | 26 | trb.approve(); 27 | 28 | assertThat(trb.isValid()).isTrue(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #Thu, 09 Dec 2021 10:51:20 +0000 2 | # Project-wide Gradle settings. 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | # For more details on how to configure your build environment visit 7 | # http://www.gradle.org/docs/current/userguide/build_environment.html 8 | # Specifies the JVM arguments used for the daemon process. 9 | # The setting is particularly useful for tweaking memory settings. 10 | org.gradle.jvmargs=-Xmx1536m 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | # App versioning - This is overridden by CI during builds based on tags 16 | android.useAndroidX=true 17 | android.enableJetifier=true 18 | version_major=2 19 | version_minor=4 20 | version_patch=0 21 | version_suffix=-SNAPSHOT 22 | version_build_counter=1 23 | -------------------------------------------------------------------------------- /flow-base-api/src/test/java/com/aevi/sdk/flow/ContextHelper.java: -------------------------------------------------------------------------------- 1 | package com.aevi.sdk.flow; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.pm.PackageInfo; 6 | import android.content.pm.PackageManager; 7 | 8 | import static org.mockito.Matchers.anyInt; 9 | import static org.mockito.Matchers.anyString; 10 | import static org.mockito.Mockito.mock; 11 | import static org.mockito.Mockito.when; 12 | 13 | public class ContextHelper { 14 | 15 | public static Context mockContext(String packageName, String version) throws PackageManager.NameNotFoundException { 16 | Context context = mock(Context.class); 17 | PackageManager packageManager = mock(PackageManager.class); 18 | when(context.getPackageName()).thenReturn(packageName); 19 | when(context.getPackageManager()).thenReturn(packageManager); 20 | PackageInfo packageInfo = new PackageInfo(); 21 | packageInfo.versionName = version; 22 | when(packageManager.getPackageInfo(anyString(), anyInt())).thenReturn(packageInfo); 23 | return context; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sample-commons/src/main/res/drawable/item_background_states.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /FlowServiceSample/src/main/res/layout/view_pre_flow_fields.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 |