Skip to content

Latest commit

 

History

History
267 lines (230 loc) · 9.02 KB

batches.md

File metadata and controls

267 lines (230 loc) · 9.02 KB

Batches

Any user with the available permissions can perform a request to manually settle a transaction batch. This is done by using the transactionbatches endpoint with an action of "settle".

$batchesController = $client->getBatchesController();

Class Name

BatchesController

Methods

List All Batches

List All Batches

function listAllBatches(
    ?Page $page = null,
    ?Sort16 $sort = null,
    ?Filter $filter = null,
    ?array $expand = null
): ResponseBatchsCollection

Parameters

Parameter Type Tags Description
page ?Page Query, Optional Use this field to specify paginate your results, by using page size and number. You can use one of the following methods:

> /endpoint?page={ "number": 1, "size": 50 }
>
> /endpoint?page[number]=1&page[size]=50
sort ?Sort16 Query, Optional You can use any field_name from this endpoint results, and you can combine more than one field for more complex sorting. You can use one of the following methods:

> /endpoint?sort={ "field_name": "asc", "field_name2": "desc" }
>
> /endpoint?sort[field_name]=asc&sort[field_name2]=desc
filter ?Filter Query, Optional You can use any field_name from this endpoint results as a filter, and you can also use more than one field to create AND conditions. For date fields (ended with _ts), you can also search for ranges using the $gte (Greater than or equal to) and/or $lte (Lower than or equal to). You can use one of the following methods:

> /endpoint?filter={ "field_name": "Value" }
>
> /endpoint?filter[field_name]=Value
>
> /endpoint?filter={ "created_ts": "today" }
>
> /endpoint?filter[created_ts]=today
>
> /endpoint?filter={ "created_ts": { "$gte": "yesterday", "$lte": "today" } }
>
> /endpoint?filter[created_ts][$gte]=yesterday&filter[created_ts][$lte]=today
>
> /endpoint?filter[address][city]=memphis
>
> /endpoint?filter={ "address": { "city" : "memphis" } }
expand ?(string[]) (ExpandEnum) Query, Optional Most endpoints in the API have a way to retrieve extra data related to the current record being retrieved. For example, if the API request is for the accountvaults endpoint, and the end user also needs to know which contact the token belongs to, this data can be returned in the accountvaults endpoint request.
Constraints: Unique Items Required, Pattern: ^[\w]+$

Response Type

ResponseBatchsCollection

Example Usage

$page = PageBuilder::init()
    ->number(1)
    ->size(50)
    ->build();

$result = $batchesController->listAllBatches($page);

Example Response (as JSON)

{
  "type": "BatchsCollection",
  "list": [
    {
      "id": "11e95f8ec39de8fbdb0a4f1a",
      "created_ts": 1422040992,
      "product_transaction_id": "11e95f8ec39de8fbdb0a4f1a",
      "processing_status_id": 2,
      "batch_num": 4,
      "is_open": 0,
      "settlement_file_name": "settement_file.txt",
      "batch_close_ts": 1531423693,
      "batch_close_detail": "BATCH_MISMATCH",
      "total_sale_amount": 2342,
      "total_sale_count": 21,
      "total_refund_amount": 2342,
      "total_refund_count": 18,
      "total_void_amount": 2342,
      "total_void_count": 17,
      "changelogs": [
        {
          "id": "11e95f8ec39de8fbdb0a4f1a",
          "created_ts": 1422040992,
          "action": "CREATE",
          "model": "TransactionRequest",
          "model_id": "11ec829598f0d4008be9aba4",
          "user_id": "11e95f8ec39de8fbdb0a4f1a",
          "changelog_details": [
            {
              "id": "11e95f8ec39de8fbdb0a4f1a",
              "changelog_id": "11e95f8ec39de8fbdb0a4f1a",
              "field": "next_run_ts",
              "old_value": "1643616000"
            }
          ],
          "user": {
            "id": "11e95f8ec39de8fbdb0a4f1a",
            "username": "[email protected]",
            "first_name": "Bob",
            "last_name": "Fairview"
          }
        }
      ],
      "postback_logs": [
        {
          "id": "11e95f8ec39de8fbdb0a4f1a",
          "postback_config_id": "11e95f8ec39de8fbdb0a4f1a",
          "changelog_id": "11e95f8ec39de8fbdb0a4f1a",
          "next_run_ts": 1422040992,
          "created_ts": 1422040992,
          "model_id": "11e95f8ec39de8fbdb0a4f1a"
        }
      ],
      "product_transaction": {
        "processor_version": "1_0_0",
        "title": "My terminal",
        "payment_method": "cc",
        "processor": "zgate",
        "mcc": "1111",
        "tax_surcharge_config": 2,
        "partner": "standalone",
        "location_id": "11e95f8ec39de8fbdb0a4f1a",
        "surcharge": {},
        "processor_data": {},
        "vt_clerk_number": true,
        "vt_billing_phone": true,
        "vt_enable_tip": true,
        "ach_allow_debit": true,
        "ach_allow_credit": true,
        "ach_allow_refund": true,
        "vt_cvv": true,
        "vt_street": true,
        "vt_zip": true,
        "vt_order_num": true,
        "vt_enable": true,
        "receipt_show_contact_name": true,
        "display_avs": true,
        "card_type_visa": true,
        "card_type_mc": true,
        "card_type_disc": true,
        "card_type_amex": true,
        "card_type_diners": true,
        "card_type_jcb": true,
        "invoice_location": true,
        "allow_partial_authorization": true,
        "allow_recurring_partial_authorization": true,
        "auto_decline_cvv": true,
        "auto_decline_street": true,
        "auto_decline_zip": true,
        "split_payments_allow": true,
        "vt_show_custom_fields": true,
        "receipt_show_custom_fields": true,
        "vt_override_sales_tax_allowed": true,
        "vt_enable_sales_tax": true,
        "vt_require_zip": true,
        "vt_require_street": true,
        "auto_decline_cavv": true,
        "current_batch": 34,
        "dup_check_per_batch": null,
        "paylink_allow": false,
        "quick_invoice_allow": false,
        "level3_allow": false,
        "payfac_enable": false,
        "sales_office_id": "11e95f8ec39de8fbdb0a4f1a",
        "hosted_payment_page_allow": false,
        "surcharge_id": "11e95f8ec39de8fbdb0a4f1a",
        "level3_default": {},
        "cau_subscribe_type_id": 0,
        "location_billing_account_id": "11eb88b873980c64a21e5fd2",
        "product_billing_group_id": "nofees",
        "account_number": "12345678",
        "run_avs_on_accountvault_create": false,
        "accountvault_expire_notification_email_enable": false,
        "debit_allow_void": false,
        "quick_invoice_text_to_pay": false,
        "sms_enable": false,
        "vt_show_currency": true,
        "receipt_show_currency": false,
        "allow_blind_refund": false,
        "vt_show_company_name": false,
        "receipt_show_company_name": false,
        "bank_funded_only": false,
        "id": "11e95f8ec39de8fbdb0a4f1a",
        "active": true,
        "created_ts": 1422040992,
        "modified_ts": 1422040992,
        "created_user_id": "11e95f8ec39de8fbdb0a4f1a",
        "modified_user_id": "11e95f8ec39de8fbdb0a4f1a"
      }
    }
  ],
  "links": {
    "type": "Links",
    "first": "/v1/endpoint?page[size]=10&page[number]=1",
    "previous": "/v1/endpoint?page[size]=10&page[number]=5",
    "last": "/v1/endpoint?page[size]=10&page[number]=42"
  },
  "pagination": {
    "type": "Pagination",
    "total_count": 423,
    "page_count": 42,
    "page_number": 6,
    "page_size": 10
  },
  "sort": {
    "type": "Sorting",
    "fields": [
      {
        "field": "last_name",
        "order": "asc"
      }
    ]
  }
}

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized Response401tokenException

Settle a Batch

Settle a Batch

function settleABatch(string $batchId): ResponseAsyncProcessing

Parameters

Parameter Type Tags Description
batchId string Template, Required Batch ID
Constraints: Pattern: ^(([0-9a-fA-F\-]{24,36})|(([0-9a-fA-F]{8})-(([0-9a-fA-F]{4}\-){3})([0-9a-fA-F]{12})))$

Response Type

ResponseAsyncProcessing

Example Usage

$batchId = '11e95f8ec39de8fbdb0a4f1a';

$result = $batchesController->settleABatch($batchId);

Example Response (as JSON)

{
  "type": "AsyncProcessing",
  "data": {
    "async": {
      "code": "406c66c3-21cb-47fb-80fc-843bc42507fb",
      "link": "/v1/async/status/406c66c3-21cb-47fb-80fc-843bc42507fb"
    }
  }
}

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized Response401tokenException