Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
71 changed files
with
519 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BIN
+26.9 KB
app/src/main/close_button-playstore.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package com.mobile.emvpay; | ||
|
||
import android.app.PendingIntent; | ||
import android.content.Intent; | ||
import android.nfc.NfcAdapter; | ||
import android.nfc.Tag; | ||
import android.nfc.tech.IsoDep; | ||
import android.os.Bundle; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import java.io.IOException; | ||
|
||
public class PaymentActivity extends AppCompatActivity { | ||
|
||
private NfcAdapter nfcAdapter; | ||
private PendingIntent pendingIntent; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.payment_activity); | ||
|
||
nfcAdapter = NfcAdapter.getDefaultAdapter(this); | ||
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
if (nfcAdapter != null) { | ||
nfcAdapter.enableForegroundDispatch(this, pendingIntent, null, null); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
if (nfcAdapter != null) { | ||
nfcAdapter.disableForegroundDispatch(this); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onNewIntent(Intent intent) { | ||
super.onNewIntent(intent); | ||
|
||
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); | ||
if (tag != null) { | ||
IsoDep isoDep = IsoDep.get(tag); | ||
if (isoDep != null) { | ||
// Process the payment card with IsoDep | ||
processPaymentCard(isoDep); | ||
} | ||
} | ||
} | ||
|
||
private void processPaymentCard(IsoDep isoDep) { | ||
try { | ||
isoDep.connect(); | ||
|
||
// PPSE command | ||
byte[] ppseCommand = { | ||
// Your PPSE command bytes | ||
}; | ||
byte[] ppseResponse = isoDep.transceive(ppseCommand); | ||
|
||
// Parse the response and extract AID | ||
|
||
// SELECT AID command | ||
byte[] selectAidCommand = { | ||
// Your SELECT AID command bytes with the extracted AID | ||
}; | ||
byte[] selectAidResponse = isoDep.transceive(selectAidCommand); | ||
|
||
// GPO command | ||
byte[] gpoCommand = { | ||
// Your GPO command bytes | ||
}; | ||
byte[] gpoResponse = isoDep.transceive(gpoCommand); | ||
|
||
// Process the GPO response | ||
|
||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} finally { | ||
try { | ||
isoDep.close(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.mobile.emvpay.models; | ||
|
||
import java.math.BigDecimal; | ||
|
||
public class TransactionDetails { | ||
|
||
private String transactionId; | ||
private BigDecimal checkoutTotal; | ||
|
||
public String getTransactionId() { | ||
return transactionId; | ||
} | ||
|
||
public void setTransactionId(String transactionId) { | ||
this.transactionId = transactionId; | ||
} | ||
|
||
public BigDecimal getCheckoutTotal() { | ||
return checkoutTotal; | ||
} | ||
|
||
public void setCheckoutTotal(BigDecimal checkoutTotal) { | ||
this.checkoutTotal = checkoutTotal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="18dp" | ||
android:height="18dp" | ||
android:viewportWidth="18" | ||
android:viewportHeight="18" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M9,1C4.58,1 1,4.58 1,9s3.58,8 8,8 8,-3.58 8,-8 -3.58,-8 -8,-8zM13,11.87L11.87,13 9,10.13 6.13,13 5,11.87 7.87,9 5,6.13 6.13,5 9,7.87 11.87,5 13,6.13 10.13,9 13,11.87z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="36dp" | ||
android:height="36dp" | ||
android:viewportWidth="36" | ||
android:viewportHeight="36" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M18,3C9.71,3 3,9.71 3,18s6.71,15 15,15 15,-6.71 15,-15S26.29,3 18,3zM25.5,23.38l-2.12,2.12L18,20.12l-5.38,5.38 -2.12,-2.12L15.88,18l-5.38,-5.38 2.12,-2.12L18,15.88l5.38,-5.38 2.12,2.12L20.12,18l5.38,5.38z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24" | ||
android:tint="?attr/colorControlNormal"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:state_pressed="true"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="#DADADA" /> | ||
<corners android:radius="1dp" /> | ||
</shape> | ||
</item> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@android:color/transparent" /> | ||
<corners android:radius="1dp" /> | ||
</shape> | ||
</item> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:color="?android:attr/colorControlHighlight"> | ||
<item android:id="@android:id/mask"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@android:color/black" /> | ||
<corners android:radius="4dp" /> | ||
</shape> | ||
</item> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@android:color/white" /> | ||
<corners android:radius="4dp" /> | ||
</shape> | ||
</item> | ||
</ripple> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<vector | ||
android:height="108dp" | ||
android:width="108dp" | ||
android:viewportHeight="108" | ||
android:viewportWidth="108" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#3DDC84" | ||
android:pathData="M0,0h108v108h-108z"/> | ||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89" | ||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -12,5 +12,5 @@ | ||
android:bottom="1dp" | ||
android:top="1dp" /> | ||
|
||
<corners android:radius="5dp" /> | ||
<corners android:radius="1dp" /> | ||
</shape> |
Oops, something went wrong.