├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── android
├── .gitignore
├── .idea
│ ├── .name
│ ├── caches
│ │ └── build_file_checksums.ser
│ ├── codeStyles
│ │ └── Project.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── runConfigurations.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── maugost
│ │ └── com
│ │ └── paystackflutter
│ │ ├── PayStackMainActivity.java
│ │ ├── PaystackFlutterPlugin.java
│ │ └── creditcarddesign
│ │ ├── CardEditActivity.java
│ │ ├── CardSelector.java
│ │ ├── CreditCardUtils.java
│ │ ├── CreditCardView.java
│ │ ├── FlipAnimator.java
│ │ ├── pager
│ │ ├── CardCVVFragment.java
│ │ ├── CardExpiryFragment.java
│ │ ├── CardFragmentAdapter.java
│ │ ├── CardNameFragment.java
│ │ ├── CardNumberFragment.java
│ │ ├── CreditCardFragment.java
│ │ ├── IActionListener.java
│ │ └── IFocus.java
│ │ └── views
│ │ └── HeightWrappingViewPager.java
│ └── res
│ ├── drawable-hdpi
│ ├── gradient_line1.xml
│ ├── ic_back.png
│ ├── ic_checkmark.png
│ ├── ic_next.png
│ └── ic_password.png
│ ├── drawable
│ ├── card_color_round_rect_blue.xml
│ ├── card_color_round_rect_brown.xml
│ ├── card_color_round_rect_default.xml
│ ├── card_color_round_rect_green.xml
│ ├── card_color_round_rect_pink.xml
│ ├── card_color_round_rect_purple.xml
│ ├── chip.xml
│ ├── chip_inner.xml
│ ├── chip_yellow.xml
│ ├── chip_yellow_inner.xml
│ ├── circle_blue3.xml
│ ├── circle_white.xml
│ ├── curve_blue09_a.xml
│ ├── curve_blue09_b.xml
│ ├── curve_blue09_button.xml
│ ├── curve_blue3.xml
│ ├── discover_back.xml
│ ├── discover_back_bg.xml
│ ├── ic_billing_amex_logo.png
│ ├── ic_billing_amex_logo1.png
│ ├── ic_billing_discover_logo.png
│ ├── ic_billing_mastercard_logo.png
│ ├── ic_billing_visa_logo.png
│ ├── img_amex_center_face.png
│ ├── launch_background.xml
│ ├── master_back.xml
│ ├── mastercard_back_bg.xml
│ ├── red_button.xml
│ ├── sign_strip.png
│ ├── sign_strip_mod.xml
│ ├── visacard_back.xml
│ └── visacard_back_bg.xml
│ ├── layout
│ ├── activity_card_edit.xml
│ ├── activity_main.xml
│ ├── back_card.xml
│ ├── front_card.xml
│ ├── front_card_outline.xml
│ ├── lyt_card_cvv.xml
│ ├── lyt_card_expiry.xml
│ ├── lyt_card_holder_name.xml
│ ├── lyt_card_number.xml
│ └── view_creditcard.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── example
├── .gitignore
├── .idea
│ ├── libraries
│ │ ├── Dart_SDK.xml
│ │ └── Flutter_for_Android.xml
│ ├── modules.xml
│ ├── runConfigurations
│ │ └── main_dart.xml
│ └── workspace.xml
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── .idea
│ │ ├── caches
│ │ │ └── build_file_checksums.ser
│ │ ├── codeStyles
│ │ │ └── Project.xml
│ │ ├── gradle.xml
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ └── runConfigurations.xml
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── maugost
│ │ │ │ └── com
│ │ │ │ └── paystackflutterexample
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── Runner
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── main.m
├── lib
│ └── main.dart
├── paystack_flutter_example.iml
├── paystack_flutter_example_android.iml
└── pubspec.yaml
├── ios
├── .gitignore
├── Assets
│ └── .gitkeep
├── Classes
│ ├── PaystackFlutterPlugin.h
│ └── PaystackFlutterPlugin.m
└── paystack_flutter.podspec
├── lib
└── paystack_flutter.dart
├── paystack_flutter.iml
├── paystack_flutter_android.iml
├── pubspec.yaml
├── sc2.png
├── sc3.png
├── sc4.png
├── sc5.png
├── sc6.png
├── sc7.png
└── scr1.png
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 | pubspec.lock
7 |
8 | build/
9 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - Release 5/16/18
2 | * A Paystack Plugin for Flutter Developers to receiving payments in their flutter apps. currently android supported(Still working on the ios), written in dart.
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Paystack Flutter Plugin
2 |
3 | A Paystack Plugin for flutter developers for receiving payments online(Android currently supported, still working on the ios).
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
10 | For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).
11 |
12 | ## Screenshots
13 |
14 |
15 | ## Usage
16 |
17 | To use this package :
18 |
19 | ```yaml
20 | dependencies:
21 | flutter:
22 | sdk: flutter
23 | paystack_flutter:
24 |
25 | ## Connecting to Paystack
26 | First, you should create define your paystack variables `PAYSTACK_PUBLIC_KEY` and `BACKEND_URL` like this :
27 |
28 |
29 | ```dart
30 | static const paystack_pub_key = "Your_Paystack_Public_Key";
31 | static const paystack_backend_url = "https://infinite-peak-60063.herokuapp.com";
32 | ```
33 |
34 |
35 | After the variables have been defined create a new function or method `connectPaystack` which is used to initialize flutter channel :
36 |
37 | ```yaml
38 | connectPaystack() async {
39 | String result;
40 | try {
41 | result = await PaystackFlutter.connectToPaystack({
42 | "NAME": "Your Name",
43 | "EMAIL": "you@email.com",
44 | "AMOUNT": 100,
45 | "CURRENCY": "NGN",
46 | "PAYMENT_FOR": "Testing API",
47 | "PAYSTACK_PUBLIC_KEY":paystack_pub_key,
48 | "BACKEND_URL": paystack_backend_url,
49 | });
50 | } on PlatformException catch (e) {
51 | result = e.message;
52 | print(e.message);
53 | }
54 |
55 |
56 | if (!mounted) return;
57 |
58 | setState(() {
59 | transcation = result;
60 | });
61 | }
62 | ```
63 |
64 |
65 |
66 | ## Paystack Channel Response codes
67 |
68 | Listen for response via the result, with the response you can do as use please
69 |
70 | ```yaml
71 | } on PlatformException catch (e) {
72 | result = e.message;
73 | print(e.message);
74 | }
75 | ```
76 |
77 |
78 | For Successful transaction result is `SUCCESSFULL`
79 | For Failed transaction result is `UNSUCCESSFULL`
80 |
81 |
82 | ## Complete Code Setup example
83 |
84 | ```yaml
85 |
86 | import 'package:flutter/material.dart';
87 | import 'package:flutter/services.dart';
88 | import 'package:paystack_flutter/paystack_flutter.dart';
89 |
90 | void main() => runApp(new MyApp());
91 |
92 | class MyApp extends StatefulWidget {
93 | @override
94 | _MyAppState createState() => new _MyAppState();
95 | }
96 |
97 | class _MyAppState extends State {
98 | String transcation = 'No transcation Yet';
99 | Map _data = {};
100 |
101 | static const platform = const MethodChannel('maugost.com/paystack_flutter');
102 | static const paystack_pub_key = "Your_Paystack_Public_Key";
103 | static const paystack_backend_url =
104 | "https://infinite-peak-60063.herokuapp.com";
105 |
106 | @override
107 | initState() {
108 | super.initState();
109 | }
110 |
111 | @override
112 | Widget build(BuildContext context) {
113 | return new MaterialApp(
114 | home: new Scaffold(
115 | appBar: new AppBar(
116 | title: new Text('Flutter Paystack '),
117 | ),
118 | body: new Center(
119 | child: Column(
120 | mainAxisAlignment: MainAxisAlignment.center,
121 | children: [
122 | new Text(transcation),
123 | new Padding(
124 | padding: const EdgeInsets.all(10.0),
125 | child: new RaisedButton(
126 | child: new Text("Pay with Paystack N100"),
127 | onPressed: connectPaystack,
128 | ),
129 | ),
130 | ],
131 | ),
132 | ),
133 | ),
134 | );
135 | }
136 |
137 | connectPaystack() async {
138 | String result;
139 | try {
140 | result = await PaystackFlutter.connectToPaystack({
141 | "NAME": "Your Name",
142 | "EMAIL": "you@email.com",
143 | "AMOUNT": 100,
144 | "CURRENCY": "NGN",
145 | "PAYMENT_FOR": "Testing API",
146 | "PAYSTACK_PUBLIC_KEY": paystack_pub_key,
147 | "BACKEND_URL": paystack_backend_url,
148 | });
149 | } on PlatformException catch (e) {
150 | result = e.message;
151 | print(e.message);
152 | }
153 |
154 | if (!mounted) return;
155 |
156 | setState(() {
157 | transcation = result;
158 | });
159 | }
160 | }
161 | ```
162 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/android/.idea/.name:
--------------------------------------------------------------------------------
1 | paystack_flutter
--------------------------------------------------------------------------------
/android/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/android/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
--------------------------------------------------------------------------------
/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'maugost.com.paystackflutter'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 |
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.1.2'
12 | classpath 'com.google.gms:google-services:3.2.0'
13 | classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0'
14 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
15 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
16 | }
17 | }
18 |
19 | rootProject.allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 | maven {
24 | url "https://jitpack.io"
25 | }
26 | }
27 | }
28 |
29 | apply plugin: 'com.android.library'
30 |
31 | android {
32 | compileSdkVersion 27
33 |
34 | defaultConfig {
35 | minSdkVersion 16
36 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
37 | }
38 | lintOptions {
39 | disable 'InvalidPackage'
40 | }
41 |
42 | dependencies {
43 | compile 'co.paystack.android:paystack:3.0.10'
44 | compile "com.android.support:appcompat-v7:27.1.1"
45 | compile "com.android.support:cardview-v7:27.1.1"
46 | compile 'com.github.ozodrukh:CircularReveal:1.3.1'
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed May 16 00:44:30 WAT 2018
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-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'paystack_flutter'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/PaystackFlutterPlugin.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.widget.Toast;
7 |
8 | import java.util.HashMap;
9 | import java.util.Map;
10 |
11 | import io.flutter.app.FlutterActivity;
12 | import io.flutter.plugin.common.MethodCall;
13 | import io.flutter.plugin.common.MethodChannel;
14 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
15 | import io.flutter.plugin.common.MethodChannel.Result;
16 | import io.flutter.plugin.common.PluginRegistry;
17 | import maugost.com.paystackflutter.creditcarddesign.CardEditActivity;
18 | import maugost.com.paystackflutter.creditcarddesign.CreditCardUtils;
19 |
20 | import static android.app.Activity.RESULT_OK;
21 | import static maugost.com.paystackflutter.creditcarddesign.CreditCardUtils.EMAIL;
22 |
23 |
24 | /**
25 | * PaystackFlutterPlugin
26 | */
27 | public class PaystackFlutterPlugin implements MethodCallHandler, PluginRegistry.ActivityResultListener {
28 |
29 | private static final int PAYSTACK_REQUEST_CODE = 1000;
30 | private Activity activity;
31 | private Context context;
32 | private Result pendingResult;
33 | private MethodCall methodCall;
34 |
35 |
36 | //
37 | private PaystackFlutterPlugin(PluginRegistry.Registrar registrar) {
38 | //this.registrar = registrar;
39 | this.activity = registrar.activity();
40 | this.context = registrar.context();
41 |
42 | }
43 |
44 | public static void registerWith(PluginRegistry.Registrar registrar) {
45 | final MethodChannel channel = new MethodChannel(registrar.messenger(), "maugost.com/paystack_flutter");
46 | PaystackFlutterPlugin instance = new PaystackFlutterPlugin(registrar);
47 | registrar.addActivityResultListener(instance);
48 | channel.setMethodCallHandler(instance);
49 | }
50 |
51 | @Override
52 | public void onMethodCall(MethodCall call, Result result) {
53 |
54 | /* if (paystack_public_key.isEmpty()) {
55 | result.error("PAYSTACK ERROR", "Paystack needs your public key", null);
56 | return;
57 | }*/
58 |
59 | this.pendingResult = result;
60 | this.methodCall = call;
61 |
62 |
63 | if (call.method.equals("getPlatformVersion")) {
64 |
65 | if (!methodCall.hasArgument("PAYSTACK_PUBLIC_KEY")) {
66 | result.error("PAYSTACK ERROR", "Paystack needs your public key", null);
67 | return;
68 | }
69 |
70 | if (!methodCall.hasArgument("BACKEND_URL")) {
71 | result.error("PAYSTACK ERROR", "Paystack needs your backend url", null);
72 | return;
73 | }
74 |
75 | if (!methodCall.hasArgument("NAME")) {
76 | result.error("PAYSTACK ERROR", "Paystack needs your name", null);
77 | return;
78 | }
79 |
80 | if (!methodCall.hasArgument("EMAIL")) {
81 | result.error("PAYSTACK ERROR", "Paystack needs your email", null);
82 | return;
83 | }
84 |
85 | if (!methodCall.hasArgument("AMOUNT")) {
86 | result.error("PAYSTACK ERROR", "Paystack needs your amount", null);
87 | return;
88 | }
89 |
90 | if (!methodCall.hasArgument("CURRENCY")) {
91 | result.error("PAYSTACK ERROR", "Paystack needs your currency", null);
92 | return;
93 | }
94 |
95 | if (!methodCall.hasArgument("PAYMENT_FOR")) {
96 | result.error("PAYSTACK ERROR", "Paystack needs your payment for", null);
97 | return;
98 | }
99 |
100 | String paystack_public_key = null;
101 | if (methodCall.hasArgument("PAYSTACK_PUBLIC_KEY")) {
102 | paystack_public_key = methodCall.argument("PAYSTACK_PUBLIC_KEY").toString();
103 | //Toast.makeText(activity, currency, Toast.LENGTH_SHORT).show();
104 | }
105 |
106 | String backend_url = null;
107 | if (methodCall.hasArgument("BACKEND_URL")) {
108 | backend_url = methodCall.argument("BACKEND_URL").toString();
109 | //Toast.makeText(activity, paymentfor, Toast.LENGTH_SHORT).show();
110 | }
111 |
112 | String name = null;
113 | if (methodCall.hasArgument("NAME")) {
114 | name = methodCall.argument("NAME").toString();
115 | //Toast.makeText(activity, name, Toast.LENGTH_SHORT).show();
116 | }
117 |
118 | String email = null;
119 | if (methodCall.hasArgument("EMAIL")) {
120 | email = methodCall.argument("EMAIL").toString();
121 | //Toast.makeText(activity, email, Toast.LENGTH_SHORT).show();
122 | }
123 |
124 | String amount = null;
125 | if (methodCall.hasArgument("AMOUNT")) {
126 | amount = methodCall.argument("AMOUNT").toString();
127 | //Toast.makeText(activity, amount, Toast.LENGTH_SHORT).show();
128 | }
129 |
130 | String currency = null;
131 | if (methodCall.hasArgument("CURRENCY")) {
132 | currency = methodCall.argument("CURRENCY").toString();
133 | //Toast.makeText(activity, currency, Toast.LENGTH_SHORT).show();
134 | }
135 |
136 | String paymentfor = null;
137 | if (methodCall.hasArgument("PAYMENT_FOR")) {
138 | paymentfor = methodCall.argument("PAYMENT_FOR").toString();
139 | //Toast.makeText(activity, paymentfor, Toast.LENGTH_SHORT).show();
140 | }
141 |
142 | Intent intent = new Intent(context, CardEditActivity.class);
143 | intent.putExtra(CreditCardUtils.PAYSTACK_API, paystack_public_key);
144 | intent.putExtra(CreditCardUtils.BACKEND_URL, backend_url);
145 | intent.putExtra(EMAIL, email);
146 | intent.putExtra(CreditCardUtils.AMOUNT, amount);
147 | intent.putExtra(CreditCardUtils.CURRENCY, currency);
148 | intent.putExtra(CreditCardUtils.PAYMENT_FOR, paymentfor);
149 | intent.putExtra(CreditCardUtils.POSITION, 0);
150 | activity.startActivityForResult(intent, PAYSTACK_REQUEST_CODE);
151 | } else {
152 | result.notImplemented();
153 | }
154 | }
155 |
156 |
157 | @Override
158 | public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
159 | if (requestCode == PAYSTACK_REQUEST_CODE) {
160 | if (data != null && resultCode == RESULT_OK) {
161 | pendingResult.success("SUCCESSFULL");
162 | } else {
163 | pendingResult.error("UNSUCCESSFULL","UNSUCCESSFULL","UNSUCCESSFULL");
164 | //Toast.makeText(activity, "Bck pressed", Toast.LENGTH_SHORT).show();
165 | }
166 | pendingResult = null;
167 | methodCall = null;
168 | return true;
169 | }
170 | return false;
171 | }
172 |
173 |
174 | }
175 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/CardSelector.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign;
2 |
3 | import maugost.com.paystackflutter.R;
4 |
5 | /**
6 | * Created by Harish on 01/01/16.
7 | */
8 | public class CardSelector {
9 |
10 | public static final CardSelector VISA = new CardSelector(R.drawable.card_color_round_rect_purple, R.drawable.chip, R.drawable.chip_inner, android.R.color.transparent, R.drawable.ic_billing_visa_logo, CardSelector.CVV_LENGHT_DEFAULT);
11 | public static final CardSelector MASTER = new CardSelector(R.drawable.card_color_round_rect_pink, R.drawable.chip_yellow, R.drawable.chip_yellow_inner, android.R.color.transparent, R.drawable.ic_billing_mastercard_logo, CardSelector.CVV_LENGHT_DEFAULT);
12 | public static final CardSelector AMEX = new CardSelector(R.drawable.card_color_round_rect_green, android.R.color.transparent, android.R.color.transparent, R.drawable.img_amex_center_face, R.drawable.ic_billing_amex_logo1, CardSelector.CVV_LENGHT_AMEX);
13 | public static final CardSelector DISCOVER = new CardSelector(R.drawable.card_color_round_rect_brown, android.R.color.transparent, android.R.color.transparent, android.R.color.transparent, R.drawable.ic_billing_discover_logo, CardSelector.CVV_LENGHT_DEFAULT);
14 | public static final CardSelector DEFAULT = new CardSelector(R.drawable.card_color_round_rect_default, R.drawable.chip, R.drawable.chip_inner, android.R.color.transparent, android.R.color.transparent, CardSelector.CVV_LENGHT_DEFAULT);
15 |
16 | public static final int CVV_LENGHT_DEFAULT = 3;
17 | public static final int CVV_LENGHT_AMEX = 4;
18 |
19 |
20 | private int mResCardId;
21 | private int mResChipOuterId;
22 | private int mResChipInnerId;
23 | private int mResCenterImageId;
24 | private int mResLogoId;
25 | private int mCvvLength = CVV_LENGHT_DEFAULT;
26 |
27 | public CardSelector(int mDrawableCard, int mDrawableChipOuter, int mDrawableChipInner, int mDrawableCenterImage, int logoId, int cvvLength) {
28 | this.mResCardId = mDrawableCard;
29 | this.mResChipOuterId = mDrawableChipOuter;
30 | this.mResChipInnerId = mDrawableChipInner;
31 | this.mResCenterImageId = mDrawableCenterImage;
32 | this.mResLogoId = logoId;
33 | this.mCvvLength = cvvLength;
34 | }
35 |
36 | public int getResCardId() {
37 | return mResCardId;
38 | }
39 |
40 | public void setResCardId(int mResCardId) {
41 | this.mResCardId = mResCardId;
42 | }
43 |
44 | public int getResChipOuterId() {
45 | return mResChipOuterId;
46 | }
47 |
48 | public void setResChipOuterId(int mResChipOuterId) {
49 | this.mResChipOuterId = mResChipOuterId;
50 | }
51 |
52 | public int getResChipInnerId() {
53 | return mResChipInnerId;
54 | }
55 |
56 | public void setResChipInnerId(int mResChipInnerId) {
57 | this.mResChipInnerId = mResChipInnerId;
58 | }
59 |
60 | public int getResCenterImageId() {
61 | return mResCenterImageId;
62 | }
63 |
64 | public void setResCenterImageId(int mResCenterImageId) {
65 | this.mResCenterImageId = mResCenterImageId;
66 | }
67 |
68 | public int getResLogoId() {
69 | return mResLogoId;
70 | }
71 |
72 | public void setResLogoId(int mResLogoId) {
73 | this.mResLogoId = mResLogoId;
74 | }
75 |
76 | public int getCvvLength() {
77 | return mCvvLength;
78 | }
79 |
80 | public void setCvvLength(int mCvvLength) {
81 | this.mCvvLength = mCvvLength;
82 | }
83 |
84 | public static CardSelector selectCardType(CreditCardUtils.CardType cardType) {
85 | switch(cardType) {
86 | case AMEX_CARD:
87 | return AMEX;
88 | case DISCOVER_CARD:
89 | return DISCOVER;
90 | case MASTER_CARD:
91 | return MASTER;
92 | case VISA_CARD:
93 | return VISA;
94 | default:
95 | return DEFAULT;
96 | }
97 | }
98 |
99 | public static CardSelector selectCard(String cardNumber) {
100 | if (cardNumber != null && cardNumber.length() >= 1) {
101 | CreditCardUtils.CardType cardType = CreditCardUtils.selectCardType(cardNumber);
102 | CardSelector selector = selectCardType(cardType);
103 |
104 | if ((selector != DEFAULT) && (cardNumber.length() >= 3)) {
105 | int[] drawables = {R.drawable.card_color_round_rect_brown, R.drawable.card_color_round_rect_green, R.drawable.card_color_round_rect_pink, R.drawable.card_color_round_rect_purple, R.drawable.card_color_round_rect_blue};
106 | int hash = cardNumber.substring(0, 3).hashCode();
107 |
108 | if (hash < 0) {
109 | hash = hash * -1;
110 | }
111 |
112 | int index = hash % drawables.length;
113 |
114 | int chipIndex = hash % 3;
115 | int[] chipOuter = {R.drawable.chip, R.drawable.chip_yellow, android.R.color.transparent};
116 | int[] chipInner = {R.drawable.chip_inner, R.drawable.chip_yellow_inner, android.R.color.transparent};
117 |
118 | selector.setResCardId(drawables[index]);
119 | selector.setResChipOuterId(chipOuter[chipIndex]);
120 | selector.setResChipInnerId(chipInner[chipIndex]);
121 |
122 | return selector;
123 | }
124 | }
125 |
126 | return DEFAULT;
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/CreditCardUtils.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign;
2 |
3 | import android.support.annotation.NonNull;
4 |
5 | import java.util.Calendar;
6 | import java.util.regex.Pattern;
7 |
8 | /**
9 | * Created by Harish on 03/01/16.
10 | */
11 | public class CreditCardUtils {
12 | public enum CardType {
13 | UNKNOWN_CARD, AMEX_CARD, MASTER_CARD, VISA_CARD, DISCOVER_CARD
14 | }
15 |
16 | private static final String PATTERN_AMEX = "^3(4|7)[0-9 ]*";
17 | private static final String PATTERN_VISA = "^4[0-9 ]*";
18 | private static final String PATTERN_MASTER = "^5[0-9 ]*";
19 | private static final String PATTERN_DISCOVER = "^6[0-9 ]*";
20 |
21 | public static final int MAX_LENGTH_CARD_NUMBER = 16;
22 | public static final int MAX_LENGTH_CARD_NUMBER_AMEX = 15;
23 |
24 | public static final String CARD_NUMBER_FORMAT = "XXXX XXXX XXXX XXXX";
25 | public static final String CARD_NUMBER_FORMAT_AMEX = "XXXX XXXXXX XXXXX";
26 |
27 | public static final String PAYSTACK_API = "paystackAPI";
28 | public static final String BACKEND_URL = "backendURL";
29 | public static final String TRANSACTION_ID = "transactionID";
30 | public static final String EMAIL = "email";
31 | public static final String PAYMENT_FOR = "payment_for";
32 | public static final String POSITION = "position";
33 | public static final String AMOUNT = "amount";
34 | public static final String CURRENCY = "currency";
35 | public static final String EXTRA_CARD_NUMBER = "card_number";
36 | public static final String EXTRA_CARD_CVV = "card_cvv";
37 | public static final String EXTRA_CARD_EXPIRY = "card_expiry";
38 | public static final String EXTRA_CARD_HOLDER_NAME = "card_holder_name";
39 | public static final String EXTRA_CARD_SHOW_CARD_SIDE = "card_side";
40 | public static final String EXTRA_VALIDATE_EXPIRY_DATE = "expiry_date";
41 | public static final String EXTRA_ENTRY_START_PAGE = "start_page";
42 |
43 | public static final int CARD_SIDE_FRONT = 1,CARD_SIDE_BACK=0;
44 |
45 | public static final int CARD_NUMBER_PAGE = 0, CARD_EXPIRY_PAGE = 1;
46 | public static final int CARD_CVV_PAGE = 3, CARD_NAME_PAGE = 2;
47 |
48 | public static final String SPACE_SEPERATOR = " ";
49 | public static final String SLASH_SEPERATOR = "/";
50 | public static final char CHAR_X = 'X';
51 |
52 | public static String handleCardNumber(String inputCardNumber) {
53 |
54 | return handleCardNumber(inputCardNumber,SPACE_SEPERATOR);
55 | }
56 |
57 | public static CardType selectCardType(String cardNumber) {
58 | Pattern pCardType = Pattern.compile(PATTERN_VISA);
59 | if(pCardType.matcher(cardNumber).matches())
60 | return CardType.VISA_CARD;
61 | pCardType = Pattern.compile(PATTERN_MASTER);
62 | if(pCardType.matcher(cardNumber).matches())
63 | return CardType.MASTER_CARD;
64 | pCardType = Pattern.compile(PATTERN_AMEX);
65 | if(pCardType.matcher(cardNumber).matches())
66 | return CardType.AMEX_CARD;
67 | pCardType = Pattern.compile(PATTERN_DISCOVER);
68 | if(pCardType.matcher(cardNumber).matches())
69 | return CardType.DISCOVER_CARD;
70 | return CardType.UNKNOWN_CARD;
71 | }
72 |
73 | public static int selectCardLength(CardType cardType) {
74 | return cardType == CardType.AMEX_CARD ? MAX_LENGTH_CARD_NUMBER_AMEX : MAX_LENGTH_CARD_NUMBER;
75 | }
76 |
77 | public static String handleCardNumber(String inputCardNumber, String seperator) {
78 | String unformattedText = inputCardNumber.replace(seperator, "");
79 | CardType cardType = selectCardType(inputCardNumber);
80 | String format = (cardType == CardType.AMEX_CARD) ? CARD_NUMBER_FORMAT_AMEX : CARD_NUMBER_FORMAT;
81 | StringBuilder sbFormattedNumber = new StringBuilder();
82 | for(int iIdx = 0, jIdx = 0; (iIdx < format.length()) && (unformattedText.length() > jIdx); iIdx++) {
83 | if(format.charAt(iIdx) == CHAR_X)
84 | sbFormattedNumber.append(unformattedText.charAt(jIdx++));
85 | else
86 | sbFormattedNumber.append(format.charAt(iIdx));
87 | }
88 |
89 | return sbFormattedNumber.toString();
90 | }
91 |
92 | public static String formatCardNumber(String inputCardNumber, String seperator) {
93 | String unformattedText = inputCardNumber.replace(seperator, "");
94 | CardType cardType = selectCardType(inputCardNumber);
95 | String format = (cardType == CardType.AMEX_CARD) ? CARD_NUMBER_FORMAT_AMEX : CARD_NUMBER_FORMAT;
96 | StringBuilder sbFormattedNumber = new StringBuilder();
97 | for(int iIdx = 0, jIdx = 0; iIdx < format.length(); iIdx++) {
98 | if((format.charAt(iIdx) == CHAR_X) && (unformattedText.length() > jIdx))
99 | sbFormattedNumber.append(unformattedText.charAt(jIdx++));
100 | else
101 | sbFormattedNumber.append(format.charAt(iIdx));
102 | }
103 |
104 | return sbFormattedNumber.toString().replace(SPACE_SEPERATOR, SPACE_SEPERATOR + SPACE_SEPERATOR);
105 | }
106 |
107 | public static String handleExpiration(String month, String year) {
108 |
109 | return handleExpiration(month+year);
110 | }
111 |
112 |
113 | public static String handleExpiration(@NonNull String dateYear) {
114 |
115 | String expiryString = dateYear.replace(SLASH_SEPERATOR, "");
116 |
117 | String text;
118 | if(expiryString.length() >= 2) {
119 | String mm = expiryString.substring(0, 2);
120 | String yy;
121 | text = mm;
122 |
123 | try {
124 | if (Integer.parseInt(mm) > 12) {
125 | mm = "12"; // Cannot be more than 12.
126 | }
127 | }
128 | catch (Exception e) {
129 | mm = "01";
130 | }
131 |
132 | if(expiryString.length() >=4) {
133 | yy = expiryString.substring(2,4);
134 |
135 | try{
136 | Integer.parseInt(yy);
137 | }catch (Exception e) {
138 |
139 | Calendar calendar = Calendar.getInstance();
140 | int year = calendar.get(Calendar.YEAR);
141 | yy = String.valueOf(year).substring(2);
142 | }
143 |
144 | text = mm + SLASH_SEPERATOR + yy;
145 |
146 | }
147 | else if(expiryString.length() > 2){
148 | yy = expiryString.substring(2);
149 | text = mm + SLASH_SEPERATOR + yy;
150 | }
151 | }
152 | else {
153 | text = expiryString;
154 | }
155 |
156 | return text;
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/FlipAnimator.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign;
2 |
3 | import android.graphics.Camera;
4 | import android.graphics.Matrix;
5 | import android.view.View;
6 | import android.view.animation.AccelerateDecelerateInterpolator;
7 | import android.view.animation.Animation;
8 | import android.view.animation.Transformation;
9 |
10 | public class FlipAnimator extends Animation {
11 |
12 | public static final int DIRECTION_X = 1, DIRECTION_Y = 2, DIRECTION_Z = 3;
13 | private Camera camera;
14 |
15 | private View fromView;
16 |
17 | private View toView;
18 |
19 | private final float centerX;
20 |
21 | private final float centerY;
22 |
23 | private boolean forward = true;
24 |
25 | private boolean visibilitySwapped;
26 |
27 | private int rotationDirection = DIRECTION_X;
28 |
29 | private int translateDirection = DIRECTION_Z;
30 |
31 | /**
32 | * Creates a 3D flip animation between two views. If forward is true, its
33 | * assumed that view1 is "visible" and view2 is "gone" before the animation
34 | * starts. At the end of the animation, view1 will be "gone" and view2 will
35 | * be "visible". If forward is false, the reverse is assumed.
36 | *
37 | * @param fromView First view in the transition.
38 | * @param toView Second view in the transition.
39 | * @param centerX The center of the views in the x-axis.
40 | * @param centerY The center of the views in the y-axis.
41 | */
42 | public FlipAnimator(View fromView, View toView, int centerX, int centerY) {
43 | this.fromView = fromView;
44 | this.toView = toView;
45 | this.centerX = centerX;
46 | this.centerY = centerY;
47 |
48 | setDuration(500);
49 | setFillAfter(true);
50 | setInterpolator(new AccelerateDecelerateInterpolator());
51 | }
52 |
53 | public int getRotationDirection() {
54 | return rotationDirection;
55 | }
56 |
57 | public void setRotationDirection(int rotationDirection) {
58 | this.rotationDirection = rotationDirection;
59 | }
60 |
61 | public int getTranslateDirection() {
62 | return translateDirection;
63 | }
64 |
65 | public void setTranslateDirection(int translateDirection) {
66 | this.translateDirection = translateDirection;
67 | }
68 |
69 | public void reverse() {
70 | forward = false;
71 | View temp = toView;
72 | toView = fromView;
73 | fromView = temp;
74 | }
75 |
76 | @Override
77 | public void initialize(int width, int height, int parentWidth, int parentHeight) {
78 | super.initialize(width, height, parentWidth, parentHeight);
79 | camera = new Camera();
80 | }
81 |
82 | @Override
83 | protected void applyTransformation(float interpolatedTime, Transformation t) {
84 | // Angle around the y-axis of the rotation at the given time. It is
85 | // calculated both in radians and in the equivalent degrees.
86 | final double radians = Math.PI * interpolatedTime;
87 | float degrees = (float) (180.0 * radians / Math.PI);
88 |
89 | // Once we reach the midpoint in the animation, we need to hide the
90 | // source view and show the destination view. We also need to change
91 | // the angle by 180 degrees so that the destination does not come in
92 | // flipped around. This is the main problem with SDK sample, it does not
93 | // do this.
94 | if (interpolatedTime >= 0.5f) {
95 | degrees -= 180.f;
96 |
97 | if (!visibilitySwapped) {
98 | fromView.setVisibility(View.GONE);
99 | toView.setVisibility(View.VISIBLE);
100 |
101 | visibilitySwapped = true;
102 | }
103 | }
104 |
105 | if (forward)
106 | degrees = -degrees;
107 |
108 | final Matrix matrix = t.getMatrix();
109 |
110 | camera.save();
111 |
112 | if(translateDirection == DIRECTION_Z) {
113 | camera.translate(0.0f, 0.0f, (float) (150.0 * Math.sin(radians)));
114 | }
115 | else if(translateDirection == DIRECTION_Y) {
116 | camera.translate(0.0f, (float) (150.0 * Math.sin(radians)), 0.0f);
117 | }
118 | else {
119 | camera.translate( (float) (150.0 * Math.sin(radians)), 0.0f, 0.0f);
120 | }
121 |
122 | if(rotationDirection == DIRECTION_Z) {
123 | camera.rotateZ(degrees);
124 | }
125 | else if(rotationDirection == DIRECTION_Y) {
126 | camera.rotateY(degrees);
127 | }
128 | else {
129 | camera.rotateX(degrees);
130 | }
131 |
132 | camera.getMatrix(matrix);
133 | camera.restore();
134 |
135 | matrix.preTranslate(-centerX, -centerY);
136 | matrix.postTranslate(centerX, centerY);
137 | }
138 | }
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/CardCVVFragment.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.text.Editable;
6 | import android.text.InputFilter;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.EditText;
11 |
12 | import maugost.com.paystackflutter.R;
13 | import maugost.com.paystackflutter.creditcarddesign.CardEditActivity;
14 | import maugost.com.paystackflutter.creditcarddesign.CardSelector;
15 |
16 | import static maugost.com.paystackflutter.creditcarddesign.CreditCardUtils.EXTRA_CARD_CVV;
17 |
18 |
19 | /**
20 | * Created by sharish on 9/1/15.
21 | */
22 | public class CardCVVFragment extends CreditCardFragment {
23 |
24 |
25 | private int mMaxCVV = CardSelector.CVV_LENGHT_DEFAULT;
26 |
27 | CardEditActivity cardEditActivity;
28 |
29 | @Override
30 | public void onCreate(@Nullable Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | cardEditActivity = (CardEditActivity)getActivity();
33 | }
34 |
35 |
36 | public CardCVVFragment() {
37 | }
38 |
39 | public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle state) {
40 | View v = inflater.inflate(R.layout.lyt_card_cvv, group, false);
41 | cardEditActivity.mCardCVVView = (EditText) v.findViewById(R.id.card_cvv);
42 |
43 | String cvv = null;
44 | if (getArguments() != null && getArguments().containsKey(EXTRA_CARD_CVV)) {
45 | cvv = getArguments().getString(EXTRA_CARD_CVV);
46 | }
47 |
48 | if (cvv == null) {
49 | cvv = "";
50 | }
51 |
52 | cardEditActivity.mCardCVVView.setText(cvv);
53 | cardEditActivity.mCardCVVView.addTextChangedListener(this);
54 |
55 | return v;
56 | }
57 |
58 | @Override
59 | public void afterTextChanged(Editable s) {
60 | onEdit(s.toString());
61 | if (s.length() == mMaxCVV) {
62 | cardEditActivity.setKeyboardVisibility(false);
63 | cardEditActivity.proceed_but.setVisibility(View.VISIBLE);
64 | //onComplete();
65 | }else{
66 | cardEditActivity.proceed_but.setVisibility(View.GONE);
67 | }
68 | }
69 |
70 | @Override
71 | public void focus() {
72 | if (isAdded()) {
73 | cardEditActivity.mCardCVVView.selectAll();
74 | }
75 | }
76 |
77 | public void setMaxCVV(int maxCVVLength) {
78 | if (cardEditActivity.mCardCVVView != null && (cardEditActivity.mCardCVVView.getText().toString().length() > maxCVVLength)) {
79 | cardEditActivity.mCardCVVView.setText(cardEditActivity.mCardCVVView.getText().toString().substring(0, maxCVVLength));
80 | }
81 |
82 | InputFilter[] FilterArray = new InputFilter[1];
83 | FilterArray[0] = new InputFilter.LengthFilter(maxCVVLength);
84 | cardEditActivity.mCardCVVView.setFilters(FilterArray);
85 | mMaxCVV = maxCVVLength;
86 | String hintCVV = "";
87 | for (int i = 0; i < maxCVVLength; i++) {
88 | hintCVV += "X";
89 | }
90 | cardEditActivity.mCardCVVView.setHint(hintCVV);
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/CardExpiryFragment.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.text.Editable;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.EditText;
10 |
11 |
12 | import maugost.com.paystackflutter.R;
13 | import maugost.com.paystackflutter.creditcarddesign.CardEditActivity;
14 | import maugost.com.paystackflutter.creditcarddesign.CreditCardUtils;
15 |
16 | import java.util.Calendar;
17 |
18 | import static maugost.com.paystackflutter.creditcarddesign.CreditCardUtils.*;
19 |
20 |
21 | /**
22 | * Created by sharish on 9/1/15.
23 | */
24 | public class CardExpiryFragment extends CreditCardFragment {
25 |
26 |
27 |
28 | private boolean mValidateCard = true;
29 |
30 | CardEditActivity cardEditActivity;
31 |
32 | @Override
33 | public void onCreate(@Nullable Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | cardEditActivity = (CardEditActivity)getActivity();
36 | }
37 |
38 |
39 | public CardExpiryFragment() {
40 |
41 | }
42 |
43 | public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle state) {
44 |
45 | View v = inflater.inflate(R.layout.lyt_card_expiry, group, false);
46 | cardEditActivity.cardExpiryView = (EditText) v.findViewById(R.id.card_expiry);
47 |
48 | String expiry = "";
49 |
50 | Bundle args = getArguments();
51 |
52 | if(args != null) {
53 |
54 | if(args.containsKey(EXTRA_CARD_EXPIRY)) {
55 | expiry = getArguments().getString(EXTRA_CARD_EXPIRY);
56 | }
57 |
58 | mValidateCard = args.getBoolean(EXTRA_VALIDATE_EXPIRY_DATE, true);
59 | }
60 |
61 | if(expiry == null) {
62 | expiry = "";
63 | }
64 |
65 | cardEditActivity.cardExpiryView.setText(expiry);
66 |
67 | cardEditActivity.cardExpiryView.addTextChangedListener(this);
68 |
69 | return v;
70 | }
71 |
72 | @Override
73 | public void afterTextChanged(Editable s) {
74 |
75 | String text = s.toString().replace(CreditCardUtils.SLASH_SEPERATOR, "");
76 |
77 | String month, year="";
78 | if(text.length() >= 2) {
79 | month = text.substring(0, 2);
80 |
81 | if(text.length() > 2) {
82 | year = text.substring(2);
83 | }
84 |
85 | if(mValidateCard) {
86 | int mm = Integer.parseInt(month);
87 |
88 | if (mm <= 0 || mm >= 13) {
89 | cardEditActivity.cardExpiryView.setError(getString(R.string.error_invalid_month));
90 | return;
91 | }
92 |
93 | if (text.length() >= 4) {
94 |
95 | int yy = Integer.parseInt(year);
96 |
97 | final Calendar calendar = Calendar.getInstance();
98 | int currentYear = calendar.get(Calendar.YEAR);
99 | int currentMonth = calendar.get(Calendar.MONTH) + 1;
100 |
101 | int millenium = (currentYear / 1000) * 1000;
102 |
103 |
104 | if (yy + millenium < currentYear) {
105 | cardEditActivity.cardExpiryView.setError(getString(R.string.error_card_expired));
106 | return;
107 | } else if (yy + millenium == currentYear && mm < currentMonth) {
108 | cardEditActivity.cardExpiryView.setError(getString(R.string.error_card_expired));
109 | return;
110 | }
111 | }
112 | }
113 |
114 | }
115 | else {
116 | month = text;
117 | }
118 |
119 | int previousLength = cardEditActivity.cardExpiryView.getText().length();
120 | int cursorPosition = cardEditActivity.cardExpiryView.getSelectionEnd();
121 |
122 | text = CreditCardUtils.handleExpiration(month,year);
123 |
124 | cardEditActivity.cardExpiryView.removeTextChangedListener(this);
125 | cardEditActivity.cardExpiryView.setText(text);
126 | cardEditActivity.cardExpiryView.setSelection(text.length());
127 | cardEditActivity.cardExpiryView.addTextChangedListener(this);
128 |
129 | int modifiedLength = text.length();
130 |
131 | if(modifiedLength <= previousLength && cursorPosition < modifiedLength) {
132 | cardEditActivity.cardExpiryView.setSelection(cursorPosition);
133 | }
134 |
135 | onEdit(text);
136 |
137 | if(text.length() == 5) {
138 | onComplete();
139 | }
140 |
141 | }
142 |
143 |
144 | @Override
145 | public void focus() {
146 |
147 | if(isAdded()) {
148 | cardEditActivity.cardExpiryView.selectAll();
149 | }
150 | }
151 |
152 |
153 | public void onSaveInstanceState(Bundle outState) {
154 |
155 | outState.putBoolean(EXTRA_VALIDATE_EXPIRY_DATE, mValidateCard);
156 | super.onSaveInstanceState(outState);
157 | }
158 |
159 | public void onActivityCreated(Bundle instate) {
160 |
161 | if(instate != null) {
162 | mValidateCard = instate.getBoolean(EXTRA_VALIDATE_EXPIRY_DATE, mValidateCard);
163 | }
164 |
165 | super.onActivityCreated(instate);
166 | }
167 | }
168 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/CardFragmentAdapter.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | import android.os.Bundle;
4 | import android.os.Parcelable;
5 | import android.support.v4.app.Fragment;
6 | import android.support.v4.app.FragmentManager;
7 | import android.support.v4.app.FragmentStatePagerAdapter;
8 |
9 | /**
10 | * Created by sharish on 9/1/15.
11 | */
12 | public class CardFragmentAdapter extends FragmentStatePagerAdapter implements IActionListener {
13 |
14 | public void focus(int position) {
15 | ((IFocus) getItem(position)).focus();
16 | }
17 |
18 | public interface ICardEntryCompleteListener {
19 | void onCardEntryComplete(int currentIndex);
20 |
21 | void onCardEntryEdit(int currentIndex, String entryValue);
22 | }
23 |
24 | private final CardNumberFragment mCardNumberFragment;
25 | private final CardExpiryFragment mCardExpiryFragment;
26 | private final CardCVVFragment mCardCVVFragment;
27 | private final CardNameFragment mCardNameFragment;
28 |
29 | private ICardEntryCompleteListener mCardEntryCompleteListener;
30 |
31 | public CardFragmentAdapter(FragmentManager fm, Bundle args) {
32 | super(fm);
33 |
34 | mCardCVVFragment = new CardCVVFragment();
35 | mCardCVVFragment.setArguments(args);
36 |
37 | mCardNameFragment = new CardNameFragment();
38 | mCardNameFragment.setArguments(args);
39 |
40 | mCardNumberFragment = new CardNumberFragment();
41 | mCardNumberFragment.setArguments(args);
42 |
43 | mCardExpiryFragment = new CardExpiryFragment();
44 | mCardExpiryFragment.setArguments(args);
45 |
46 | mCardNameFragment.setActionListener(this);
47 | mCardNumberFragment.setActionListener(this);
48 | mCardExpiryFragment.setActionListener(this);
49 | mCardCVVFragment.setActionListener(this);
50 | }
51 |
52 | public void setOnCardEntryCompleteListener(ICardEntryCompleteListener listener) {
53 | this.mCardEntryCompleteListener = listener;
54 | }
55 |
56 | @Override
57 | public Fragment getItem(int position) {
58 | return new Fragment[]{mCardNumberFragment, mCardExpiryFragment, mCardNameFragment,mCardCVVFragment}[position];
59 | }
60 |
61 | @Override
62 | public int getCount() {
63 | return 4;
64 | }
65 |
66 |
67 | @Override
68 | public void onActionComplete(CreditCardFragment fragment) {
69 | int index = getIndex(fragment);
70 | if (index >= 0 && mCardEntryCompleteListener != null) {
71 | mCardEntryCompleteListener.onCardEntryComplete(index);
72 | }
73 | }
74 |
75 | public int getIndex(CreditCardFragment fragment) {
76 | int index = -1;
77 | if (fragment == mCardNumberFragment) {
78 | index = 0;
79 | } else if (fragment == mCardExpiryFragment) {
80 | index = 1;
81 | } else if (fragment ==mCardNameFragment) {
82 | index = 2;
83 | } else if (fragment == mCardCVVFragment) {
84 | index = 3;
85 | }
86 |
87 | return index;
88 | }
89 |
90 | public void setMaxCVV(int maxCVV) {
91 | if (mCardCVVFragment != null) {
92 | mCardCVVFragment.setMaxCVV(maxCVV);
93 | }
94 | }
95 |
96 | @Override
97 | public void onEdit(CreditCardFragment fragment, String edit) {
98 | int index = getIndex(fragment);
99 |
100 | if (index >= 0 && mCardEntryCompleteListener != null) {
101 | mCardEntryCompleteListener.onCardEntryEdit(index, edit);
102 | }
103 | }
104 |
105 | @Override
106 | public void restoreState(Parcelable parcelable, ClassLoader classLoader) {
107 | //do nothing here! no call to super.restoreState(parcelable, classLoader);
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/CardNameFragment.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.text.Editable;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.EditText;
10 |
11 | import maugost.com.paystackflutter.R;
12 | import maugost.com.paystackflutter.creditcarddesign.CardEditActivity;
13 |
14 | import static maugost.com.paystackflutter.creditcarddesign.CreditCardUtils.EXTRA_CARD_HOLDER_NAME;
15 |
16 | /**
17 | * Created by sharish on 9/1/15.
18 | */
19 | public class CardNameFragment extends CreditCardFragment {
20 |
21 |
22 | CardEditActivity cardEditActivity;
23 |
24 | @Override
25 | public void onCreate(@Nullable Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | cardEditActivity = (CardEditActivity)getActivity();
28 | }
29 |
30 |
31 | public CardNameFragment() {
32 |
33 | }
34 |
35 | public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle state) {
36 |
37 | View v = inflater.inflate(R.layout.lyt_card_holder_name, group,false);
38 | cardEditActivity.mCardNameView = (EditText) v.findViewById(R.id.card_name);
39 |
40 | String name = "";
41 | if(getArguments() != null && getArguments().containsKey(EXTRA_CARD_HOLDER_NAME)) {
42 | name = getArguments().getString(EXTRA_CARD_HOLDER_NAME);
43 | }
44 |
45 |
46 | if(name == null) {
47 | name = "";
48 | }
49 |
50 | cardEditActivity.mCardNameView.setText(name);
51 | cardEditActivity.mCardNameView.addTextChangedListener(this);
52 |
53 | return v;
54 | }
55 |
56 | @Override
57 | public void afterTextChanged(Editable s) {
58 |
59 | onEdit(s.toString());
60 | if(s.length() == getResources().getInteger(R.integer.card_name_len)) {
61 | onComplete();
62 | }
63 | }
64 |
65 | @Override
66 | public void focus() {
67 |
68 | if(isAdded()) {
69 | cardEditActivity.mCardNameView.selectAll();
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/CardNumberFragment.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.text.Editable;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.EditText;
10 |
11 | import maugost.com.paystackflutter.R;
12 | import maugost.com.paystackflutter.creditcarddesign.CardEditActivity;
13 | import maugost.com.paystackflutter.creditcarddesign.CreditCardUtils;
14 |
15 | import static maugost.com.paystackflutter.creditcarddesign.CreditCardUtils.*;
16 |
17 | /**
18 | * Created by sharish on 9/1/15.
19 | */
20 | public class CardNumberFragment extends CreditCardFragment {
21 |
22 | CardEditActivity cardEditActivity;
23 |
24 | @Override
25 | public void onCreate(@Nullable Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | cardEditActivity = (CardEditActivity)getActivity();
28 | }
29 |
30 | public CardNumberFragment() {
31 | }
32 |
33 | public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle state) {
34 | View v = inflater.inflate(R.layout.lyt_card_number, group, false);
35 | cardEditActivity.mCardNumberView = (EditText) v.findViewById(R.id.card_number_field);
36 |
37 | String number = "";
38 |
39 | if (getArguments() != null && getArguments().containsKey(EXTRA_CARD_NUMBER)) {
40 | number = getArguments().getString(EXTRA_CARD_NUMBER);
41 | }
42 |
43 | if (number == null) {
44 | number = "";
45 | }
46 |
47 | cardEditActivity.mCardNumberView.setText(number);
48 | cardEditActivity.mCardNumberView.addTextChangedListener(this);
49 |
50 | return v;
51 | }
52 |
53 |
54 | @Override
55 | public void afterTextChanged(Editable s) {
56 | int cursorPosition = cardEditActivity.mCardNumberView.getSelectionEnd();
57 | int previousLength = cardEditActivity.mCardNumberView.getText().length();
58 |
59 | String cardNumber = CreditCardUtils.handleCardNumber(s.toString());
60 | int modifiedLength = cardNumber.length();
61 |
62 | cardEditActivity.mCardNumberView.removeTextChangedListener(this);
63 | cardEditActivity.mCardNumberView.setText(cardNumber);
64 | String rawCardNumber = cardNumber.replace(CreditCardUtils.SPACE_SEPERATOR, "");
65 | CreditCardUtils.CardType cardType = CreditCardUtils.selectCardType(rawCardNumber);
66 | int maxLengthWithSpaces = ((cardType == CreditCardUtils.CardType.AMEX_CARD) ? CARD_NUMBER_FORMAT_AMEX : CARD_NUMBER_FORMAT).length();
67 | cardEditActivity.mCardNumberView.setSelection(cardNumber.length() > maxLengthWithSpaces ? maxLengthWithSpaces : cardNumber.length());
68 | cardEditActivity.mCardNumberView.addTextChangedListener(this);
69 |
70 | if (modifiedLength <= previousLength && cursorPosition < modifiedLength) {
71 | cardEditActivity.mCardNumberView.setSelection(cursorPosition);
72 | }
73 |
74 | onEdit(cardNumber);
75 |
76 | if (rawCardNumber.length() == CreditCardUtils.selectCardLength(cardType)) {
77 | onComplete();
78 | }
79 | }
80 |
81 | @Override
82 | public void focus() {
83 | if (isAdded()) {
84 | cardEditActivity.mCardNumberView.selectAll();
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/CreditCardFragment.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.text.TextWatcher;
5 |
6 | /**
7 | * Created by sharish on 9/1/15.
8 | */
9 | public abstract class CreditCardFragment extends Fragment implements TextWatcher, IFocus {
10 |
11 | protected IActionListener mActionListener;
12 |
13 | public void setActionListener(IActionListener listener) {
14 | mActionListener = listener;
15 | }
16 |
17 | @Override
18 | public void beforeTextChanged(CharSequence s, int start, int count, int after) {
19 |
20 | }
21 |
22 | @Override
23 | public void onTextChanged(CharSequence s, int start, int before, int count) {
24 |
25 | }
26 |
27 |
28 | public void onEdit(String edit) {
29 |
30 | if(mActionListener != null) {
31 | mActionListener.onEdit(this,edit);
32 | }
33 |
34 | }
35 |
36 | public void onComplete() {
37 |
38 | if(mActionListener != null) {
39 | mActionListener.onActionComplete(this);
40 | }
41 |
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/IActionListener.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | public interface IActionListener {
4 | void onActionComplete(CreditCardFragment fragment);
5 | void onEdit(CreditCardFragment fragment, String edit);
6 |
7 | }
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/pager/IFocus.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.pager;
2 |
3 | /**
4 | * Created by Harish on 17/01/16.
5 | */
6 | public interface IFocus {
7 | void focus();
8 | }
9 |
--------------------------------------------------------------------------------
/android/src/main/java/maugost/com/paystackflutter/creditcarddesign/views/HeightWrappingViewPager.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutter.creditcarddesign.views;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 |
8 | public class HeightWrappingViewPager extends ViewPager {
9 |
10 | public HeightWrappingViewPager(Context context) {
11 | super(context);
12 | }
13 |
14 | public HeightWrappingViewPager(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | @Override
19 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
20 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
21 | View firstChild = getChildAt(0);
22 | firstChild.measure(widthMeasureSpec, heightMeasureSpec);
23 | super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(firstChild.getMeasuredHeight(), MeasureSpec.EXACTLY));
24 | }
25 | }
--------------------------------------------------------------------------------
/android/src/main/res/drawable-hdpi/gradient_line1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable-hdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable-hdpi/ic_back.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable-hdpi/ic_checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable-hdpi/ic_checkmark.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable-hdpi/ic_next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable-hdpi/ic_next.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable-hdpi/ic_password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable-hdpi/ic_password.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/card_color_round_rect_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/card_color_round_rect_brown.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/card_color_round_rect_default.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/card_color_round_rect_green.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/card_color_round_rect_pink.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/card_color_round_rect_purple.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/chip.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/chip_inner.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/chip_yellow.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/chip_yellow_inner.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/circle_blue3.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/circle_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/curve_blue09_a.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/curve_blue09_b.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/curve_blue09_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
11 |
15 |
17 |
18 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/curve_blue3.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/discover_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
20 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/discover_back_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/ic_billing_amex_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/ic_billing_amex_logo.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/ic_billing_amex_logo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/ic_billing_amex_logo1.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/ic_billing_discover_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/ic_billing_discover_logo.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/ic_billing_mastercard_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/ic_billing_mastercard_logo.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/ic_billing_visa_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/ic_billing_visa_logo.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/img_amex_center_face.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/img_amex_center_face.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | -
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/master_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
20 |
21 |
22 |
28 |
29 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/mastercard_back_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/red_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
11 |
15 |
17 |
18 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/sign_strip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/drawable/sign_strip.png
--------------------------------------------------------------------------------
/android/src/main/res/drawable/sign_strip_mod.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/visacard_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
11 |
12 |
13 | -
14 |
15 |
16 |
17 |
18 | -
19 |
20 |
21 |
22 |
23 |
24 |
25 | -
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/android/src/main/res/drawable/visacard_back_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/activity_card_edit.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
13 |
14 |
19 |
20 |
21 |
22 |
23 |
29 |
30 |
40 |
41 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
66 |
71 |
72 |
77 |
78 |
96 |
97 |
104 |
114 |
115 |
116 |
117 |
124 |
125 |
135 |
136 |
151 |
152 |
156 | />
157 |
171 |
172 |
173 |
180 |
181 |
182 |
183 |
192 |
193 |
204 |
205 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
234 |
235 |
243 |
244 |
251 |
263 |
264 |
265 |
266 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
287 |
294 |
295 |
296 |
297 |
302 |
310 |
311 |
312 |
313 |
314 |
315 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
18 |
19 |
26 |
27 |
37 |
38 |
48 |
49 |
50 |
55 |
56 |
69 |
70 |
83 |
84 |
92 |
100 |
101 |
102 |
111 |
112 |
121 |
122 |
123 |
124 |
125 |
134 |
135 |
144 |
145 |
155 |
156 |
157 |
158 |
159 |
160 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/back_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
30 |
31 |
40 |
41 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/front_card.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
16 |
34 |
35 |
36 |
37 |
54 |
55 |
60 |
61 |
66 |
67 |
77 |
78 |
94 |
95 |
96 |
97 |
98 |
99 |
104 |
105 |
115 |
116 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/front_card_outline.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
23 |
24 |
25 |
36 |
37 |
38 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/lyt_card_cvv.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
21 |
22 |
27 |
28 |
29 |
35 |
36 |
37 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/lyt_card_expiry.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
26 |
27 |
28 |
34 |
35 |
36 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/lyt_card_holder_name.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
26 |
27 |
28 |
34 |
35 |
36 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/lyt_card_number.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
25 |
26 |
27 |
33 |
34 |
35 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/android/src/main/res/layout/view_creditcard.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
24 |
25 |
26 |
27 |
28 |
29 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/android/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
8 | #1fc055
9 | #d4edfa
10 | #e0e4e4
11 | #fbe191
12 | #eed280
13 |
14 | #5515a9
15 | #651dc4
16 |
17 | #ff0000
18 | #e50000
19 | #cc0000
20 | #b20000
21 |
22 | #00000000
23 |
24 | #000000
25 | #fff3f3f3
26 |
27 | #8470ff
28 | #7664e5
29 | #6959cc
30 | #5c4eb2
31 | #4f4399
32 | #42387f
33 | #342c66
34 | #b1342c66
35 | #27214c
36 | #1a1633
37 | #0d0b19
38 | #000000
39 |
40 | #8470ff
41 | #907eff
42 | #928cff
43 | #a89aff
44 | #b5a9ff
45 | #c1b7ff
46 | #cdc5ff
47 | #dad4ff
48 | #06534949
49 | #08534949
50 |
51 | #ffffff
52 |
53 | #108b4c
54 | #1caf57
55 |
56 | #5D8BF2
57 | #3545AE
58 |
59 | #d04c84
60 | #d04882
61 |
62 | #363434
63 | #434141
64 |
65 | #800000
66 | #A52A2A
67 |
68 | @color/orange5
69 |
70 | #7f5200
71 |
72 | #7f5200
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/android/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 12dp
7 | 18dp
8 | 16dp
9 | 2dp
10 | 13sp
11 | 19sp
12 | 20sp
13 | 8dp
14 | 16dp
15 | 20dp
16 | 16sp
17 |
18 |
19 | #88FFFFFF
20 | #FBFBFB
21 | #ff9e9e9e
22 | #7F000000
23 | #FFFFFF
24 |
25 | 2dp
26 | 1dp
27 |
28 |
29 | 300dp
30 | 180dp
31 | 54dp
32 | 36dp
33 | 28dp
34 | 16dp
35 | 48dp
36 | 48dp
37 | 75dp
38 | 75dp
39 |
40 |
41 |
--------------------------------------------------------------------------------
/android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Paystack Example
3 |
4 | Hello world!
5 | Settings
6 | Card number
7 | CVV
8 | MM
9 | YYYY
10 | Create token
11 | No card yet
12 | No token
13 | Token was null
14 | Unable to get token
15 | 4123450131001381
16 | 883
17 | 01
18 | 2020
19 | No transaction yet
20 | Amount in Kobo
21 |
22 | NEXT
23 | PREVIOUS
24 | DONE
25 | JOHN MATTHEW
26 | CARD HOLDER
27 | EXPIRY
28 | MM/YY
29 | CARD EXPIRY
30 | MM/YY
31 | 0000
32 | NAME ON CARD
33 | Invalid month
34 | Card expired
35 | 25
36 |
37 |
--------------------------------------------------------------------------------
/android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
16 |
17 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/example/.idea/libraries/Dart_SDK.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/example/.idea/libraries/Flutter_for_Android.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/.idea/runConfigurations/main_dart.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/example/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 44b7e7d3f42f050a79712daab253af06e9daf530
8 | channel: beta
9 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # paystack_flutter_example
2 |
3 | Demonstrates how to use the paystack_flutter plugin.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/example/android/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/example/android/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/example/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/example/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example/android/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | apply plugin: 'com.android.application'
15 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
16 |
17 | android {
18 | compileSdkVersion 27
19 |
20 | lintOptions {
21 | disable 'InvalidPackage'
22 | }
23 |
24 | defaultConfig {
25 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
26 | applicationId "maugost.com.paystackflutterexample"
27 | minSdkVersion 16
28 | targetSdkVersion 27
29 | versionCode 1
30 | versionName "1.0"
31 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
32 | }
33 |
34 | buildTypes {
35 | release {
36 | // TODO: Add your own signing config for the release build.
37 | // Signing with the debug keys for now, so `flutter run --release` works.
38 | signingConfig signingConfigs.debug
39 | }
40 | }
41 | }
42 |
43 | flutter {
44 | source '../..'
45 | }
46 |
47 | dependencies {
48 | testImplementation 'junit:junit:4.12'
49 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
51 | api 'co.paystack.android:paystack:3.0.10'
52 | api "com.android.support:appcompat-v7:27.1.1"
53 | api "com.android.support:cardview-v7:27.1.1"
54 | api 'com.github.ozodrukh:CircularReveal:1.3.1'
55 | }
56 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
19 |
26 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/maugost/com/paystackflutterexample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package maugost.com.paystackflutterexample;
2 |
3 | import android.os.Bundle;
4 |
5 | import io.flutter.app.FlutterActivity;
6 | import io.flutter.plugins.GeneratedPluginRegistrant;
7 |
8 | public class MainActivity extends FlutterActivity {
9 | @Override
10 | protected void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | GeneratedPluginRegistrant.registerWith(this);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
8 | #1fc055
9 | #d4edfa
10 | #e0e4e4
11 | #fbe191
12 | #eed280
13 |
14 | #5515a9
15 | #651dc4
16 |
17 | #ff0000
18 | #e50000
19 | #cc0000
20 | #b20000
21 |
22 | #00000000
23 |
24 | #000000
25 | #fff3f3f3
26 |
27 | #8470ff
28 | #7664e5
29 | #6959cc
30 | #5c4eb2
31 | #4f4399
32 | #42387f
33 | #342c66
34 | #b1342c66
35 | #27214c
36 | #1a1633
37 | #0d0b19
38 | #000000
39 |
40 | #8470ff
41 | #907eff
42 | #928cff
43 | #a89aff
44 | #b5a9ff
45 | #c1b7ff
46 | #cdc5ff
47 | #dad4ff
48 | #06534949
49 | #08534949
50 |
51 | #ffffff
52 |
53 | #108b4c
54 | #1caf57
55 |
56 | #5D8BF2
57 | #3545AE
58 |
59 | #d04c84
60 | #d04882
61 |
62 | #363434
63 | #434141
64 |
65 | #800000
66 | #A52A2A
67 |
68 | @color/orange5
69 |
70 | #7f5200
71 |
72 | #7f5200
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 12dp
7 | 18dp
8 | 16dp
9 | 2dp
10 | 13sp
11 | 19sp
12 | 20sp
13 | 8dp
14 | 16dp
15 | 20dp
16 | 16sp
17 |
18 |
19 | #88FFFFFF
20 | #FBFBFB
21 | #ff9e9e9e
22 | #7F000000
23 | #FFFFFF
24 |
25 | 2dp
26 | 1dp
27 |
28 |
29 | 300dp
30 | 180dp
31 | 54dp
32 | 36dp
33 | 28dp
34 | 16dp
35 | 48dp
36 | 48dp
37 | 75dp
38 | 75dp
39 |
40 |
41 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Paystack Example
3 |
4 | Hello world!
5 | Settings
6 | Card number
7 | CVV
8 | MM
9 | YYYY
10 | Create token
11 | No card yet
12 | No token
13 | Token was null
14 | Unable to get token
15 | 4123450131001381
16 | 883
17 | 01
18 | 2020
19 | No transaction yet
20 | Amount in Kobo
21 |
22 | NEXT
23 | PREVIOUS
24 | DONE
25 | JOHN MATTHEW
26 | CARD HOLDER
27 | EXPIRY
28 | MM/YY
29 | CARD EXPIRY
30 | MM/YY
31 | 0000
32 | NAME ON CARD
33 | Invalid month
34 | Card expired
35 | 25
36 |
37 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.1.2'
9 | classpath 'com.google.gms:google-services:3.2.0'
10 | classpath 'org.robolectric:robolectric-gradle-plugin:1.1.0'
11 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
12 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | google()
19 | jcenter()
20 | maven {
21 | url "https://jitpack.io"
22 | }
23 | }
24 | }
25 |
26 | rootProject.buildDir = '../build'
27 | subprojects {
28 | project.buildDir = "${rootProject.buildDir}/${project.name}"
29 | }
30 | subprojects {
31 | project.evaluationDependsOn(':app')
32 | }
33 |
34 | task clean(type: Delete) {
35 | delete rootProject.buildDir
36 | }
37 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue May 15 19:46:56 WAT 2018
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-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | UIRequiredDeviceCapabilities
24 |
25 | arm64
26 |
27 | MinimumOSVersion
28 | 8.0
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
7 | [GeneratedPluginRegistrant registerWithRegistry:self];
8 | // Override point for customization after application launch.
9 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
10 | }
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | paystack_flutter_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | arm64
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/example/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/services.dart';
3 | import 'package:paystack_flutter/paystack_flutter.dart';
4 |
5 | void main() => runApp(new MyApp());
6 |
7 | class MyApp extends StatefulWidget {
8 | @override
9 | _MyAppState createState() => new _MyAppState();
10 | }
11 |
12 | class _MyAppState extends State {
13 | String transcation = 'No transcation Yet';
14 | Map _data = {};
15 |
16 | static const platform = const MethodChannel('maugost.com/paystack_flutter');
17 | static const paystack_pub_key = "Your_paystack_public_key";
18 | static const paystack_backend_url =
19 | "https://infinite-peak-60063.herokuapp.com";
20 |
21 | @override
22 | initState() {
23 | super.initState();
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | return new MaterialApp(
29 | home: new Scaffold(
30 | appBar: new AppBar(
31 | title: new Text('Flutter Paystack '),
32 | ),
33 | body: new Center(
34 | child: Column(
35 | mainAxisAlignment: MainAxisAlignment.center,
36 | children: [
37 | new Text(transcation),
38 | new Padding(
39 | padding: const EdgeInsets.all(10.0),
40 | child: new RaisedButton(
41 | child: new Text("Pay with Paystack N100"),
42 | onPressed: connectPaystack,
43 | ),
44 | ),
45 | ],
46 | ),
47 | ),
48 | ),
49 | );
50 | }
51 |
52 | connectPaystack() async {
53 | String result;
54 | try {
55 | result = await PaystackFlutter.connectToPaystack({
56 | "NAME": "Your Name",
57 | "EMAIL": "you@email.com",
58 | "AMOUNT": 100,
59 | "CURRENCY": "NGN",
60 | "PAYMENT_FOR": "Testing API",
61 | "PAYSTACK_PUBLIC_KEY": paystack_pub_key,
62 | "BACKEND_URL": paystack_backend_url,
63 | });
64 | } on PlatformException catch (e) {
65 | result = e.message;
66 | print(e.message);
67 | }
68 |
69 | if (!mounted) return;
70 |
71 | setState(() {
72 | transcation = result;
73 | });
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/example/paystack_flutter_example.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/paystack_flutter_example_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: paystack_flutter_example
2 | description: Demonstrates how to use the paystack_flutter plugin.
3 |
4 | dependencies:
5 | flutter:
6 | sdk: flutter
7 |
8 | # The following adds the Cupertino Icons font to your application.
9 | # Use with the CupertinoIcons class for iOS style icons.
10 | cupertino_icons: ^0.1.0
11 |
12 | dev_dependencies:
13 | flutter_test:
14 | sdk: flutter
15 |
16 | paystack_flutter:
17 | path: ../
18 |
19 | # For information on the generic Dart part of this file, see the
20 | # following page: https://www.dartlang.org/tools/pub/pubspec
21 |
22 | # The following section is specific to Flutter.
23 | flutter:
24 |
25 | # The following line ensures that the Material Icons font is
26 | # included with your application, so that you can use the icons in
27 | # the material Icons class.
28 | uses-material-design: true
29 |
30 | # To add assets to your application, add an assets section, like this:
31 | # assets:
32 | # - images/a_dot_burr.jpeg
33 | # - images/a_dot_ham.jpeg
34 |
35 | # An image asset can refer to one or more resolution-specific "variants", see
36 | # https://flutter.io/assets-and-images/#resolution-aware.
37 |
38 | # For details regarding adding assets from package dependencies, see
39 | # https://flutter.io/assets-and-images/#from-packages
40 |
41 | # To add custom fonts to your application, add a fonts section here,
42 | # in this "flutter" section. Each entry in this list should have a
43 | # "family" key with the font family name, and a "fonts" key with a
44 | # list giving the asset and other descriptors for the font. For
45 | # example:
46 | # fonts:
47 | # - family: Schyler
48 | # fonts:
49 | # - asset: fonts/Schyler-Regular.ttf
50 | # - asset: fonts/Schyler-Italic.ttf
51 | # style: italic
52 | # - family: Trajan Pro
53 | # fonts:
54 | # - asset: fonts/TrajanPro.ttf
55 | # - asset: fonts/TrajanPro_Bold.ttf
56 | # weight: 700
57 | #
58 | # For details regarding fonts from package dependencies,
59 | # see https://flutter.io/custom-fonts/#from-packages
60 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 |
--------------------------------------------------------------------------------
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/ios/Assets/.gitkeep
--------------------------------------------------------------------------------
/ios/Classes/PaystackFlutterPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface PaystackFlutterPlugin : NSObject
4 | @end
5 |
--------------------------------------------------------------------------------
/ios/Classes/PaystackFlutterPlugin.m:
--------------------------------------------------------------------------------
1 | #import "PaystackFlutterPlugin.h"
2 |
3 | @implementation PaystackFlutterPlugin
4 | + (void)registerWithRegistrar:(NSObject*)registrar {
5 | FlutterMethodChannel* channel = [FlutterMethodChannel
6 | methodChannelWithName:@"paystack_flutter"
7 | binaryMessenger:[registrar messenger]];
8 | PaystackFlutterPlugin* instance = [[PaystackFlutterPlugin alloc] init];
9 | [registrar addMethodCallDelegate:instance channel:channel];
10 | }
11 |
12 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
13 | if ([@"getPlatformVersion" isEqualToString:call.method]) {
14 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]);
15 | } else {
16 | result(FlutterMethodNotImplemented);
17 | }
18 | }
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/ios/paystack_flutter.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
3 | #
4 | Pod::Spec.new do |s|
5 | s.name = 'paystack_flutter'
6 | s.version = '0.0.1'
7 | s.summary = 'A new flutter plugin project.'
8 | s.description = <<-DESC
9 | A new flutter plugin project.
10 | DESC
11 | s.homepage = 'http://example.com'
12 | s.license = { :file => '../LICENSE' }
13 | s.author = { 'Your Company' => 'email@example.com' }
14 | s.source = { :path => '.' }
15 | s.source_files = 'Classes/**/*'
16 | s.public_header_files = 'Classes/**/*.h'
17 | s.dependency 'Flutter'
18 |
19 | s.ios.deployment_target = '8.0'
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/lib/paystack_flutter.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/services.dart';
4 |
5 | class PaystackFlutter {
6 | static const MethodChannel _channel =
7 | const MethodChannel('maugost.com/paystack_flutter');
8 |
9 | static Future get platformVersion async {
10 | final String version = await _channel.invokeMethod('getPlatformVersion');
11 | return version;
12 | }
13 |
14 | static Future connectToPaystack(Map args) async {
15 | final String version =
16 | await _channel.invokeMethod('getPlatformVersion', args);
17 | return version;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/paystack_flutter.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/paystack_flutter_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: paystack_flutter
2 | description: A Paystack Plugin for flutter developers for receiving payments online.
3 | version: 0.0.2
4 | author: Maugost Okore
5 | homepage: https://github.com/mtellect/Flutter_Paystack
6 |
7 | dependencies:
8 | flutter:
9 | sdk: flutter
10 |
11 | # For information on the generic Dart part of this file, see the
12 | # following page: https://www.dartlang.org/tools/pub/pubspec
13 |
14 | # The following section is specific to Flutter.
15 | flutter:
16 |
17 | environment:
18 | sdk: ">=2.0.0-dev.28.0 <3.0.0"
19 |
20 | plugin:
21 | androidPackage: maugost.com.paystackflutter
22 | pluginClass: PaystackFlutterPlugin
23 |
24 |
25 |
26 | # To add assets to your plugin package, add an assets section, like this:
27 | # assets:
28 | # - images/a_dot_burr.jpeg
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.io/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.io/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your plugin package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.io/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/sc2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/sc2.png
--------------------------------------------------------------------------------
/sc3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/sc3.png
--------------------------------------------------------------------------------
/sc4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/sc4.png
--------------------------------------------------------------------------------
/sc5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/sc5.png
--------------------------------------------------------------------------------
/sc6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/sc6.png
--------------------------------------------------------------------------------
/sc7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/sc7.png
--------------------------------------------------------------------------------
/scr1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mtellect/Flutter_Paystack/4e9fb62a649ad8baff8bbaaf30e589181f446ad8/scr1.png
--------------------------------------------------------------------------------