DEVELOPER

Payanywhere Android SDK Specification

Version 6.8.0

Payanywhere Android SDK

Sale

post /payment

This function processes a cash or credit-card sale.

Request

Add the following code where you would like to start Payanywhere payment processing (i.e., on button click):

private static final String PAYMENT_URL = "payanywhere://payment/";
private static final int PAYMENT_REQUEST_CODE = 123;

Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(PAYMENT_URL +  "?chargeAmount=2.73"));
startActivityForResult(intent, PAYMENT_REQUEST_CODE);

123 is the unique requestCode for this intent. When this code is executed, Payanywhere starts and will be ready to process a credit card transaction. If required, connect a credit-card reader and swipe/EMV/NFC/key the credit card. Payanywhere will handle the processing and ask for a signature. Proceed with the signature.

Additional flags may also be used, such as “payanywhere://payment/chargeAmount=2.73&customerTransactionId=123456&
invoiceNumber=654321&externalNotification=true" For more information, please refer to the "Example values for SDK" table on the Integration Guide page.

To process a cash transaction, include "payanywhere://payment/?chargeAmount=0.01&acceptCash=true". This will display the option "Accept Cash Sale" on the SDK Payment screen. Once the transaction is approved, if Receipt Share is enabled, proceed with sharing. Otherwise the transaction result will be sent to the client application.

Duplicate Transaction Handling

In the event that the same credit card is run for the same amount in a 30 minute timeframe, the server will return a flag indicating it is a duplicate. For this scenario the following steps will occur.

  1. All SDK responses will contain an extra with the key duplicate that will be set to either true or false depending on the response from the server.
  2. A dialog will be presented indicating that a duplicate transaction was detected and the user will have the option to select Void or Continue.
  3. In the case of selecting Void:
    • A Void will be processed.
    • The SDK response will add the extras that begin with duplicateVoid which will contain the transaction response for the Void transaction.
    • The SDK response will also contain the extras for the original transaction that was Voided in the normal SDK response extras.
  4. In the case of selecting Continue, the SDK response will contain the normal extras.

Response

To receive the transaction result on your app, add the following code to your activity:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
private static final String EXTRA_TRANSACTION_UNIQUE_ID = "transactionUniqueId";
private static final String EXTRA_RECEIPT_ID = "receiptId";
private static final String EXTRA_PARTIAL_AUTH = "isPartialAuth";
private static final String EXTRA_REQUESTED_AMOUNT = "requestedAmount";
private static final String EXTRA_AUTHORIZED_AMOUNT = "authorizedAmount";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";
private static final String EXTRA_CUSTOMER_TRANSACTION_ID ="customerTransactionId";
private static final String EXTRA_INVOICE_NUMER ="invoiceNumber";


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 if( requestCode ==PAYMENT_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 			showTransactionResponses(requestCode, resultCode, data);
 		} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
     String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 	 String transactionUniqueId = data.getStringExtra(EXTRA_TRANSACTION_UNIQUE_ID);
 	 long receiptId = data.getLongExtra(EXTRA_RECEIPT_ID, 0);
     String customerTransactionId = data.getStringExtra(EXTRA_CUSTOMER_TRANSACTION_ID); 
     String invoiceNumber = data.getStringExtra(EXTRA_INVOICE_NUMER); 
 	 String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 	 boolean isPartialAuth = data.getBooleanExtra(EXTRA_PARTIAL_AUTH, false);

     BigDecimal requestedAmount = null;
 	 if(data.getSerializableExtra(EXTRA_REQUESTED_AMOUNT) != null){
       requestedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_REQUESTED_AMOUNT);
     }
 	 BigDecimal authorizedAmount = null;
 	 if(data.getSerializableExtra(EXTRA_AUTHORIZED_AMOUNT) != null){
       authorizedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_AUTHORIZED_AMOUNT);
    }
 }
}

After the transaction is approved or declined, Payanywhere will send the result to the calling activity with intent extra. The value of “transactionResult” will be one of the following:

  • "Approved" when a transaction is approved. You will also receive a “transactionUniqueId”. You can use this unique ID to track your transaction in the future. "recurringPeriod" and "recurringLength" extra will contain the recurring details that you requested. "authorizedAmount" extra contains the authorized charged amount that was applied on this transaction. "authCode" extra contains the authorization code for the transaction.
  • "Declined" when a transaction is declined.
  • "Cancelled" when a transaction is cancelled.

If a transaction is a partial auth, you will also receive "isPartialAuth" boolean extra. A partial authorization occurs when a lower amount than the transaction amount is authorized on one card, and the remainder of the payment can be processed using another method.

Parameters
chargeAmount required
string
Example:
2.73

Loading...

itemName
string
Example:
Magazine

Loading...

ccDetails
boolean

Loading...

externalNotification
boolean

Loading...

cancelNotification
boolean

Loading...

customerTransactionId
integer
Example:
12345

Loading...

returnExtras
boolean

Loading...

closeOnDecline
boolean

Loading...

primaryColor
string
Example:
00a6e8

Loading...

contrastColor
string
Example:
10d625

Loading...

autoCancelTimeOut
integer
Default:
300
Example:
60

Loading...

hideSendAsInvoice
boolean

Loading...

receiptScreen
boolean

Loading...

sendBRIC
boolean

Loading...

signOnPaper
boolean

Loading...

allowCategorySelection
boolean

Loading...

receiptNotes
string
Example:
Example Note

Loading...

Start Recurring Payment

post /payment

This function enables you to start accepting a recurring payment. An initial sale will be processed and subsequent payments will be set to recur for a custom length of time at a given interval. Recurring payments are available only for merchants processing with EPX.

Request

Add the following code where you would like to start Payanywhere payment processing (i.e., on button click):

private static final String PAYMENT_URL = "payanywhere://payment/";
private static final int PAYMENT_REQUEST_CODE = 123;

Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(PAYMENT_URL +  "?chargeAmount=25.00&recurringPeriod=months&recurringLength=4&firstName=John&lastName=Smith&email=johnsmith@example.com"));
startActivityForResult(intent, PAYMENT_REQUEST_CODE);

In this example, 123 is the unique requestCode for this intent. When this code is executed, Payanywhere starts and will be ready to process a credit card transaction. The initial sale in this example is for $25.00 and the subsequent sales will occur every 4 months with an amount of $25.00.

If required, connect a credit card reader and swipe/EMV/NFC/key the credit card. Payanywhere will handle the processing and ask for a signature. Proceed with the signature.

Response

To receive the transaction result on your app, add the following code to your activity:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
private static final String EXTRA_TRANSACTION_UNIQUE_ID = "transactionUniqueId";
private static final String EXTRA_RECEIPT_ID = "receiptId";
private static final String EXTRA_PARTIAL_AUTH = "isPartialAuth";
private static final String EXTRA_REQUESTED_AMOUNT = "requestedAmount";
private static final String EXTRA_AUTHORIZED_AMOUNT = "authorizedAmount";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";
public static final String EXTRA_RECURRING_PAYMENT_ID ="recurringPaymentId";
public static String EXTRA_RECURRING_PERIOD ="recurringPeriod";
public static String EXTRA_RECURRING_LENGTH ="recurringLength";
public static String EXTRA_FIRST_NAME = "firstName";
public static String EXTRA_LAST_NAME = "lastName";
public static String EXTRA_EMAIL = "email";


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 if( requestCode ==PAYMENT_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 			showTransactionResponses(requestCode, resultCode, data);
 		} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
     String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 	 String transactionUniqueId = data.getStringExtra(EXTRA_TRANSACTION_UNIQUE_ID);
 	 long receiptId = data.getLongExtra(EXTRA_RECEIPT_ID, 0);
 	 String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 	 boolean isPartialAuth = data.getBooleanExtra(EXTRA_PARTIAL_AUTH, false);
     String recurringPaymentId = data.getStringExtra(EXTRA_RECURRING_PAYMENT_ID); 
     String recurringPeriod = data.getStringExtra(EXTRA_RECURRING_PERIOD);
     String recurringLength = data.getStringExtra(EXTRA_RECURRING_LENGTH);
	 String firstName = data.getStringExtra(EXTRA_FIRST_NAME);
     String lastName = data.getStringExtra(EXTRA_LAST_NAME);
     String email = data.getStringExtra(EXTRA_EMAIL); 	

     BigDecimal requestedAmount = null;
 	 if(data.getSerializableExtra(EXTRA_REQUESTED_AMOUNT) != null){
       requestedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_REQUESTED_AMOUNT);
     }
 	 BigDecimal authorizedAmount = null;
 	 if(data.getSerializableExtra(EXTRA_AUTHORIZED_AMOUNT) != null){
       authorizedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_AUTHORIZED_AMOUNT);
    }
 }
}

After the transaction is approved or declined, Payanywhere will send the result to the calling activity with intent extra. The value of “transactionResult” will be one of the following:

  • "Approved" when a transaction is approved. You will also receive a “transactionUniqueId”. You can use this unique ID to track your transaction in the future. "recurringPeriod" and "recurringLength" extra will contain the recurring details that you requested. "authorizedAmount" extra contains the authorized charged amount that was applied on this transaction.
  • "Declined" when a transaction is declined.
  • "Cancelled" when a transaction is cancelled.

If a transaction is a partial auth, you will also receive "isPartialAuth" boolean extra. A partial authorization occurs when a lower amount than the transaction amount is authorized on one card, and the remainder of the payment can be processed using another method.

Parameters
firstName
string
Example:
John

Loading...

lastName
string
Example:
Smith

Loading...

email
string
Example:
johnsmith@gmail.com

Loading...

itemName
string
Example:
Magazine

Loading...

chargeAmount required
string
Example:
2.73

Loading...

recurringLength
string
Example:
4

Loading...

recurringPeriod
string
Enum:
months
days
weeks
years
Example:
months

Loading...

Update Recurring Payment

post /recurring_payment_update

This function changes an existing recurring payment. Recurring payments are available only for merchants processing with EPX.

Request

Recurring payment frequency may be updated, i.e. period and length, as well as the credit card sale to be used for the recurring payment. To update the frequency of a recurring payment, pass recurringPaymentId, recurringLength, and recurringPeriod. To update the credit card sale that will be used to perform a recurring payment, pass recurringPaymentId and recurringPaymentCCSId, i.e. credit card sale unique ID (CCSID). When the CCSID is passed, the following happens:

  • The current recurring payment object is deactivated and a new recurring payment object is created, pointing to the specified credit card sale object.
  • The new recurring payment object ID will be returned to you.

Add the following code to update a recurring payment:

private static final String RECURRING_PAYMENT_UPDATE_URL = "payanywhere://recurring_payment_update/";
private static final int RECURRING_PAYMENT_UPDATE_REQUEST_CODE = 227;
public static final String EXTRA_RECURRING_PAYMENT_ID ="recurringPaymentId";
public static final String EXTRA_RECURRING_PAYMENT_CCS_ID ="recurringPaymentCCSId";
public static final String EXTRA_RECURRING_AMOUNT ="recurringAmount";
public static final String EXTRA_RECURRING_PERIOD ="recurringPeriod";
public static final String EXTRA_RECURRING_LENGTH ="recurringLength";

long recurringPaymentId = 1234;
int recurringLength = 1;
String  recurringPeriod = "months";
String recurringCCSId = "ccs_123456";

StringBuilder paramBuilder = new StringBuilder();
paramBuilder.append("&" + EXTRA_RECURRING_LENGTH + "=" + recurringLength);
paramBuilder.append("&" + EXTRA_RECURRING_PERIOD + "=" + recurringPeriod);
paramBuilder.append("&" + EXTRA_RECURRING_PAYMENT_CCS_ID + "=" + recurringCCSId);
String params = paramBuilder.toString();

Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(RECURRING_PAYMENT_UPDATE_URL +  "?" + EXTRA_RECURRING_PAYMENT_ID + "=" + recurringPaymentId + params));
startActivityForResult(intent, RECURRING_PAYMENT_UPDATE_REQUEST_CODE);

To receive the activity result:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";
public static final String EXTRA_RECURRING_PAYMENT_ID ="recurringPaymentId";
public static String EXTRA_RECURRING_AMOUNT ="recurringAmount";
public static String EXTRA_RECURRING_PERIOD ="recurringPeriod";
public static String EXTRA_RECURRING_LENGTH ="recurringLength";
public static final String EXTRA_RECURRING_PAYMENT_CCS_ID ="recurringPaymentCCSId";

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 if( requestCode == RECURRING_PAYMENT_UPDATE_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 			showTransactionResponses(requestCode, resultCode, data);
 		} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
     String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 	 String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 	 String recurringPaymentId = data.getStringExtra(EXTRA_RECURRING_PAYMENT_ID);
     String recurringPaymentCCSId = data.getStringExtra(EXTRA_RECURRING_PAYMENT_CCS_ID);
     String recurringAmount = data.getStringExtra(EXTRA_RECURRING_AMOUNT);
     String recurringPeriod = data.getStringExtra(EXTRA_RECURRING_PERIOD);
     String recurringLength = data.getStringExtra(EXTRA_RECURRING_LENGTH);
 }
}

Response

You will receive an updated recurringPaymentId or a new recurringPaymentId if a new recurring object was created due to a new CCSID. Please note that currently there is no verification that the card is still valid until a recurring payment charge is attempted.

Parameters
recurringLength
string
Example:
4

Loading...

recurringPeriod
string
Enum:
months
days
weeks
years
Example:
months

Loading...

recurringPaymentId
string
Example:
123456

Loading...

recurringPaymentCCSId
string

Loading...

Deactivate Recurring Payment

get /recurring_payment_deactivate

This function deactivates an existing recurring payment. Recurring payments are available only for merchants processing with EPX.

Request

To deactivate a recurring payment, provide the recurringPaymentId and add the following code:

private static final String RECURRING_PAYMENT_DEACTIVATE_URL = "payanywhere://recurring_payment_deactivate";
private static final int RECURRING_PAYMENT_DEACTIVATE_REQUEST_CODE = 347;

long recurringPaymentId = 1234;

Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(RECURRING_PAYMENT_DEACTIVATE_URL +  "?" + EXTRA_RECURRING_PAYMENT_ID + "=" + recurringPaymentId);
startActivityForResult(intent, RECURRING_PAYMENT_DEACTIVATE_REQUEST_CODE);

Response

To receive the activity result:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";
public static final String EXTRA_RECURRING_PAYMENT_ID ="recurringPaymentId";

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 if( requestCode == RECURRING_PAYMENT_UPDATE_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 			showTransactionResponses(requestCode, resultCode, data);
 		} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
     String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 	 String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 	 String recurringPaymentId = data.getStringExtra(EXTRA_RECURRING_PAYMENT_ID);
 }
}
Parameters
recurringPaymentId
string
Example:
123456

Loading...

Authorize

post /preauth

This function pre-authorizes a payment on a customer's card and does not capture it.

Request

Add the following code where you would like to start Payanywhere payment processing (i.e., on button click):

private static final String PREAUTH_URL = "payanywhere://preauth/";
private static final int PREAUTH_REQUEST_CODE = 456;
Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(PREAUTH_URL +  "?chargeAmount=2.73"));
startActivityForResult(intent, PREAUTH_REQUEST_CODE);

456 is the unique requestCode for this intent. When this code is executed, Payanywhere starts and will be ready to process a pre-auth credit card transaction.

Response

To receive the activity result:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
private static final String EXTRA_TRANSACTION_UNIQUE_ID = "transactionUniqueId";
private static final String EXTRA_RECEIPT_ID = "receiptId";
private static final String EXTRA_PARTIAL_AUTH = "isPartialAuth";
private static final String EXTRA_REQUESTED_AMOUNT = "requestedAmount";
private static final String EXTRA_AUTHORIZED_AMOUNT = "authorizedAmount";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 if( requestCode == PREAUTH_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 			showTransactionResponses(requestCode, resultCode, data);
 		} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
 		String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 		String transactionUniqueId = data.getStringExtra(EXTRA_TRANSACTION_UNIQUE_ID);
 		long receiptId = data.getLongExtra(EXTRA_RECEIPT_ID, 0);
 		String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 		boolean isPartialAuth = data.getBooleanExtra(EXTRA_PARTIAL_AUTH, false);
 
     	BigDecimal requestedAmount = null;
 	 	if(data.getSerializableExtra(EXTRA_REQUESTED_AMOUNT) != null){
       		requestedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_REQUESTED_AMOUNT);
     	}
     	BigDecimal authorizedAmount = null;
 	 	if(data.getSerializableExtra(EXTRA_AUTHORIZED_AMOUNT) != null){
       		authorizedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_AUTHORIZED_AMOUNT);
     }
 }
}
Parameters
chargeAmount
string
Example:
2.73

Loading...

itemName
string
Example:
Magazine

Loading...

Adjust

post /preauth_adjust

This function adjusts the amount of a Pre-Auth transaction. It will increase or decrease the pre-authorized amount by the amount provided in the request. For example, if a pre-auth was created for $10.00 and and an adjust amount of $15.00 is requested, the new amount for the pre-auth will be $25.00.

Request

Add the following code where you would like to start Payanywhere payment processing (i.e., on button click):

private static final String PREAUTH_ADJUST_URL = "payanywhere://preauth_adjust/";
private static final int PREAUTH_ADJUST_REQUEST_CODE = 457;
private String transactionUniqueId = "ccs_1234567";
private String adjustAmount = "25.00"; // This can be negative as well
private long receiptId = 317748502;
Intent intent = new Intent(Intent.ACTION_VIEW,
    Uri.parse(
        PREAUTH__ADJUST_URL
        +  "?transactionUniqueId=" + transactionUniqueId
        + "d&receiptId=" + receiptId
        + "&adjustAmount=" + adjustAmount)
    );
startActivityForResult(intent, PREAUTH_ADJUST_REQUEST_CODE);

Response

To receive the activity result:

private static final String EXTRA_TRANSACTION_ACTION = "transactionAction";
private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
private static final String EXTRA_TRANSACTION_UNIQUE_ID = "transactionUniqueId";
private static final String EXTRA_INVOICE_NUMBER = "invoiceNumber";
private static final String EXTRA_RECEIPT_ID = "receiptId";
private static final String EXTRA_PARTIAL_AUTH = "isPartialAuth";
private static final String EXTRA_REQUESTED_AMOUNT = "requestedAmount";
private static final String EXTRA_TOTAL_AUTHORIZED_AMOUNT = "totalAuthorizedAmount";
private static final String EXTRA_CUSTOMER_NAME = "customerName";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
    if( requestCode == PREAUTH_ADJUST_REQUEST_CODE) {
        if (resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
            showTransactionResponses(requestCode, resultCode, data);
        } else if (resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
            showTransactionResponses(requestCode, resultCode, data);
        }
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data) {
    if (data != null) {
        String transactionAction = data.getString(EXTRA_TRANSACTION_ACTION);
        String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
        String transactionUniqueId = data.getStringExtra(EXTRA_TRANSACTION_UNIQUE_ID);
        String invoiceNumber = data.getStringExtra(EXTRA_INVOICE_NUMBER);
        String customerName = data.getStringExtra(EXTRA_CUSTOMER_NAME);
        long receiptId = data.getLongExtra(EXTRA_RECEIPT_ID, 0);

        BigDecimal totalAuthorizedAmount = null;
        if (data.getSerializableExtra(EXTRA_TOTAL_AUTHORIZED_AMOUNT) != null){
            totalAuthorizedAmount = (BigDecimal)data.getSerializableExtra(EXTRA_TOTAL_AUTHORIZED_AMOUNT);
     }
 }
}
Parameters
adjustAmount
string
Example:
25.00

Loading...

transactionUniqueId
string

Loading...

receiptId
string

Loading...

Capture

post /preauth_complete

This function captures an existing authorization.

Request

Add the following code where you would like to start Payanywhere payment processing (i.e., on button click):

private static final String PREAUTH_COMPLETE_URL = "payanywhere://preauth_complete/";
private static final int PREAUTH_COMPLETE_REQUEST_CODE = 789;
Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(PREAUTH_COMPLETE_URL +  "?transactionUniqueId=pap_123456&receiptId=123456&preAuthCompleteAmount=43.46")); 
startActivityForResult(intent, PREAUTH_COMPLETE_REQUEST_CODE);

Response

To receive the activity result:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
private static final String EXTRA_TRANSACTION_UNIQUE_ID = "transactionUniqueId";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 	if( requestCode == PREAUTH_COMPLETE_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 			showTransactionResponses(requestCode, resultCode, data);
 		} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
 		String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 		String transactionUniqueId = data.getStringExtra(EXTRA_TRANSACTION_UNIQUE_ID);
 		String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 	}
}

Tip Adjust

post /tips

This function adds a tip amount to an existing transaction. Tip adjustment can be done anytime before the batch is settled.

Request

Add the following code where you would like to start Payanywhere payment processing (i.e., on button click):

private static final String TIPS_URL = "payanywhere://tips/";
private static final int TIPS_REQUEST_CODE = 555;
Intent intent = new Intent(Intent.ACTION_VIEW , Uri.parse(TIPS_URL +  "?transactionUniqueId=" + mTransactionActionUniqueId + "&tipsAmount=" + mTipsAmount));
startActivityForResult(intent, TIPS_REQUEST_CODE);

Response

To receive the activity result:

private static final String EXTRA_TRANSACTION_RESULT = "transactionResult";
private static final String EXTRA_TRANSACTION_UNIQUE_ID = "transactionUniqueId";
public static final String EXTRA_TRANSACTION_ACTION = "transactionAction";



@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Log.d(TAG,"onActivityResult requestCode " + requestCode + " resultCode " + resultCode);
 	if( requestCode == TIPS_REQUEST_CODE){
        if(resultCode == RESULT_OK){
            Log.d(TAG,"result ok");
 		showTransactionResponses(requestCode, resultCode, data);
 	} else if(resultCode == RESULT_CANCELED){
            Log.d(TAG,"result cancelled");
 			showTransactionResponses(requestCode, resultCode, data);
 		}
    }
}

private void showTransactionResponses(int requestCode, int resultCode, Intent data){
    if(data != null){
 		String transactionResult = data.getStringExtra(EXTRA_TRANSACTION_RESULT);
 		String transactionUniqueId = data.getStringExtra(EXTRA_TRANSACTION_UNIQUE_ID);
 		String transactionAction = data.getStringExtra(EXTRA_TRANSACTION_ACTION);
 		String transactionStatusMessage = data.getStringExtra(EXTRA_TRANSACTION_STATUS_MESSAGE);
 	}
}
©2025 North is a registered DBA of NorthAB, LLC. All rights reserved. North is a registered ISO of BMO Harris Bank N.A., Chicago, IL, Citizens Bank N.A., Providence, RI, The Bancorp Bank, Philadelphia, PA, FFB Bank, Fresno, CA, Wells Fargo Bank, N.A., Concord, CA, and PNC Bank, N.A.