Android / Bond APIs / get transactions by id
Back to Collection Items
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http = new CkHttp();
boolean success;
http.SetRequestHeader("Authorization","{{authorization}}");
http.SetRequestHeader("Identity","{{identity}}");
CkStringBuilder sbResponseBody = new CkStringBuilder();
success = http.QuickGetSb("https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id",sbResponseBody);
if (success == false) {
Log.i(TAG, http.lastErrorText());
return;
}
Log.i(TAG, "Response status code = " + String.valueOf(http.get_LastStatus()));
Log.i(TAG, sbResponseBody.getAsString());
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
Curl Command
curl -X GET
-H "Authorization: {{authorization}}"
-H "Identity: {{identity}}"
https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id
Postman Collection Item JSON
{
"name": "get transactions by id",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authorization}}",
"type": "text"
},
{
"key": "Identity",
"value": "{{identity}}",
"type": "text"
}
],
"url": {
"raw": "https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id",
"protocol": "https",
"host": [
"{{environment}}",
"bond",
"tech"
],
"path": [
"api",
"v0",
"transatcions",
":transaction_id"
],
"query": [
{
"key": "card_account_id",
"value": "b18f94bc-0d7c-456e-a2e7-19e68393b64f",
"disabled": true
}
],
"variable": [
{
"key": "transaction_id",
"value": ""
}
]
},
"description": "Retrieve Card to Card Transfer"
},
"response": [
{
"name": "example",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "{{authorization}}",
"type": "text"
},
{
"key": "Identity",
"value": "{{identity}}",
"type": "text"
}
],
"url": {
"raw": "https://{{environment}}.bond.tech/api/v0/transatcions/:transaction_id",
"protocol": "https",
"host": [
"{{environment}}",
"bond",
"tech"
],
"path": [
"api",
"v0",
"transatcions",
":transaction_id"
],
"query": [
{
"key": "card_account_id",
"value": "b18f94bc-0d7c-456e-a2e7-19e68393b64f",
"disabled": true
}
],
"variable": [
{
"key": "transaction_id",
"value": ""
}
]
}
},
"_postman_previewlanguage": "json",
"header": null,
"cookie": [
],
"body": "{\n \"transaction_id\": \"b9b8da9a-5ff2-4e5c-84ee-587b7d092f6b\",\n \"bond_brand_id\": \"8ed5c9fe-581b-490a-9dcb-3302db235a4b\",\n \"customer_id\": \"6493109c-7cb5-4f21-9d19-d9c3901d452d\",\n \"account_id\": \"9dc86a8a-4c12-4107-84a8-e7cf6a76586f\",\n \"payment_type\": \"card\",\n \"transaction_type\": \"credit\",\n \"previous_transaction_id\": null,\n \"state\": \"pending\",\n \"amount\": \"5.30\",\n \"currency\": \"USD\",\n \"created_time\": \"2021-02-02T22:27:13+00:00\",\n \"updated_time\": \"2021-03-02T20:39:56+00:00\",\n \"balances\": {\n \"prior_balance\": \"68.83\",\n \"new_balance\": \"63.53\"\n },\n \"details\": {\n \"card_id\": \"71efc729-830f-455f-9525-281c19bb4bb4\",\n \"mcc\": \"3542\",\n \"mcc_description\": \"matrix dynamic eyeballs\",\n \"currency\": \"USD\",\n \"exchange_rate\": \"0.00\",\n \"merchant_id\": \"9le8DI5z8am54O3b\",\n \"merchant_name\": \"Baldwin, Wright and Martinez\",\n \"merchant_city\": \"New Nathanshire\",\n \"merchant_state\": \"Missouri\",\n \"merchant_country\": \"Colombia\",\n \"merchant_postal_code\": \"34100\",\n \"cardholder_presence\": true,\n \"statement_descriptor\": \"Target #4744\",\n \"arn\": \"000091556011\",\n \"fraud_rule_triggered\": \"spend_velocity\"\n }\n}"
}
]
}