blockchyp

package module
v1.24.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 32 Imported by: 0

README

BlockChyp Go SDK

Build Status Release Go Report Card GoDoc

This is the Go SDK for BlockChyp. Like all BlockChyp SDKs, it provides a full Go client for the BlockChyp gateway and BlockChyp payment terminals.

This project also contains a command line interface for Windows, Linux, and Mac OS developers working in languages or on platforms for which BlockChyp doesn't currently provide a supported SDK.

Command Line Interface

In addition to the standard Go SDK, the Makefile includes special targets for Windows and Linux command line binaries.

These binaries are intended for unique situations where using an SDK or doing a direct REST integration aren't practical.

Check out the CLI Reference for more information.

Go Installation

For Go developers, you can install BlockChyp in the usual way with go get.

go get github.com/blockchyp/blockchyp-go

A Simple Example

Running your first terminal transaction is easy. Make sure you have a BlockChyp terminal, activate it, and generate a set of API keys.

package main

import (
    "encoding/json"
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func main() {

    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    client := blockchyp.NewClient(creds)

    req := blockchyp.AuthorizationRequest{
        Test: true,
        TerminalName: "Test Terminal",
        Amount: "55.00",
    }

    response, err := client.Charge(req)

    if err != nil {
        log.Fatal(err)
    }

    if response.Approved {
        fmt.Println("Approved")
        fmt.Println(response.AuthCode)
        fmt.Println(response.AuthorizedAmount)
        fmt.Println(response.ReceiptSuggestions.AID)
    } else {
        fmt.Println(response.ResponseDescription)
    }

    b, err := json.Marshal(response)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Print(string(b))
}

The response contains all the information you'll need to complete processing a transaction. Of particular importance is the ReceiptSuggestions struct, which contains all the fields that are required or recommended for PCI or EMV compliance.

Additional Documentation

Complete documentation can be found on our Developer Documentation Portal.

Getting a Developer Kit

In order to test your integration with real terminals, you'll need a BlockChyp Developer Kit. Our kits include a fully functioning payment terminal with test pin encryption keys. Every kit includes a comprehensive set of test cards with test cards for every major card brand and entry method, including Contactless and Contact EMV and mag stripe cards. Each kit also includes test gift cards for our blockchain gift card system.

Access to BlockChyp's developer program is currently invite only, but you can request an invitation by contacting our engineering team at nerds@blockchyp.com.

You can also view a number of long form demos and learn more about us on our YouTube Channel.

Transaction Code Examples

You don't want to read words. You want examples. Here's a quick rundown of the stuff you can do with the BlockChyp Go SDK and a few basic examples.

Payment Endpoints

These are the core payment APIs used to execute and work with payment transactions in BlockChyp.

Charge
  • API Credential Types: Merchant
  • Required Role: Payment API Access

Our most popular transaction executes a standard authorization and capture. This is the most basic of basic payment transactions, typically used in conventional retail.

Charge transactions can use a payment terminal to capture a payment or use a previously enrolled payment token.

Terminal Transactions

For terminal transactions, make sure you pass in the terminal name using the terminalName property.

Token Transactions

If you have a payment token, omit the terminalName property and pass in the token with the token property instead.

Card Numbers and Mag Stripes

You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is keylogging. If you use terminals for manual card entry, you'll bypass any keyloggers that might be maliciously running on the point-of-sale system.

Common Variations

  • Gift Card Redemption: There's no special API for gift card redemption in BlockChyp. Simply execute a plain charge transaction and if the customer swipes a gift card, our terminals will identify the gift card and run a gift card redemption. Also note that if for some reason the gift card's original purchase transaction is associated with fraud or a chargeback, the transaction will be rejected.
  • EBT: Set the CardType field to blockchyp.CardTypeEBT to process an EBT SNAP transaction. Note that test EBT transactions always assume a balance of $100.00, so test EBT transactions over that amount may be declined.
  • Cash Back: To enable cash back for debit transactions, set the CashBack field. If the card presented isn't a debit card, the CashBack field will be ignored.
  • Manual Card Entry: Set the ManualEntry field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the ManualEntry field with the CardType field set to blockchyp.CardTypeEBT for manual EBT card entry.
  • Inline Tokenization: You can enroll the payment method in the token vault inline with a charge transaction by setting the Enroll field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
  • Prompting for Tips: Set the PromptForTip field if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios.
  • Cash Discounting and Surcharging: The Surcharge and CashDiscount fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
  • Cryptocurrency The Cryptocurrency field can be used to switch the standard present card screen to a cryptocurrency screen. The field value can be ANY to enable any supported cryptocurrency or a single currency code such as BTC for Bitcoin.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func chargeExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.AuthorizationRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Amount:       "55.00",
    }

    response, err := client.Charge(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Preauthorization
  • API Credential Types: Merchant
  • Required Role: Payment API Access

A preauthorization puts a hold on funds and must be captured later. This is used in scenarios where the final transaction amount might change. A common example is fine dining, where a tip adjustment is required before final settlement.

Another use case for preauthorization is e-commerce. Typically, an online order is preauthorized at the time of the order and then captured when the order ships.

Preauthorizations can use a payment terminal to capture a payment or use a previously enrolled payment token.

Terminal Transactions

For terminal transactions, make sure you pass in the terminal name using the terminalName property.

Token Transactions

If you have a payment token, omit the terminalName property and pass in the token with the token property instead.

Card Numbers and Mag Stripes

You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is key logging. If you use terminals for manual card entry, you'll bypass any key loggers that might be maliciously running on the point-of-sale system.

Cryptocurrency

Note that preauths are not supported for cryptocurrency.

Common Variations

  • Manual Card Entry: Set the ManualEntry field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine the ManualEntry field with CardType set to blockchyp.CardTypeEBT for manual EBT card entry.
  • Inline Tokenization: You can enroll the payment method in the token vault in line with a charge transaction by setting the Enroll field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data.
  • Prompting for Tips: Set the PromptForTip field if you'd like to prompt the customer for a tip before authorization. You can prompt for tips as part of a preauthorization, although it's not a very common approach.
  • Cash Discounting and Surcharging: The Surcharge and CashDiscount fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func preauthExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.AuthorizationRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Amount:       "27.00",
    }

    response, err := client.Preauth(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Capture Preauthorization
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API allows you to capture a previously approved preauthorization.

You'll need to make sure you pass in the Transaction ID returned by the original preauth transaction so we know which transaction we're capturing. If you want to capture the transaction for the exact amount of the preauth, the Transaction ID is all you need to pass in.

You can adjust the total if you need to by passing in a new amount. We also recommend you pass in updated amounts for tax and tip as it can sometimes reduce your interchange fees. (Level II Processing, for example.)

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func captureExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CaptureRequest{
        Test:          true,
        TransactionID: "<ORIGINAL TRANSACTION ID>",
        Amount:        "32.00",
    }

    response, err := client.Capture(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Refund
  • API Credential Types: Merchant
  • Required Role: Payment API Access

It's not ideal, but sometimes customers want their money back.

Our refund API allows you to confront this unpleasant reality by executing refunds in a few different scenarios.

The most fraud resistent method is to execute refunds in the context of a previous transaction. You should always keep track of the Transaction ID returned in a BlockChyp response. To refund the full amount of the previous transaction, just pass in the original Transaction ID with the refund requests.

Partial Refunds

For a partial refund, just pass in an amount along with the Transaction ID. The only rule is that the amount must be equal to or less than the original transaction. You can execute multiple partial refunds against the same original transaction as long as the total refunded amount doesn't exceed the original amount.

Tokenized Refunds

You can also use a token to execute a refund. Pass in a token instead of the Transaction ID and the desired refund amount.

Free Range Refunds

When you execute a refund without referencing a previous transaction, we call this a free range refund.

We don't recommend this type of refund, but it is permitted. If you absolutely insist on doing it, pass in a Terminal Name and an amount.

You can execute a manual or keyed refund by passing the ManualEntry field to a free range refund request.

Gift Card Refunds

Gift card refunds are allowed in the context of a previous transaction, but free range gift card refunds are not allowed. Use the gift card activation API if you need to add more funds to a gift card.

Store and Forward Support

Refunds are not permitted when a terminal falls back to store and forward mode.

Auto Voids

If a refund referencing a previous transaction is executed for the full amount before the original transaction's batch is closed, the refund is automatically converted to a void. This saves the merchant a little bit of money.

Cryptocurrency

Note that refunds are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func refundExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.RefundRequest{
        TransactionID: "<PREVIOUS TRANSACTION ID>",

        // Optional amount for partial refunds.
        Amount: "5.00",
    }

    response, err := client.Refund(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Void
  • API Credential Types: Merchant
  • Required Role: Payment API Access

Mistakes happen. If a transaction is made by mistake, you can void it with this API. All that's needed is to pass in a Transaction ID and execute the void before the original transaction's batch closes.

Voids work with EBT and gift card transactions with no additional parameters.

Cryptocurrency

Note that voids are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func voidExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.VoidRequest{
        Test:          true,
        TransactionID: "<PREVIOUS TRANSACTION ID>",
    }

    response, err := client.Void(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Time Out Reversal
  • API Credential Types: Merchant
  • Required Role: Payment API Access

Payment transactions require a stable network to function correctly and no network is stable all the time. Time out reversals are a great line of defense against accidentally double charging consumers when payments are retried during shaky network conditions.

We highly recommend developers use this API whenever a charge, preauth, or refund transaction times out. If you don't receive a definitive response from BlockChyp, you can't be certain about whether or not the transaction went through.

The best practice in this situation is to send a time out reversal request. Time out reversals check for a transaction and void it if it exists.

The only caveat is that developers must use the transactionRef property (txRef for the CLI) when executing charge, preauth, and refund transactions.

The reason for this requirement is that if a system never receives a definitive response for a transaction, the system would never have received the BlockChyp generated Transaction ID. We have to fall back to Transaction Ref to identify a transaction.

Cryptocurrency

Note that refunds are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func reverseExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.AuthorizationRequest{
        TransactionRef: "<LAST TRANSACTION REF>",
    }

    response, err := client.Reverse(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Gift Card Activation
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API activates or adds value to BlockChyp gift cards. Just pass in the terminal name and the amount to add to the card. Once the customer swipes their card, the terminal will use keys on the mag stripe to add value to the card.

You don't need to handle a new gift card activation or a gift card recharge any differently. The terminal firmware will figure out what to do on its own while also returning the new balance for the gift card.

This is the part of the system where BlockChyp's blockchain DNA comes closest to the surface. The BlockChyp gift card system doesn't really use gift card numbers. This means they can't be stolen.

BlockChyp identifies cards with an elliptic curve public key instead. Gift card transactions are actually blocks signed with those keys. This means there are no shared secrets sent over the network. To keep track of a BlockChyp gift card, hang on to the public key returned during gift card activation. That's the gift card's elliptic curve public key.

We sometimes print numbers on our gift cards, but these are actually decimal encoded hashes of a portion of the public key to make our gift cards seem normal to normies. They can be used for balance checks and play a lookup role in online gift card authorization, but are of little use beyond that.

Voids and Reversals

Gift card activations can be voided and reversed just like any other BlockChyp transaction. Use the Transaction ID or Transaction Ref to identify the gift activation transaction as you normally would for voiding or reversing a conventional payment transaction.

Importing Gift Cards

BlockChyp does have the ability to import gift card liability from conventional gift card platforms. Unfortunately, BlockChyp does not support activating cards on third party systems. However, you can import your outstanding gift cards and customers can swipe them on the terminals like BlockChyp's standard gift cards.

No special coding is required to access this feature. The gateway and terminal firmware handle everything for you.

Third Party Gift Card Networks

BlockChyp does not currently provide any native support for other gift card platforms beyond importing gift card liability. We do have a white listing system that can be used to support your own custom gift card implementations. We have a security review process before we can allow a BIN range to be white listed, so contact support@blockchyp.com if you need to white list a BIN range.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func giftActivateExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.GiftActivateRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Amount:       "50.00",
    }

    response, err := client.GiftActivate(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Balance
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API checks a gift or EBT card balance.

Gift Card Balance Checks

For gift cards, pass in a terminal name and the customer will be prompted to swipe a card on that terminal. The remaining balance will be displayed briefly on the terminal screen and the API response will include the gift card's public key and the remaining balance.

EBT Balance Checks

All EBT transactions require a PIN, so to check an EBT card balance, you need to pass in the ebt flag just like you would for a normal EBT charge transaction. The customer will be prompted to swipe their card and enter a PIN code. If everything checks out, the remaining balance on the card will be displayed on the terminal for the customer and returned with the API response.

Testing Gift Card Balance Checks

Test gift card balance checks work no differently than live gift cards. You must activate a test gift card first to test balance checks. Test gift cards are real blockchain cards that live on our parallel test blockchain.

Testing EBT Gift Card Balance Checks

All test EBT transactions assume a starting balance of $100.00. As a result, test EBT balance checks always return a balance of $100.00.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func balanceExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BalanceRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        CardType:     blockchyp.CardTypeEBT,
    }

    response, err := client.Balance(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Close Batch
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API will close the merchant's batch if it's currently open.

By default, merchant batches will close automatically at 3 AM in their local time zone. The automatic batch closure time can be changed in the Merchant Profile or disabled completely.

If automatic batch closure is disabled, you'll need to use this API to close the batch manually.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func closeBatchExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CloseBatchRequest{
        Test: true,
    }

    response, err := client.CloseBatch(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API allows you to send an invoice to a customer and capture payment via a BlockChyp hosted payment page.

If you set the autoSend flag, BlockChyp will send a basic invoice email to the customer for you that includes the payment link. If you'd rather have more control over the look of the email message, you can omit the autoSend flag and send the customer email yourself.

There are a lot of optional parameters for this API, but at a minimum you'll need to pass in a total, customer name, and email address. (Unless you use the cashier flag.)

Customer Info

Unless you're using the cashier flag, you must specify a customer; either by creating a new customer record inline or passing in an existing Customer ID or Customer Ref.

Line Item Level Data

It's not strictly required, but we strongly recommend sending line item level detail with every request. It will make the invoice look more complete and the data format for line item level data is the exact same format used for terminal line item display, so the same code can be used to support both areas.

Descriptions

You can also provide a free form description or message to display near the bottom of the invoice. Usually this is some kind of thank you note or instruction.

Terms and Conditions

You can include long form contract language with a request and capture terms and conditions accepted at the same time payment is captured.

The interface is identical to that used for the terminal based Terms and Conditions API in that you can pass in content directly via tcContent or via a preconfigured template via tcAlias. The Terms and Conditions log will also be updated when agreement acceptance is incorporated into a send link request.

Auto Send

BlockChyp does not send the email notification automatically. This safeguard prevents real emails from going out when you may not expect them If you want BlockChyp to send the email for you, just add the autoSend flag with all requests.

Cryptocurrency

If the merchant is configured to support cryptocurrency transactions, the payment page will display additional UI widgets that allowing customers to switch to a crypto payment method.

Tokenization

Add the enroll flag to a send link request to enroll the payment method in the token vault.

Cashier Facing Card Entry

BlockChyp can be used to generate internal/cashier facing card entry pages as well. This is designed for situations where you might need to take a phone order and don't have an available terminal.

If you pass in the cashier flag, no email will be sent and you'll be able to load the link in a browser or iframe for payment entry. When the cashier flag is used, the autoSend flag will be ignored.

Note that cryptocurrency is not supported for cashier facing payment entry.

Payment Notifications

When a customer successfully submits payment, the merchant will receive an email notifying them that the payment was received.

Real Time Callback Notifications

Email notifications are fine, but you may want your system to be informed immediately whenever a payment event occurs. By using the optional callbackUrl request property, you can specify a URL to which the Authorization Response will be posted every time the user submits a payment, whether approved or otherwise.

The response will be sent as a JSON encoded POST request and will be the exact same format as all BlockChyp charge and preauth transaction responses.

Status Polling

If real time callbacks aren't practical or necessary in your environment, you can always use the Transaction Status API described below.

A common use case for the send link API with status polling is curbside pickup. You could have your system check the Transaction Status when a customer arrives to ensure it's been paid without necessarily needing to create background threads to constantly poll for status updates.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func sendPaymentLinkExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.PaymentLinkRequest{
        TransactionRef: "<TX REF>",
        Amount:         "199.99",
        Description:    "Widget",
        Subject:        "Widget invoice",
        Transaction: &blockchyp.TransactionDisplayTransaction{
            Subtotal: "195.00",
            Tax:      "4.99",
            Total:    "199.99",
            Items: []*blockchyp.TransactionDisplayItem{
                &blockchyp.TransactionDisplayItem{
                    Description: "Widget",
                    Price:       "195.00",
                    Quantity:    1,
                },
            },
        },
        AutoSend: true,
        Customer: blockchyp.Customer{
            CustomerRef:  "Customer reference string",
            FirstName:    "FirstName",
            LastName:     "LastName",
            CompanyName:  "Company Name",
            EmailAddress: "notifications@blockchypteam.m8r.co",
            SmsNumber:    "(123) 123-1231",
        },
    }

    response, err := client.SendPaymentLink(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API cancels a payment link.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func cancelPaymentLinkExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CancelPaymentLinkRequest{
        LinkCode: "<PAYMENT LINK CODE>",
    }

    response, err := client.CancelPaymentLink(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Transaction Status
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API returns the current status for any transaction. You can lookup a transaction by its BlockChyp assigned Transaction ID or your own Transaction Ref.

You should alway use globally unique Transaction Ref values, but in the event that you duplicate Transaction Refs, the most recent transaction matching your Transaction Ref is returned.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func transactionStatusExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TransactionStatusRequest{
        TransactionID: "<TRANSACTION ID>",
    }

    response, err := client.TransactionStatus(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Cash Discount
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API calculates the surcharge, cash discount, and total amounts for cash transactions.

If you're using BlockChyp's cash discounting features, you can use this endpoint to ensure the numbers and receipts for true cash transactions are consistent with transactions processed by BlockChyp.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func cashDiscountExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CashDiscountRequest{
        Amount:       "100.00",
        CashDiscount: true,
        Surcharge:    true,
    }

    response, err := client.CashDiscount(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Batch History
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This endpoint allows developers to query the gateway for the merchant's batch history. The data will be returned in descending order of open date with the most recent batch returned first. The results will include basic information about the batch. Consider using the Batch Details API for more detail about a specific batch.

Limiting Results

This API will return a maximum of 250 results. Use the maxResults property to limit maximum results even further and use the startIndex property to page through results that span multiple queries.

For example, if you want the ten most recent batches, pass in a value of 10 for maxResults. Also note that startIndex is zero based. Use a value of 0 to get the first batch in the dataset.

Filtering by Date Range

You can also filter results by date. Use the startDate and endDate properties to return only those batches opened between those dates. You can use either startDate and endDate and you can use date filters in conjunction with maxResults and startIndex

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func batchHistoryExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BatchHistoryRequest{
        MaxResults: 250,
        StartIndex: 0,
    }

    response, err := client.BatchHistory(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Batch Details
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API allows developers to pull down details for a specific batch, including captured volume, gift card activity, expected deposit, and captured volume broken down by terminal.

The only required request parameter is batchId. Batch IDs are returned with every transaction response and can be discovered using the Batch History API.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func batchDetailsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BatchDetailsRequest{
        BatchID: "<BATCH ID>",
    }

    response, err := client.BatchDetails(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Transaction History
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This endpoint provides several different methods to sift through transaction history.

By default with no filtering properties, this endpoint will return the 250 most recent transactions.

Limiting Results

This API will return a maximum of 50 results in a single query. Use the maxResults property to limit maximum results even further and use the startIndex property to page through results that span multiple queries.

For example, if you want the ten most recent batches, pass in a value of 10 for maxResults. Also note that startIndex is zero based. Use a value of 0 to get the first transaction in the dataset.

Filtering By Date Range

You can also filter results by date. Use the startDate and endDate properties to return only transactions run between those dates. You can use either startDate or endDate and you can use date filters in conjunction with maxResults and startIndex

Filtering By Batch

To restrict results to a single batch, pass in the batchId parameter.

Filtering By Terminal

To restrict results to those executed on a single terminal, pass in the terminal name.

Combining Filters

None of the above filters are mutually exclusive. You can combine any of the above properties in a single request to restrict transaction results to a narrower set of results.

Searching Transaction History

You can search transaction history by passing in search criteria with the query option. The search system will match the amount (requested and authorized), last four of the card number, cardholder name, and the auth code.

Note that when search queries are used, terminalName or batch id filters are not supported.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func transactionHistoryExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TransactionHistoryRequest{
        MaxResults: 10,
        BatchID:    "<BATCH ID>",
    }

    response, err := client.TransactionHistory(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

List Queued Transactions
  • API Credential Types: Merchant
  • Required Role: Payment API Access

Returns a list of transaction refs of transactions queued on a terminal. Details about the transactions can be retrieved using the Transaction Status API.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func listQueuedTransactionsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.ListQueuedTransactionsRequest{
        TerminalName: "Test Terminal",
    }

    response, err := client.ListQueuedTransactions(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Queued Transaction
  • API Credential Types: Merchant
  • Required Role: Payment API Access

Deletes one or all queued transactions from a terminal. If * is passed as a transaction ref, then the entire terminal queue will be cleared. An error is returned if the passed transaction ref is not queued on the terminal.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteQueuedTransactionExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.DeleteQueuedTransactionRequest{
        TerminalName:   "Test Terminal",
        TransactionRef: "*",
    }

    response, err := client.DeleteQueuedTransaction(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terminal Management Endpoints

These APIs support terminal management functions and additional terminal features such as line item display, messages, and interactive prompts.
These features can be used to extend a point of sale system's functionality.

Terminal Ping
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This simple test transaction helps ensure good communication with a payment terminal and is usually the first test you'll run in development.

It tests communication with the terminal and returns a positive response if everything is okay. It works the same way in local or cloud relay mode.

If you get a positive response, you've successfully verified all of the following:

  • The terminal is online.
  • There is a valid route to the terminal.
  • The API Credentials are valid.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func pingExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.PingRequest{
        TerminalName: "Test Terminal",
    }

    response, err := client.Ping(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terminal Locate
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This endpoint returns a terminal's routing and location information.

The result will indicate whether or not the terminal is in cloud relay mode and will return the local IP address if the terminal is in local mode.

The terminal will also return the public key for the terminal.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func locateExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.LocateRequest{
        TerminalName: "Test Terminal",
    }

    response, err := client.Locate(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terminal Clear
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API interrupts whatever a terminal may be doing and returns it to the idle state.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func clearExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.ClearTerminalRequest{
        Test:         true,
        TerminalName: "Test Terminal",
    }

    response, err := client.Clear(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terminal Status
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API returns the current status of a payment terminal. This is typically used as a way to determine if the terminal is busy before sending a new transaction.

If the terminal is busy, idle will be false and the status field will return a short string that indicates the transaction type currently in progress. The system will also return the timestamp of the last status change in the since field.

The cardInSlot field in the response will indicates whether or not a card is currently in the card reader slot.

If the system is running a payment transaction and you wisely passed in a Transaction Ref, this API will also return the Transaction Ref of the in progress transaction.

The table below lists all possible status responses.

Status Code Description
idle The terminal is idle and ready for transactions. The default branding is being displayed.
activate The terminal is in the process of activating and pairing with the merchant account.
balance A balance check (EBT or Gift Card) is pending on the terminal.
boolean-prompt A boolean prompt (yes/no) operation is pending on the terminal.
signature A signature capture is pending.
crypto A cryptocurrency transaction is pending.
enroll A token vault enrollment operation is pending.
gift-activate A gift card activation operation is in progress.
message The terminal is displaying a custom message.
charge The terminal is executing a charge transaction.
preauth The terminal is executing a preauth transaction.
refund The terminal is executing a refund transaction.
survey The terminal is displaying post transaction survey questions.
terms-and-conditions The terminal is pending terms and conditions acceptance and signature.
text-prompt The terminal is awaiting response to a text input prompt.
txdisplay The terminal is displaying transaction and/or line item level details.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func terminalStatusExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TerminalStatusRequest{
        TerminalName: "Test Terminal",
    }

    response, err := client.TerminalStatus(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Capture Signature
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This endpoint captures a written signature from the terminal and returns the image.

Unlike the Terms & Conditions API, this endpoint performs basic signature capture with no agreement display or signature archival.

Under the hood, signatures are captured in a proprietary vector format and must be converted to a common raster format in order to be useful to most applications. At a minimum, you must specify an image format using the sigFormat parameter. Currently, JPG and PNG are supported.

By default, images are returned in the JSON response as hex encoded binary. You can redirect the binary image output to a file using the sigFile parameter.

You can also scale the output image to your preferred width by passing in a sigWidth parameter. The image will be scaled to that width, preserving the aspect ratio of the original image.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func captureSignatureExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CaptureSignatureRequest{
        TerminalName: "Test Terminal",

        // file format for the signature image.
        SigFormat: blockchyp.SignatureFormatPNG,

        // width of the signature image in pixels.
        SigWidth: 200,
    }

    response, err := client.CaptureSignature(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

New Transaction Display
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API sends totals and line item level data to the terminal.

At a minimum, you should send total information as part of a display request, including total, tax, and subtotal.

You can also send line item level data and each line item can have a description, qty, price, and extended price.

If you fail to send an extended price, BlockChyp will multiply the qty by the price. However, we strongly recommend you precalculate all the fields yourself to ensure consistency. For example, your treatment of floating-point multiplication and rounding may differ slightly from BlockChyp's.

Discounts

You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func newTransactionDisplayExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TransactionDisplayRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Transaction: &blockchyp.TransactionDisplayTransaction{
            Subtotal: "60.00",
            Tax:      "5.00",
            Total:    "65.00",
            Items: []*blockchyp.TransactionDisplayItem{
                &blockchyp.TransactionDisplayItem{
                    Description: "Leki Trekking Poles",
                    Price:       "35.00",
                    Quantity:    2,
                    Extended:    "70.00",
                    Discounts: []*blockchyp.TransactionDisplayDiscount{
                        &blockchyp.TransactionDisplayDiscount{
                            Description: "memberDiscount",
                            Amount:      "10.00",
                        },
                    },
                },
            },
        },
    }

    response, err := client.NewTransactionDisplay(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Update Transaction Display
  • API Credential Types: Merchant
  • Required Role: Payment API Access

Similar to New Transaction Display, this variant allows developers to update line item level data currently being displayed on the terminal.

This feature is designed for situations where you want to update the terminal display as items are scanned. You'll only have to send information to the terminal that's changed, which usually means the new line item and updated totals.

If the terminal is not in line item display mode and you invoke this endpoint, the first invocation will behave like a New Transaction Display call.

At a minimum, you should send total information as part of a display request, including total, tax, and subtotal.

You can also send line item level data and each line item can have a description, qty, price, and extended price.

If you fail to send an extended price, BlockChyp will multiply the qty by the price. However, we strongly recommend you precalculate all the fields yourself to ensure consistency. For example, your treatment of floating-point multiplication and rounding may differ slightly from BlockChyp's.

Discounts

You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func updateTransactionDisplayExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TransactionDisplayRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Transaction: &blockchyp.TransactionDisplayTransaction{
            Subtotal: "60.00",
            Tax:      "5.00",
            Total:    "65.00",
            Items: []*blockchyp.TransactionDisplayItem{
                &blockchyp.TransactionDisplayItem{
                    Description: "Leki Trekking Poles",
                    Price:       "35.00",
                    Quantity:    2,
                    Extended:    "70.00",
                    Discounts: []*blockchyp.TransactionDisplayDiscount{
                        &blockchyp.TransactionDisplayDiscount{
                            Description: "memberDiscount",
                            Amount:      "10.00",
                        },
                    },
                },
            },
        },
    }

    response, err := client.UpdateTransactionDisplay(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Display Message
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API displays a message on the payment terminal.

Just specify the target terminal and the message using the message parameter.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func messageExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MessageRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Message:      "Thank you for your business.",
    }

    response, err := client.Message(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Boolean Prompt
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API Pprompts the customer to answer a yes or no question.

You can specify the question or prompt with the prompt parameter and the response is returned in the response field.

This can be used for a number of use cases including starting a loyalty enrollment workflow or customer facing suggestive selling prompts.

Custom Captions

You can optionally override the "YES" and "NO" button captions by using the yesCaption and noCaption request parameters.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func booleanPromptExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BooleanPromptRequest{
        Test:         true,
        TerminalName: "Test Terminal",
        Prompt:       "Would you like to become a member?",
        YesCaption:   "Yes",
        NoCaption:    "No",
    }

    response, err := client.BooleanPrompt(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Text Prompt
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API prompts the customer to enter numeric or alphanumeric data.

Due to PCI rules, free-form prompts are not permitted when the response could be any valid string. The reason for this is that a malicious developer (not you, of course) could use text prompts to ask the customer to input a card number or PIN code.

This means that instead of providing a prompt, you provide a promptType instead.

The prompt types currently supported are listed below:

  • phone: Captures a phone number.
  • email: Captures an email address.
  • first-name: Captures a first name.
  • last-name: Captures a last name.
  • customer-number: Captures a customer number.
  • rewards-number: Captures a rewards number.

You can specify the prompt with the promptType parameter and the response is returned in the response field.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func textPromptExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TextPromptRequest{
        Test:         true,
        TerminalName: "Test Terminal",

        // Type of prompt. Can be 'email', 'phone', 'customer-number', or 'rewards-number'.
        PromptType: blockchyp.PromptTypeEmail,
    }

    response, err := client.TextPrompt(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

List Terminals
  • API Credential Types: Merchant & Partner
  • Required Role: Terminal Management

This API returns details about terminals associated with a merchant account.

Status and resource information is returned for all terminals along with a preview of the current branding image displayed on the terminal

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func terminalsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TerminalProfileRequest{}

    response, err := client.Terminals(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Deactivate Terminal
  • API Credential Types: Merchant & Partner
  • Required Role: Terminal Management

This API deactivates a payment terminal.

If the terminal exists and is currently online, it will be removed from the merchant's terminal inventory. The terminal will be remotely cleared and factory reset.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deactivateTerminalExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TerminalDeactivationRequest{
        TerminalID: "<TERMINAL ID>",
    }

    response, err := client.DeactivateTerminal(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Activate Terminal
  • API Credential Types: Merchant & Partner
  • Required Role: Terminal Management

This API activates a payment terminal.

If successful, the payment terminal will restart, generate new encryption keys, and download any active branding assets for the merchant account it's been added to.

Activation requests require an activation code and a unique terminal name. All terminal names must be unique across a merchant account.

Optional Parameters

  • merchantId: For partner scoped API credentials, a merchant ID is required. For merchant scoped API credentials, the merchant ID is implicit and cannot be overridden.
  • cloudRelay: Activates the terminal in cloud relay mode.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func activateTerminalExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TerminalActivationRequest{
        TerminalName:   "Test Terminal",
        ActivationCode: "<ACTIVATION CODE>",
    }

    response, err := client.ActivateTerminal(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Reboot Terminal
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API reboots the terminal.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func rebootExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.PingRequest{
        TerminalName: "Test Terminal",
    }

    response, err := client.Reboot(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terms & Conditions Endpoints

Developers can use BlockChyp to display and capture acceptance of contracts or agreements related to transactions. These agreements can be any long-form contract ranging from rental agreements to HIPPA disclosures.

There are two basic approaches to terms and conditions capture. Merchants can store contract templates in BlockChyp or they can send the full agreement text as part of every API call. The right approach will largely depend on whether or not the system being integrated with BlockChyp already has a mechanism for organizing and managing agreements. For systems that already have this feature built in, it's probably not necessary to use Terms and Conditions.

When agreements are displayed on a terminal, the consumer can scroll through and read the entire agreement, and provide a signature. Results are returned as part of the API response, but BlockChyp also stores a record of the agreement including the signature image, timestamp, and the full text of the agreement that was agreed to.

The Terms and Conditions Log APIs can be used to search and retrieve acceptance records. Those records can also be linked to a transaction if a transaction id is provided with the original API request.

Terms & Conditions Capture
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API allows you to prompt a customer to accept a legal agreement on the terminal and (usually) capture their signature.

Content for the agreement can be specified in two ways. You can reference a previously configured T&C template or pass in the full agreement text with every request.

Using Templates

If your application doesn't keep track of agreements you can leverage BlockChyp's template system. You can create any number of T&C Templates in the merchant dashboard and pass in the tcAlias flag to specify which one should display.

Raw Content

If your system keeps track of the agreement language or executes complicated merging and rendering logic, you can bypass our template system and pass in the full text with every transaction. Use tcName to pass in the agreement name and tcContent to pass in the contract text. Note that only plain text is supported.

Bypassing Signatures

Signature images are captured by default. If for some reason this doesn't fit your use case and you'd like to capture acceptance without actually capturing a signature image, set the disableSignature flag in the request.

Terms & Conditions Log

Every time a user accepts an agreement on the terminal, the signature image (if captured), will be uploaded to the gateway. The image will also be added to the log along with the full text of the agreement. This preserves the historical record in the event that standard agreements or templates change over time.

Associating Agreements with Transactions

To associate a Terms & Conditions log entry with a transaction, just pass in the Transaction ID or Transaction Ref for the associated transaction.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func termsAndConditionsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsRequest{
        Test:         true,
        TerminalName: "Test Terminal",

        // Alias for a Terms and Conditions template configured in the BlockChyp dashboard.
        TCAlias: "hippa",

        // Name of the contract or document if not using an alias.
        TCName: "HIPPA Disclosure",

        // Full text of the contract or disclosure if not using an alias.
        TCContent: "Full contract text",

        // file format for the signature image.
        SigFormat: blockchyp.SignatureFormatPNG,

        // width of the signature image in pixels.
        SigWidth: 200,

        // Whether or not a signature is required. Defaults to true.
        SigRequired: true,
    }

    response, err := client.TermsAndConditions(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

List Templates
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API returns all terms and conditions templates associated with a merchant account.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tcTemplatesExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsTemplateRequest{}

    response, err := client.TCTemplates(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Get Template
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API returns as single terms and conditions template.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tcTemplateExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsTemplateRequest{
        TemplateID: "<TEMPLATE ID>",
    }

    response, err := client.TCTemplate(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Update Template
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API updates or creates a terms and conditions template.

Terms and conditions templates are fairly simple and essentially consist of a name, content, and alias.

The name is the caption that will be displayed at the top of the screen. The alias is a code or short description that will be used in subsequence API calls to refer to the template.

Content is the full text of the contract or agreement. Currently, no special formatting or merge behavior is supported. Only plain text is supported.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tcUpdateTemplateExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsTemplate{
        Alias:   "HIPPA",
        Name:    "HIPPA Disclosure",
        Content: "Lorem ipsum dolor sit amet.",
    }

    response, err := client.TCUpdateTemplate(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Template
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API deletes a terms and conditions template.

If a template is deleted, its alias can be reused and any previous Terms & Conditions log entry derived from the template being deleted is fully preserved since log entries always include a complete independent copy of the agreement text.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tcDeleteTemplateExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsTemplateRequest{
        TemplateID: "<TEMPLATE ID>",
    }

    response, err := client.TCDeleteTemplate(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terms & Conditions Log
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API allows developers to search and sort through terms and conditions log entries.

The default API call with no parameters will return the last 250 log entries in descending order.

Optional parameters can be used to filter and query the data set.

  • transactionId: If provided, returns only those log entries associated with a specific transactions. Paging and date filters are ignored if this parameter is used.
  • maxResults: The max number of results to return in a single page. Defaults to 250 and 250 is the maximum value.
  • startIndex The zero based start index of results within the full result set to return. Used to advance pages. For example, if the page size is 10 and you wish to return the second page of results, send a startIndex of 10.
  • startDate: An optional start date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)
  • endDate: An optional end date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tcLogExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsLogRequest{
        LogEntryID: "<LOG ENTRY ID>",
    }

    response, err := client.TCLog(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terms & Conditions Details
  • API Credential Types: Merchant
  • Required Role: Terms & Conditions Management

This API returns details for a single terms and conditions log entry. The logEntryId of the record to be returned is the only required parameter.

The signature image is returned as Base 64 encoded binary in the image format specified by the sigFormat field. The default format is PNG.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tcEntryExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TermsAndConditionsLogRequest{
        LogEntryID: "<ENTRY ID>",
    }

    response, err := client.TCEntry(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Token Management

BlockChyp supports saved payments and recurring payments through the use of tokens. Tokens can be created via the Enroll API or the web tokenizer. Once created, these tokens can be used for subsequent payments or associated with customer records as saved payment methods.

Tokens are limited to a single merchant by default, but can be shared across an organization for multi-location merchants by special arrangement with BlockChyp. Contact your BlockChyp rep to setup token sharing.

Enroll
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API allows you to tokenize and enroll a payment method in the token vault. You can also pass in customer information and associate the payment method with a customer record.

A token is returned in the response that can be used in subsequent charge, preauth, and refund transactions.

Gift Cards and EBT

Gift Cards and EBT cards cannot be tokenized.

E-Commerce Tokens

The tokens returned by the enroll API and the e-commerce web tokenizer are the same tokens and can be used interchangeably.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func enrollExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.EnrollRequest{
        Test:         true,
        TerminalName: "Test Terminal",
    }

    response, err := client.Enroll(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Approved {
        fmt.Println("approved")
    }

    fmt.Printf("Response: %+v\n", response)
}

Token Metadata
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API retrieves status and metadata information about a token, including any links to customer records.

This will also return any customer records related to the card behind the token. If the underlying card has been tokenized multiple times, all customers related to the card will be returned, even if those customer associations are related to other tokens.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func tokenMetadataExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.TokenMetadataRequest{
        Token: "<TOKEN>",
    }

    response, err := client.TokenMetadata(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API links a payment token with a customer record. Usually this would only be needed to reverse a previous unlink operation.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func linkTokenExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.LinkTokenRequest{
        Token:      "<TOKEN>",
        CustomerID: "<CUSTOMER ID>",
    }

    response, err := client.LinkToken(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API removes a payment token link from a customer record.

This will remove links between the customer record and all tokens for the same underlying card.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func unlinkTokenExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.UnlinkTokenRequest{
        Token:      "<TOKEN>",
        CustomerID: "<CUSTOMER ID>",
    }

    response, err := client.UnlinkToken(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Token
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API deletes a payment token from the gateway. Tokens are automatically deleted if they have not been used for a year.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteTokenExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.DeleteTokenRequest{
        Token: "<TOKEN>",
    }

    response, err := client.DeleteToken(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Customer Endpoints

These APIs allow developers to create and manage customer records in BlockChyp. Developers who wish to use BlockChyp for tokenized recurring payments can use tokens directly if they have their own customer management system. However, BlockChyp provides additional tools for managing customers and keeping track of a customer's saved payment tokens.

In addition, if customer features are used, BlockChyp can detect a payment method associated with an existing customer, and return customer data with payment transactions. This can be used as a passive method to detect repeat customers.

Update Customer
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API adds or updates a customer record.

If you pass in customer information including firstName, lastName, email, or sms without any Customer ID or Customer Ref, a new record will be created.

If you pass in customerRef and customerId, the customer record will be updated if it exists.

Customer Ref

The customerRef field is optional, but highly recommended as this allows you to use your own customer identifiers instead of storing BlockChyp's Customer IDs in your systems.

Creating Customer Records With Payment Transactions

If you have customer information available at the time a payment transaction is executed, you can pass all the same customer information directly into a payment transaction. BlockChyp will create a customer record at the same time payment is captured. The advantage of this approach is that the customer's payment card is automatically associated with the customer record in a single step. If the customer uses the payment card in the future, the customer data will automatically be returned. You won't need to ask the customer to provide any additional information.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func updateCustomerExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.UpdateCustomerRequest{
        Customer: blockchyp.Customer{
            ID:           "<CUSTOMER ID>",
            CustomerRef:  "Customer reference string",
            FirstName:    "FirstName",
            LastName:     "LastName",
            CompanyName:  "Company Name",
            EmailAddress: "notifications@blockchypteam.m8r.co",
            SmsNumber:    "(123) 123-1231",
        },
    }

    response, err := client.UpdateCustomer(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Retrieve Customer
  • API Credential Types: Merchant
  • Required Role: Payment API Access

With this API, you can retrieve detailed information about a customer record, including saved payment methods if available.

Customers can be looked up by customerId or customerRef.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func customerExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CustomerRequest{
        CustomerID: "<CUSTOMER ID>",
    }

    response, err := client.Customer(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Search Customer
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API searches the customer database and returns matching results.

Use query to pass in a search string and the system will return all results whose first or last names contain the query string.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func customerSearchExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.CustomerSearchRequest{
        Query: "(123) 123-1234",
    }

    response, err := client.CustomerSearch(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Customer
  • API Credential Types: Merchant
  • Required Role: Payment API Access

This API deletes a customer record.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteCustomerExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.DeleteCustomerRequest{
        CustomerID: "<CUSTOMER ID>",
    }

    response, err := client.DeleteCustomer(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Survey Reference

These APIs are used to work with post-transaction surveys and survey data.

Merchants can optionally configure scaled (1-5) or yes/no questions that can be presented to consumers after every approved Charge and Preauth transaction. Surveys do not require any custom programming and merchants can simply configure them without the point-of-sale system needing any additional customization.

However, these APIs allow point-of-sale or third-party system developers to integrate survey question configuration or result visualization into their own systems.

List Questions
  • API Credential Types: Merchant
  • Required Role: Survey Management

This API returns all survey questions in the order in which they would be presented on the terminal.

All questions are returned, whether enabled or disabled.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func surveyQuestionsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SurveyQuestionRequest{}

    response, err := client.SurveyQuestions(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Question Details
  • API Credential Types: Merchant
  • Required Role: Survey Management

This API returns a single survey question with response data. questionId is required.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func surveyQuestionExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SurveyQuestionRequest{
        QuestionID: "<QUESTION ID>",
    }

    response, err := client.SurveyQuestion(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Update Question
  • API Credential Types: Merchant
  • Required Role: Survey Management

This API updates or creates survey questions. questionText and questionType are required fields. The following values are valid for questionType.

  • yes_no: Use for simple yes or no questions.
  • scaled: Displays the question with buttons that allow the customer to respond with values from 1 through 5.

Questions are disabled by default. Pass in enabled to enable a question.

The ordinal field is used to control the sequence of questions when multiple questions are enabled. We recommend keeping the number of questions minimal.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func updateSurveyQuestionExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SurveyQuestion{
        ID:           "<QUESTION ID>",
        Ordinal:      1,
        QuestionText: "Would you shop here again?",
        QuestionType: "yes_no",
        Enabled:      true,
    }

    response, err := client.UpdateSurveyQuestion(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Question
  • API Credential Types: Merchant
  • Required Role: Survey Management

This API deletes a survey question. questionId is a required parameter.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteSurveyQuestionExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SurveyQuestionRequest{
        QuestionID: "<QUESTION ID>",
    }

    response, err := client.DeleteSurveyQuestion(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Survey Results
  • API Credential Types: Merchant
  • Required Role: Survey Management

This API returns survey results for a single question.

The results returned include the response rate, which is the percentage of transactions after which the consumer provided an answer.

The responses array breaks down the results by answer, providing the total number of responses, the answer's percentage of the total, and the average transaction amount associated with a specific answer.

By default, all results based on all responses are returned. However, developers may optionally provide startDate and endDate parameters to return only responses provided between certain dates.

startDate and endDate can be provided in MM/DD/YYYY or YYYY-MM-DD format.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func surveyResultsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SurveyResultsRequest{
        QuestionID: "<QUESTION ID>",
    }

    response, err := client.SurveyResults(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Media and Branding Control

BlockChyp has a sophisticated terminal media and branding control platform. Terminals can be configured to display logos, images, videos, and slide shows when a terminal is idle. Branding assets can be configured at the partner, organization, and merchant level with fine-grained hour-by-hour schedules, if desired.

Conceptually, all branding and media start with the media library. Merchants, Partners, and Organizations can upload images or video and build branding assets from uploaded media.

Slide shows can combine images from the media library into a timed loop of repeating images.

Branding Assets can then be used to combine media or slide shows with priority and timing rules to create what we call the Terminal Branding Stack.

We call a group of branding assets the Terminal Branding Stack because there are implicit rules about which branding assets take priority. For example, a merchant with no branding assets configured will inherit the branding rules from any organization to which the merchant may belong. If the merchant doesn't belong to an organization or the organization has no branding rules configured, then the system will defer to branding defaults established by the point-of-sale or software partner that owns the merchant.

This feature enables partners and organizations (multi-store operators and large national chains) to configure branding for potentially thousands of terminals from a single interface.

Terminal Branding can also be configured at the individual terminal level and a merchant's terminal fleet can be broken into groups and branding configured at the group level. Branding configured at the terminal level will always override branding from any higher level group.

The order of priority for the Terminal Branding Stack is given below.

  • Terminal
  • Terminal Group
  • Merchant
  • Organization (Region, Chain, etc)
  • Partner
  • BlockChyp Default Logo
Media Library
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API returns the entire media library associated with the API Credentials (Merchant, Partner, or Organization). The media library results will include the ID used to reference a media asset in slide shows and branding assets along with the full file url and thumbnail.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func mediaExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MediaRequest{}

    response, err := client.Media(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Upload Media
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API supports media library uploads. The operation of this API works slightly differently depending on the SDK platform. In all cases, the intent is to allow the file's binary to be passed into the SDK using the lowest level I/O primitive possible in order to support situations where developers aren't working with literal files. It might be (and usually is) more convenient to work with buffers, raw bytes, or streams.

For example, the Go implementation accepts an io.Reader and the Java implementation accepts a java.io.InputStream. The CLI does accept a literal File URL via the -file command line parameter.

The following file formats are accepted as valid uploads:

  • .png
  • .jpg
  • .jpeg
  • .gif
  • .mov
  • .mpg
  • .mp4
  • .mpeg

The UploadMetadata object allows developers to pass additional metadata about the upload including fileName, fileSize, and uploadId.

None of these values are required, but providing them can unlock some additional functionality relating to media uploads. fileName will be used to record the original file name in the media library. fileSize and uploadId are used to support upload status tracking, which is especially useful for large video file uploads.

The fileSize should be the file's full size in bytes.

The uploadId value can be any random string. This is the value you'll use to check the status of an upload via the Upload Status API. This API will return information needed to drive progress feedback on uploads and return video transcoding information.

package main

import (
    "fmt"
    "log"
    "os"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func uploadMediaExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.UploadMetadata{
        FileName: "aviato.png",
        FileSize: 18843,
        UploadID: "<RANDOM ID>",
    }

    file, err := os.Open("filename.png")
    if err != nil {
        log.Fatal(err)
    }
    response, err := client.UploadMedia(request, file)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Upload Status
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API returns status and progress information about in progress or recently completed uploads.

Before calling this API, developers must first start a file upload with fileSize and uploadId parameters.

The data structure returned will include the file size, number of bytes uploaded, a narrative status and flags indicating whether or not the upload is complete or post upload processing is in progress.
If the upload is completed, the ID assigned to the media asset and a link to the thumbnail image will also be returned.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func uploadStatusExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.UploadStatusRequest{
        UploadID: "<UPLOAD ID>",
    }

    response, err := client.UploadStatus(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Get Media Asset
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API returns a detailed media asset. The data returned includes the exact same media information returned by the full media library endpoint, including fully qualified URLs pointing to the original media file and the thumbnail.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func mediaAssetExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MediaRequest{
        MediaID: "<MEDIA ASSET ID>",
    }

    response, err := client.MediaAsset(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Media Asset
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API deletes a media asset. Note that a media asset cannot be deleted if it is in use in a slide show or in the terminal branding stack.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteMediaAssetExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MediaRequest{
        MediaID: "<MEDIA ASSET ID>",
    }

    response, err := client.DeleteMediaAsset(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

List Slide Shows
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API returns all slide shows.

Note that slide level data is not returned with this API. Use the Get Slide Show API to get slide level detail.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func slideShowsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SlideShowRequest{}

    response, err := client.SlideShows(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Get Slide Show
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API returns a single slide show. Slide level detail is returned with the fully qualified thumbnail URL for each slide.

slideShowId is the only required parameter.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func slideShowExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SlideShowRequest{
        SlideShowID: "<SLIDE SHOW ID>",
    }

    response, err := client.SlideShow(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Update Slide Show
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API updates or creates a slide show. name, delay and slides are required.

The slides property is an array of slides. The Slide data structure has ordinal and thumbnail URL fields, but these are not required when updating or creating a slide show. Only the mediaId field is required when updating or creating a slide show.

When using the CLI, slides can be specified by sending a comma-separated list of media ids via the -mediaId parameter.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func updateSlideShowExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SlideShow{
        Name:  "Test Slide Show",
        Delay: 5,
        Slides: []*blockchyp.Slide{
            &blockchyp.Slide{
                MediaID: "<MEDIA ID>",
            },
        },
    }

    response, err := client.UpdateSlideShow(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Slide Show
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API deletes a slide show slideShowId is the only required parameter.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteSlideShowExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.SlideShowRequest{
        SlideShowID: "<SLIDE SHOW ID>",
    }

    response, err := client.DeleteSlideShow(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Terminal Branding
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API returns the full branding stack for a given API scope in the order of priority.

Consumers of this API should pay special attention to the editable field. This field indicates whether or not a branding asset is read-only from the perspective of a particular API Credential scope.

The thumbnail and previewImage attributes can be used to support building user interfaces for managing the branding stack. previewImage differs from thumbnail in that the preview image is intended to show how an asset would actually look when displayed on the terminal.

activeAsset returns the asset that is currently visible on the terminal.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func terminalBrandingExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BrandingAssetRequest{}

    response, err := client.TerminalBranding(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Update Branding Asset
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API updates or creates a single Branding Asset.

Branding Assets represent a single element of the terminal branding stack. A Branding Asset can be a video or image, in which case a mediaId referencing an asset from the media library must be provided. A Branding Asset can also be a slide show, in which case slideShowId must be provided. Branding Assets must have a valid mediaId or a valid slideShowId. The optional notes field can be used to provide short notes and descriptions for a Branding asset.

Visibility Flags

In order for a Branding Asset to be visible on a terminal, the enabled flag must be set to true and the preview must be turned off. preview is intended to show how a proposed Branding Asset will behave without pushing it to live terminals. The Publish button in the BlockChyp merchant portal effectively turns the preview setting off.

Order and Sequencing

The ordinal field is used to specify priority for a Branding Asset. Assets with a higher value for ordinal will be prioritized first.

Padding Images

For plain images, it's sometimes helpful to add margins to images. This is especially helpful with logos or any image file rendered without any white space or margins between the image content and edge of the image file. Set the padded flag to true if you'd like BlockChyp to auto apply margins when displaying an image on the terminal.

Scheduling

By default, a Branding Asset placed on top of the Branding Stack, if it's enabled and not in preview mode, will immediately be displayed on the terminal round the clock.

Branding Assets can be scheduled with effective start and stop dates for seasonal campaigns. These assets can also be scheduled for specific times of day and specific days of the week.

  • startDate: Optional date after which the Branding Asset is eligible for display. Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
  • endDate: Optional date before which the Branding Asset is eligible for display. Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
  • startTime Optional time of day after which the branding asset is eligible for display. Must be provided in 24 hour time: HH:MM.
  • endTime Optional time of day before which the branding asset is eligible for display. Must be provided in 24 hour time format: HH:MM
  • daysOfWeek For branding assets that should only be displayed on certain days of the week, this field is an array of day of the week constants. (Constants vary by SDK platform.)

Read Only Fields

The Branding Asset data structure has a number of read only fields that are returned when Branding Assets are retrieved. But these fields are ignored when you try to send them as part of an update. These are derived or calculated fields and are helpful for displaying branding assets in a management user interface, but cannot be changed via an API call.

These fields are:

  • ownerId
  • merchantId
  • organizationId
  • partnerId
  • userId
  • userName
  • thumbnail
  • lastModified
  • editable
  • assetType
  • ownerType
  • ownerTypeCaption
  • previewImage
  • narrativeEffectiveDates
  • narrativeDisplayPeriod
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func updateBrandingAssetExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BrandingAsset{
        MediaID:   "<MEDIA ID>",
        Padded:    true,
        Ordinal:   10,
        StartDate: "01/06/2021",
        StartTime: "14:00",
        EndDate:   "11/05/2024",
        EndTime:   "16:00",
        Notes:     "Test Branding Asset",
        Preview:   false,
        Enabled:   true,
    }

    response, err := client.UpdateBrandingAsset(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Branding Asset
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Media Management

This API deletes a Branding Asset from the branding stack.

Note that deleting a Branding Asset does not delete the underlying media from the media library or slide show from the slide show library.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteBrandingAssetExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.BrandingAssetRequest{
        AssetID: "<BRANDING ASSET ID>",
    }

    response, err := client.DeleteBrandingAsset(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Merchant Management

These APIs allow partners to manage and configure their merchant portfolios.

Use of these APIs (other than the Merchant Profile API) requires partner scoped API credentials with special roles and permissions that may require a special arrangement with BlockChyp.

For example, Partners usually can't board merchants directly, but must board merchants using the standard underwriting process via offer codes and invitations.

Merchant Profile
  • API Credential Types: Merchant
  • Required Role: Payment API Access

The API returns detailed metadata about the merchant's configuration, including basic identity information, terminal settings, store and forward settings, and bank account information for merchants that support split settlement.

Some of these fields can be updated via the Update Merchant API, but many of these fields are controlled by underwriting and cannot be altered outside of the underwriting and risk processes.

Merchant Descriptive Fields

The following fields are basic descriptive fields that can be used to describe and identify merchants.

  • companyName: The merchant's official corporate entity name.
  • dbaName: The business's DBA (doing business as) name.
  • contactName: Name of the merchant's primary control contact.
  • contactNumber: Primary control contact's phone number.
  • locationName: Optional location name for multi-location operators.
  • storeNumber: Optional store number for multi-location operators.
  • partnerRef: Optional reference number partners can add to a merchant record. Usually the partner's own identifier for the merchant.
  • timeZone: Unix style local time zone for the merchant. Example: America/New_York.
  • publicKey: Read only field. The merchant's blockchain public key. Generated and assigned when a merchant account is first created.
  • billingAddress: Address for billing and written correspondence.
  • shippingAddress: Physical shipping address. Usually the actual street address of the business.
  • status: Current status of the merchant account.
  • tcDisabled: Disables all terms and conditions features in the merchant dashboard. Used to hide the feature if a partner has not chosen to support it.
  • gatewayOnly: Indicates that a merchant has been boarded in gateway only mode. Not common.

Batch and Terminal Settings

The following fields are used to control batch closure and high level terminal configuration.

  • batchCloseTime: Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time. Defaults to 3 AM.
  • autoBatchClose: Flag the determines whether or not batches will automatically close. Defaults to true.
  • disableBatchEmails: Flag that optionally turns off automatic batch closure notification emails.
  • cooldownTimeout: The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal. After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
  • surveyTimeout: The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
  • pinEnabled: Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs. Will be ignored if terminals are not injected with the proper encryption keys.
  • pinBypassEnabled: Enable pin bypass for debit transactions.
  • cashBackEnabled: Enables cash back for debit transactions.
  • cashbackPresets: An array of four default values for cashback amounts when cashback is enabled.
  • storeAndForwardEnabled: Enables automatic store and forward during network outages. Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
  • storeAndForwardFloorLimit: Maximum dollar value of a store and forward transaction.
  • ebtEnabled: Enables EBT (SNAP) on BlockChyp terminals.
  • tipEnabled: Enables tips entry on the terminal.
  • promptForTip: If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
  • tipDefaults: An array of exactly three percentages that will be used to calculate default tip amounts.
  • giftCardsDisabled: Disables BlockChyp gift cards. Normally only used if the merchant is using an alternate gift card system.
  • digitalSignaturesEnabled: Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
  • digitalSignatureReversal: Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
  • manualEntryEnabled: Enables manual card entry.
  • manualEntryPromptZip: Requires zip code based address verification for manual card entry.
  • manualEntryPromptStreetNumber: Requires street/address based verification for manual card entry.

Card Brand and Transaction Settings

  • freeRangeRefundsEnabled: Enables direct refunds that do not reference a previous transaction.
  • partialAuthEnabled: Indicates that partial authorizations (usually for gift card support) are enabled.
  • splitBankAccountsEnabled: Used for law firm merchants only.
  • contactlessEmv: Enables contactless/tap transactions on a terminal. Defaults to true.
  • visa: Enables Visa transactions.
  • masterCard: Enables MasterCard transactions.
  • amex: Enables American Express transactions.
  • discover: Enables Discover transactions.
  • jcb: Enables JCB (Japan Card Bureau) transactions.
  • unionPay: Enables China UnionPay transactions.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func merchantProfileExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MerchantProfileRequest{}

    response, err := client.MerchantProfile(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Get Merchants
  • API Credential Types: Partner & Organization
  • Required Role: Merchant Management

This is a partner or organization level API that can be used to return the merchant portfolio.

Live merchants are returned by default. Use the test flag to return only test merchants. The results returned include detailed settings including underwriting controlled flags.

A maximum of 250 merchants are returned by default. For large merchant portfolios, the maxResults and startIndex field can be used to reduce the page size and page through multiple pages of results.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func getMerchantsExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.GetMerchantsRequest{
        Test: true,
    }

    response, err := client.GetMerchants(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Update Merchant
  • API Credential Types: Merchant, Partner, & Organization
  • Required Role: Merchant Management

This API can be used to update or create merchant accounts.

Merchant scoped API credentials can be used to update merchant account settings.

Partner scoped API credentials can be used to update merchants, create new test merchants or board new gateway merchants.

Merchant Descriptive Fields

The following fields are basic descriptive fields that can be used to describe and identify merchants.

  • companyName: The merchant's official corporate entity name.
  • dbaName: The businesses DBA (doing business as) name.
  • contactName: Name of the merchant's primary control contact.
  • contactNumber: Primary control contact's phone number.
  • locationName: Optional location name for multi location operators.
  • storeNumber: Optional store number for multi location operators.
  • partnerRef: Optional reference number partners can add to a merchant record. Usually the partner's own identifier for the merchant.
  • timeZone: Unix style local time zone for the merchant. Example: America/New_York.
  • publicKey: Read only field. The merchant's blockchain public key. Generated and assigned when a merchant account is first created.
  • billingAddress: Address for billing and written correspondence.
  • shippingAddress: Physical shipping address. Usually the actual street address of the business.
  • status: Current status of the merchant account.
  • tcDisabled: Disables all terms and conditions features in the merchant dashboard. Used to hide the feature if a partner has not chosen to support it.
  • gatewayOnly: Indicates that a merchant has been boarded in gateway only mode. Not common.

Batch and Terminal Settings

The following fields are used to control batch closure and high level terminal configuration.

  • batchCloseTime: Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time. Defaults to 3 AM.
  • autoBatchClose: Flag the determines whether or not batches will automatically close. Defaults to true.
  • disableBatchEmails: Flag that optionally turns off automatic batch closure notification emails.
  • cooldownTimeout: The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal. After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
  • surveyTimeout: The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
  • pinEnabled: Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs. Will be ignored if terminals are not injected with the proper encryption keys.
  • pinBypassEnabled: Enable pin bypass for debit transactions.
  • cashBackEnabled: Enables cash back for debit transactions.
  • cashbackPresets: An array of four default values for cashback amounts when cashback is enabled.
  • storeAndForwardEnabled: Enables automatic store and forward during network outages. Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
  • storeAndForwardFloorLimit: Maximum dollar value of a store and forward transaction.
  • ebtEnabled: Enables EBT (SNAP) on BlockChyp terminals.
  • tipEnabled: Enables tips entry on the terminal.
  • promptForTip: If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
  • tipDefaults: An array of exactly three percentages that will be used to calculate default tip amounts.
  • giftCardsDisabled: Disables BlockChyp gift cards. Normally only used if the merchant is using an alternate gift card system.
  • digitalSignaturesEnabled: Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
  • digitalSignatureReversal: Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
  • manualEntryEnabled: Enables manual card entry.
  • manualEntryPromptZip: Requires zip code based address verification for manual card entry.
  • manualEntryPromptStreetNumber: Requires street/address based verification for manual card entry.

Card Brand and Transaction Settings

  • freeRangeRefundsEnabled: Enables direct refunds that do not reference a previous transaction.
  • partialAuthEnabled: Indicates that partial authorizations (usually for gift card support) are enabled.
  • splitBankAccountsEnabled: Used for law firm merchants only.
  • contactlessEmv: Enables contactless/tap transactions on a terminal. Defaults to true.
  • visa: Enables Visa transactions.
  • masterCard: Enables MasterCard transactions.
  • amex: Enables American Express transactions.
  • discover: Enables Discover transactions.
  • jcb: Enables JCB (Japan Card Bureau) transactions.
  • unionPay: Enables China UnionPay transactions.
package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func updateMerchantExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MerchantProfile{
        MerchantID:  "<MERCHANT ID>",
        Test:        true,
        DBAName:     "Test Merchant",
        CompanyName: "Test Merchant",
        BillingAddress: blockchyp.Address{
            Address1:        "1060 West Addison",
            City:            "Chicago",
            StateOrProvince: "IL",
            PostalCode:      "60613",
        },
    }

    response, err := client.UpdateMerchant(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Merchant Users
  • API Credential Types: Partner & Organization
  • Required Role: Merchant Management

This API returns all users and pending invites associated with a merchant account including any assigned role codes.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func merchantUsersExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MerchantProfileRequest{
        MerchantID: "<MERCHANT ID>",
    }

    response, err := client.MerchantUsers(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Invite Merchant User
  • API Credential Types: Partner & Organization
  • Required Role: Merchant Management

Invites a new user to join a merchant account. email, firstName, and lastName are required.

The user will be sent an invite email with steps for creating a BlockChyp account and linking it to a merchant account. If the user already has a BlockChyp user account, the new user signup wil be skipped and the existing user account will be linked to the merchant account.

Developers can optionally restrict the user's access level by sending one or more role codes. Otherwise, the user will be given the default merchant user role. (STDMERCHANT)

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func inviteMerchantUserExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.InviteMerchantUserRequest{
        Email: "Email address for the invite",
    }

    response, err := client.InviteMerchantUser(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Add Test Merchant
  • API Credential Types: Partner
  • Required Role: Merchant Management

This is a partner level API that can be used to create test merchant accounts. This creates a basic test merchant with default settings.

Settings can be changed by using the Update Merchant API.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func addTestMerchantExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.AddTestMerchantRequest{
        DBAName:     "DBA Name",
        CompanyName: "Corporate Entity Name",
    }

    response, err := client.AddTestMerchant(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Delete Test Merchant
  • API Credential Types: Partner
  • Required Role: Merchant Management

This partner API can be used to delete unused test merchant accounts. merchantId is a required parameter.

package main

import (
    "fmt"
    "log"

    blockchyp "github.com/blockchyp/blockchyp-go"
)

func deleteTestMerchantExample() {
    // sample credentials
    creds := blockchyp.APICredentials{
        APIKey:      "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
        BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
        SigningKey:  "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
    }

    // instantiate the client
    client := blockchyp.NewClient(creds)

    // setup request object
    request := blockchyp.MerchantProfileRequest{
        MerchantID: "<MERCHANT ID>",
    }

    response, err := client.DeleteTestMerchant(request)

    if err != nil {
        log.Fatal(err)
    }

    //process the result
    if response.Success {
        fmt.Println("Success")
    }

    fmt.Printf("Response: %+v\n", response)
}

Running Integration Tests

If you'd like to run the integration tests, create a new file on your system called sdk-itest-config.json with the API credentials you'll be using as shown in the example below.

{
 "gatewayHost": "https://api.blockchyp.com",
 "testGatewayHost": "https://test.blockchyp.com",
 "apiKey": "PZZNEFK7HFULCB3HTLA7HRQDJU",
 "bearerToken": "QUJCHIKNXOMSPGQ4QLT2UJX5DI",
 "signingKey": "f88a72d8bc0965f193abc7006bbffa240663c10e4d1dc3ba2f81e0ca10d359f5"
}

This file can be located in a few different places, but is usually located at <USER_HOME>/.config/blockchyp/sdk-itest-config.json. All BlockChyp SDKs use the same configuration file.

To run the integration test suite via make, type the following command:

make integration

Running Regression Tests

The regression package contains interactive tests that can be run to test the entire stack from end to end.

Setup

Create a default test merchant on the SIM plugin.

Change these settings:

  • Enable partial auth
  • Enable PINs
  • Enable Missing Signature Reversal
  • Enable cash back
  • Enable JCB and Union Pay
  • Whitelist the BIN range for a chosen MSR test card
  • Add a pricing policy:
    • Flat rate: 350 basis points
    • Transaction fee: $0.50

Create a blockchyp.json file with credentials for the test merchant.

Running

To execute the tests, run:

make regression

Follow the prompts.

Contributions

BlockChyp welcomes contributions from the open source community, but bear in mind that this repository has been generated by our internal SDK Generator tool. If we choose to accept a PR or contribution, your code will be moved into our SDK Generator project, which is a private repository.

License

Copyright BlockChyp, Inc., 2019

Distributed under the terms of the MIT license, blockchyp-go is free and open source software.

Other SDKs

BlockChyp has officially supported SDKs for eight different development platforms and counting. Here's the full list with links to their GitHub repositories.

Go SDK

Node.js/JavaScript SDK

Java SDK

.net/C# SDK

Ruby SDK

PHP SDK

Python SDK

iOS (Objective-C/Swift) SDK

Documentation

Index

Constants

View Source
const (
	DefaultGatewayHost     = "https://api.blockchyp.com"
	DefaultDashboardHost   = "https://dashboard.blockchyp.com"
	DefaultTestGatewayHost = "https://test.blockchyp.com"
	DefaultHTTPS           = true
	DefaultRouteCacheTTL   = 60 * time.Minute
	DefaultGatewayTimeout  = 20 * time.Second
	DefaultTerminalTimeout = 2 * time.Minute
)

Default client configuration constants.

View Source
const (
	ConfigDir  = "blockchyp"
	ConfigFile = "blockchyp.json"
)

Default filesystem configuration.

View Source
const (
	ResponseUnknownTerminal = "Unknown Terminal"
	ResponseTimedOut        = "Request Timed Out"
)

Clientside response constants.

View Source
const (
	SignatureFormatNone = ""
	SignatureFormatPNG  = "png"
	SignatureFormatJPG  = "jpg"
	SignatureFormatGIF  = "gif"
)

SignatureFormats.

View Source
const (
	PromptTypeAmount         = "amount"
	PromptTypeEmail          = "email"
	PromptTypePhone          = "phone"
	PromptTypeCustomerNumber = "customer-number"
	PromptTypeRewardsNumber  = "rewards-number"
	PromptTypeFirstName      = "first-name"
	PromptTypeLastName       = "last-name"
)

PromptTypes.

View Source
const (
	AVSResponseNotApplicable             AVSResponse = ""
	AVSResponseNotSupported                          = "not_supported"
	AVSResponseRetry                                 = "retry"
	AVSResponseNoMatch                               = "no_match"
	AVSResponseAddressMatch                          = "address_match"
	AVSResponsePostalCodeMatch                       = "zip_match"
	AVSResponseAddressAndPostalCodeMatch             = "match"
)

AVSResponse types.

View Source
const (
	HealthcareTypeHealthcare   = "healthcare"
	HealthcareTypePrescription = "prescription"
	HealthcareTypeVision       = "vision"
	HealthcareTypeClinic       = "clinic"
	HealthcareTypeDental       = "dental"
)

HealthcareTypes.

View Source
const (
	RoundingModeUp      = "up"
	RoundingModeNearest = "nearest"
	RoundingModeDown    = "down"
)

RoundingMode types

Variables

View Source
var ErrInvalidAsyncRequest = errors.New("async requests must be terminal requests")

ErrInvalidAsyncRequest is returned when a request cannot be called asynchronously.

View Source
var ErrNoChange = errors.New("route unchanged")

ErrNoChange is returned when a route refresh does not produce a new route.

View Source
var ErrUnknownTerminal = errors.New("unknown terminal")

ErrUnknownTerminal is returned when there is no route to a given terminal.

View Source
var Version string

Version contains the version at build time

Functions

func AddUserAgent

func AddUserAgent(transport http.RoundTripper, userAgent string) http.RoundTripper

AddUserAgent adds a user agent header to an http.RoundTripper.

func BuildUserAgent

func BuildUserAgent() string

BuildUserAgent assembles a user agent header for use with requests to the gateway and terminals.

func Decrypt

func Decrypt(key []byte, cipherText string) string

Decrypt performs AES 256/CBC/PKCS7 decryption on the given cipherText with the given key.

func Encrypt

func Encrypt(key []byte, plainText string) string

Encrypt performs AES 256/CBC/PKCS7 encryption on the given plain text with the given key.

func SideLoad added in v1.24.25

func SideLoad(request SideLoadRequest, logger SideLogger) error

SideLoad loads firmware updates onto a terminal elsewhere on the local network

Types

type APICredentials

type APICredentials struct {
	APIKey      string `json:"apiKey"`
	BearerToken string `json:"bearerToken"`
	SigningKey  string `json:"signingKey"`
}

APICredentials models gateway credentials.

type APIRequestHeaders

type APIRequestHeaders struct {
	Timestamp   string
	Nonce       string
	BearerToken string
	APIKey      string
	Signature   string
}

APIRequestHeaders models the http headers required for BlockChyp API requests.

type AVSResponse

type AVSResponse string

AVSResponse indicates the result of address verification.

type AbstractAcknowledgement

type AbstractAcknowledgement struct {
	// Success indicates whether or not the request succeeded.
	Success bool

	// Error is the error, if an error occurred.
	Error string

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string
}

AbstractAcknowledgement contains fields which should be returned with standard requests.

func (AbstractAcknowledgement) From

func (r AbstractAcknowledgement) From(raw interface{}) (result AbstractAcknowledgement, ok bool)

From creates an instance of AbstractAcknowledgement with values from a generic type.

type Acknowledgement

type Acknowledgement struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`
}

Acknowledgement contains a basic api acknowledgement.

type AddTestMerchantRequest

type AddTestMerchantRequest struct {
	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// DBAName the DBA name for the test merchant.
	DBAName string `json:"dbaName"`

	// CompanyName is the corporate name for the test merchant.
	CompanyName string `json:"companyName"`

	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`
}

AddTestMerchantRequest models basic information needed to create a test merchant.

type Address

type Address struct {
	// Address1 is the first line of the street address.
	Address1 string `json:"address1"`

	// Address2 is the second line of the street address.
	Address2 string `json:"address2"`

	// City is the city associated with the street address.
	City string `json:"city"`

	// StateOrProvince is the state or province associated with the street
	// address.
	StateOrProvince string `json:"stateOrProvince"`

	// PostalCode is the postal code associated with the street address.
	PostalCode string `json:"postalCode"`

	// CountryCode is the ISO country code associated with the street address.
	CountryCode string `json:"countryCode"`

	// Latitude is the latitude component of the address's GPS coordinates.
	Latitude float64 `json:"latitude"`

	// Longitude is the longitude component of the address's GPS coordinates.
	Longitude float64 `json:"longitude"`
}

Address models a physical address.

type ApprovalResponse

type ApprovalResponse struct {
	// Approved indicates that the transaction was approved.
	Approved bool

	// AuthCode is the auth code from the payment network.
	AuthCode string

	// AuthResponseCode is the code returned by the terminal or the card issuer
	// to indicate the disposition of the message.
	AuthResponseCode string
}

ApprovalResponse contains response fields for an approved transaction.

func (ApprovalResponse) From

func (r ApprovalResponse) From(raw interface{}) (result ApprovalResponse, ok bool)

From creates an instance of ApprovalResponse with values from a generic type.

type Archive added in v1.24.25

type Archive struct {
	ArchiveIdentifier string   `json:"archiveIdentifier"`
	DownloadURL       string   `json:"downloadUrl"`
	Packages          []string `json:"packages"`
	IncrementalURLs   []string `json:"incrementalUrls"`
}

Archive models a single archive package

type AuthorizationRequest

type AuthorizationRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token is the payment token to be used for this transaction. This should be
	// used for recurring transactions.
	Token string `json:"token,omitempty"`

	// Track1 contains track 1 magnetic stripe data.
	Track1 string `json:"track1,omitempty"`

	// Track2 contains track 2 magnetic stripe data.
	Track2 string `json:"track2,omitempty"`

	// PAN contains the primary account number. We recommend using the terminal
	// or e-commerce tokenization libraries instead of passing account numbers in
	// directly, as this would put your application in PCI scope.
	PAN string `json:"pan,omitempty"`

	// RoutingNumber is the ACH routing number for ACH transactions.
	RoutingNumber string `json:"routingNumber,omitempty"`

	// CardholderName is the cardholder name. Only required if the request
	// includes a primary account number or track data.
	CardholderName string `json:"cardholderName,omitempty"`

	// ExpMonth is the card expiration month for use with PAN based transactions.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year for use with PAN based transactions.
	ExpYear string `json:"expYear,omitempty"`

	// CVV is the card CVV for use with PAN based transactions.
	CVV string `json:"cvv,omitempty"`

	// Address is the cardholder address for use with address verification.
	Address string `json:"address,omitempty"`

	// PostalCode is the cardholder postal code for use with address
	// verification.
	PostalCode string `json:"postalCode,omitempty"`

	// ManualEntry specifies that the payment entry method is a manual keyed
	// transaction. If this is true, no other payment method will be accepted.
	ManualEntry bool `json:"manualEntry,omitempty"`

	// KSN is the key serial number used for DUKPT encryption.
	KSN string `json:"ksn,omitempty"`

	// PINBlock is the encrypted pin block.
	PINBlock string `json:"pinBlock,omitempty"`

	// CardType designates categories of cards: credit, debit, EBT.
	CardType CardType `json:"cardType,omitempty"`

	// PaymentType designates brands of payment methods: Visa, Discover, etc.
	PaymentType string `json:"paymentType,omitempty"`

	// TransactionID is the ID of the previous transaction being referenced.
	TransactionID string `json:"transactionId"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the requested amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool `json:"surcharge"`

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool `json:"cashDiscount"`

	// SigFile is a location on the filesystem which a customer signature should
	// be written to.
	SigFile string `json:"sigFile,omitempty"`

	// SigFormat specifies the image format to be used for returning signatures.
	SigFormat SignatureFormat `json:"sigFormat,omitempty"`

	// SigWidth is the width that the signature image should be scaled to,
	// preserving the aspect ratio. If not provided, the signature is returned in
	// the terminal's max resolution.
	SigWidth int `json:"sigWidth,omitempty"`

	// DisableSignature specifies whether or not signature prompt should be
	// skipped on the terminal. The terminal will indicate whether or not a
	// signature is required by the card in the receipt suggestions response.
	DisableSignature bool `json:"disableSignature,omitempty"`

	// TipAmount is the tip amount.
	TipAmount string `json:"tipAmount,omitempty"`

	// TaxAmount is the tax amount.
	TaxAmount string `json:"taxAmount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// OnlineAuthCode is used to validate online gift card authorizations.
	OnlineAuthCode string `json:"onlineAuthCode,omitempty"`

	// Enroll indicates that the payment method should be added to the token
	// vault alongside the authorization.
	Enroll bool `json:"enroll,omitempty"`

	// Description contains a narrative description of the transaction.
	Description string `json:"description,omitempty"`

	// PromptForTip indicates that the terminal should request a tip from the
	// user before starting the transaction.
	PromptForTip bool `json:"promptForTip,omitempty"`

	// CashBackEnabled indicates that cash back should be enabled for supported
	// cards.
	CashBackEnabled bool `json:"cashBackEnabled,omitempty"`

	// AltPrices is a map of alternate currencies and the price in each currency.
	// Use only if you want to set your own exchange rate for a crypto
	// transaction.
	AltPrices map[string]string `json:"altPrices,omitempty"`

	// Customer contains customer information.
	Customer *Customer `json:"customer"`

	// RoundingMode indicates how partial pennies should be rounded for
	// calculated values like surcharges. Rounding up is the default behavior.
	RoundingMode *RoundingMode `json:"roundingMode"`

	// Healthcare contains details for HSA/FSA transactions.
	Healthcare *Healthcare `json:"healthcare,omitempty"`

	// Cryptocurrency indicates that the transaction should be a cryptocurrency
	// transaction. Value should be a crypto currency code (ETH, BTC) or ANY to
	// prompt the user to choose from supported cryptocurrencies.
	Cryptocurrency *string `json:"cryptocurrency,omitempty"`

	// CryptoNetwork is an optional parameter that can be used to force a crypto
	// transaction onto a level one or level two network. Valid values are L1 and
	// L2. Defaults to L1.
	CryptoNetwork *string `json:"cryptoNetwork,omitempty"`

	// CryptoReceiveAddress can be used to specify a specific receive address for
	// a crypto transaction. Disabled by default. This should only be used by
	// sophisticated users with access to properly configured hot wallets.
	CryptoReceiveAddress *string `json:"cryptoReceiveAddress,omitempty"`

	// PaymentRequestLabel can optionally add a label to the payment request if
	// the target cryptocurrency supports labels. Defaults to the merchant's DBA
	// Name.
	PaymentRequestLabel *string `json:"paymentRequestLabel,omitempty"`

	// PaymentRequestMessage can optionally add a message to the payment request
	// if the target cryptocurrency supports labels. Defaults to empty.
	PaymentRequestMessage *string `json:"paymentRequestMessage,omitempty"`

	// SimulateChipRejection instructs the terminal to simulate a post auth chip
	// rejection that would trigger an automatic reversal.
	SimulateChipRejection bool `json:"simulateChipRejection,omitempty"`

	// SimulateOutOfOrderReversal instructs the terminal to simulate an out of
	// order automatic reversal.
	SimulateOutOfOrderReversal bool `json:"simulateOutOfOrderReversal,omitempty"`

	// AsyncReversals causes auto-reversals on the terminal to be executed
	// asyncronously. Use with caution and in conjunction with the transaction
	// status API.
	AsyncReversals bool `json:"asyncReversals,omitempty"`
}

AuthorizationRequest contains an authorization request for a charge, preauth, or reverse transaction.

type AuthorizationResponse

type AuthorizationResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Approved indicates that the transaction was approved.
	Approved bool `json:"approved"`

	// AuthCode is the auth code from the payment network.
	AuthCode string `json:"authCode,omitempty"`

	// AuthResponseCode is the code returned by the terminal or the card issuer
	// to indicate the disposition of the message.
	AuthResponseCode string `json:"authResponseCode,omitempty"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// PartialAuth indicates whether or not the transaction was approved for a
	// partial amount.
	PartialAuth bool `json:"partialAuth"`

	// AltCurrency indicates whether or not an alternate currency was used.
	AltCurrency bool `json:"altCurrency"`

	// FSAAuth indicates whether or not a request was settled on an FSA card.
	FSAAuth bool `json:"fsaAuth"`

	// CurrencyCode is the currency code used for the transaction.
	CurrencyCode string `json:"currencyCode"`

	// RequestedAmount is the requested amount.
	RequestedAmount string `json:"requestedAmount"`

	// AuthorizedAmount is the authorized amount. May not match the requested
	// amount in the event of a partial auth.
	AuthorizedAmount string `json:"authorizedAmount"`

	// RemainingBalance is the remaining balance on the payment method.
	RemainingBalance string `json:"remainingBalance"`

	// TipAmount is the tip amount.
	TipAmount string `json:"tipAmount"`

	// TaxAmount is the tax amount.
	TaxAmount string `json:"taxAmount"`

	// RequestedCashBackAmount is the cash back amount the customer requested
	// during the transaction.
	RequestedCashBackAmount string `json:"requestedCashBackAmount"`

	// AuthorizedCashBackAmount is the amount of cash back authorized by the
	// gateway. This amount will be the entire amount requested, or zero.
	AuthorizedCashBackAmount string `json:"authorizedCashBackAmount"`

	// Confirmed indicates that the transaction has met the standard criteria for
	// confirmation on the network. (For example, 6 confirmations for level one
	// bitcoin.)
	Confirmed bool `json:"confirmed"`

	// CryptoAuthorizedAmount is the amount submitted to the blockchain.
	CryptoAuthorizedAmount string `json:"cryptoAuthorizedAmount"`

	// CryptoNetworkFee is the network level fee assessed for the transaction
	// denominated in cryptocurrency. This fee goes to channel operators and
	// crypto miners, not BlockChyp.
	CryptoNetworkFee string `json:"cryptoNetworkFee"`

	// Cryptocurrency is the three letter cryptocurrency code used for the
	// transactions.
	Cryptocurrency string `json:"cryptocurrency"`

	// CryptoNetwork indicates whether or not the transaction was processed on
	// the level one or level two network.
	CryptoNetwork string `json:"cryptoNetwork"`

	// CryptoReceiveAddress the address on the crypto network the transaction was
	// sent to.
	CryptoReceiveAddress string `json:"cryptoReceiveAddress"`

	// CryptoBlock hash or other identifier that identifies the block on the
	// cryptocurrency network, if available or relevant.
	CryptoBlock string `json:"cryptoBlock"`

	// CryptoTransactionID hash or other transaction identifier that identifies
	// the transaction on the cryptocurrency network, if available or relevant.
	CryptoTransactionID string `json:"cryptoTransactionId"`

	// CryptoPaymentRequest is the payment request URI used for the transaction,
	// if available.
	CryptoPaymentRequest string `json:"cryptoPaymentRequest"`

	// CryptoStatus is used for additional status information related to crypto
	// transactions.
	CryptoStatus string `json:"cryptoStatus"`

	// Token is the payment token, if the payment was enrolled in the vault.
	Token string `json:"token,omitempty"`

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string `json:"paymentType,omitempty"`

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string `json:"network,omitempty"`

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string `json:"logo,omitempty"`

	// MaskedPAN is the masked primary account number.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string `json:"publicKey,omitempty"`

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool `json:"ScopeAlert,omitempty"`

	// CardHolder is the cardholder name.
	CardHolder string `json:"cardHolder,omitempty"`

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year in YY format.
	ExpYear string `json:"expYear,omitempty"`

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse `json:"avsResponse"`

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions `json:"receiptSuggestions"`

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer `json:"customer"`

	// Customers contains customer data, if any.
	Customers []Customer `json:"customers"`

	// SigFile contains the hex encoded signature data.
	SigFile string `json:"sigFile,omitempty"`

	// WhiteListedCard contains card BIN ranges can be whitelisted so that they
	// are read instead of being processed directly. This is useful for
	// integration with legacy gift card systems.
	WhiteListedCard *WhiteListedCard `json:"whiteListedCard"`

	// StoreAndForward indicates that the transaction was flagged for store and
	// forward due to network problems.
	StoreAndForward bool `json:"storeAndForward"`

	// Status indicates the current status of a transaction.
	Status string `json:"status"`
}

AuthorizationResponse contains the response to an authorization request.

type BalanceRequest

type BalanceRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token is the payment token to be used for this transaction. This should be
	// used for recurring transactions.
	Token string `json:"token,omitempty"`

	// Track1 contains track 1 magnetic stripe data.
	Track1 string `json:"track1,omitempty"`

	// Track2 contains track 2 magnetic stripe data.
	Track2 string `json:"track2,omitempty"`

	// PAN contains the primary account number. We recommend using the terminal
	// or e-commerce tokenization libraries instead of passing account numbers in
	// directly, as this would put your application in PCI scope.
	PAN string `json:"pan,omitempty"`

	// RoutingNumber is the ACH routing number for ACH transactions.
	RoutingNumber string `json:"routingNumber,omitempty"`

	// CardholderName is the cardholder name. Only required if the request
	// includes a primary account number or track data.
	CardholderName string `json:"cardholderName,omitempty"`

	// ExpMonth is the card expiration month for use with PAN based transactions.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year for use with PAN based transactions.
	ExpYear string `json:"expYear,omitempty"`

	// CVV is the card CVV for use with PAN based transactions.
	CVV string `json:"cvv,omitempty"`

	// Address is the cardholder address for use with address verification.
	Address string `json:"address,omitempty"`

	// PostalCode is the cardholder postal code for use with address
	// verification.
	PostalCode string `json:"postalCode,omitempty"`

	// ManualEntry specifies that the payment entry method is a manual keyed
	// transaction. If this is true, no other payment method will be accepted.
	ManualEntry bool `json:"manualEntry,omitempty"`

	// KSN is the key serial number used for DUKPT encryption.
	KSN string `json:"ksn,omitempty"`

	// PINBlock is the encrypted pin block.
	PINBlock string `json:"pinBlock,omitempty"`

	// CardType designates categories of cards: credit, debit, EBT.
	CardType CardType `json:"cardType,omitempty"`

	// PaymentType designates brands of payment methods: Visa, Discover, etc.
	PaymentType string `json:"paymentType,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

BalanceRequest contains a request for the remaining balance on a payment type.

type BalanceResponse

type BalanceResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// Token is the payment token, if the payment was enrolled in the vault.
	Token string `json:"token,omitempty"`

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string `json:"paymentType,omitempty"`

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string `json:"network,omitempty"`

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string `json:"logo,omitempty"`

	// MaskedPAN is the masked primary account number.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string `json:"publicKey,omitempty"`

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool `json:"ScopeAlert,omitempty"`

	// CardHolder is the cardholder name.
	CardHolder string `json:"cardHolder,omitempty"`

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year in YY format.
	ExpYear string `json:"expYear,omitempty"`

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse `json:"avsResponse"`

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions `json:"receiptSuggestions"`

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer `json:"customer"`

	// Customers contains customer data, if any.
	Customers []Customer `json:"customers"`

	// RemainingBalance remaining balance on the payment method.
	RemainingBalance string `json:"remainingBalance,omitempty"`
}

BalanceResponse contains the response to a balance request.

type BankAccount

type BankAccount struct {
	// ID is the account identifier to be used with authorization requests.
	ID string `json:"id"`

	// Name is the name of the account.
	Name string `json:"name"`

	// Purpose is the purpose of the account.
	Purpose string `json:"purpose"`

	// MaskedAccountNumber is the masked account number.
	MaskedAccountNumber string `json:"maskedAccountNumber"`
}

BankAccount models meta data about a merchant bank account.

type BatchDetailsRequest

type BatchDetailsRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// BatchID id for the batch to be retrieved.
	BatchID string `json:"batchId"`
}

BatchDetailsRequest models a request for details about a single batch.

type BatchDetailsResponse

type BatchDetailsResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates that the response came from the test gateway.
	Test bool `json:"test"`

	// BatchID batch identifier.
	BatchID string `json:"batchId"`

	// EntryMethod entry method for the batch, if any.
	EntryMethod string `json:"entryMethod"`

	// DestinationAccountID merchant deposit account into which proceeds should
	// be deposited.
	DestinationAccountID string `json:"destinationAccountId"`

	// CapturedAmount is the new captured amount.
	CapturedAmount string `json:"capturedAmount"`

	// OpenPreauths preauths from this batch still open.
	OpenPreauths string `json:"openPreauths"`

	// TotalVolume is the total volume from this batch.
	TotalVolume string `json:"totalVolume"`

	// TransactionCount is the total number of transactions in this batch.
	TransactionCount int `json:"transactionCount"`

	// GiftCardsSold is the total volume of gift cards sold.
	GiftCardsSold string `json:"giftCardsSold"`

	// GiftCardVolume is the total volume of gift cards transactions.
	GiftCardVolume string `json:"giftCardVolume"`

	// ExpectedDeposit is the expected volume for this batch, usually captured
	// volume less gift card volume.
	ExpectedDeposit string `json:"expectedDeposit"`

	// Open flag indicating whether or not the batch is open.
	Open bool `json:"open"`

	// OpenDate date and time of the first transaction for this batch.
	OpenDate time.Time `json:"openDate"`

	// CloseDate date and time the batch was closed.
	CloseDate time.Time `json:"closeDate"`

	// VolumeByTerminal merchant's batch history in descending order.
	VolumeByTerminal []TerminalVolume `json:"volumeByTerminal"`
}

BatchDetailsResponse models a response for details about a single batch.

type BatchHistoryRequest

type BatchHistoryRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// StartDate optional start date filter for batch history.
	StartDate time.Time `json:"startDate"`

	// EndDate optional end date filter for batch history.
	EndDate time.Time `json:"endDate"`

	// MaxResults max results to be returned by this request. Defaults to the
	// system max of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for results to be returned.
	StartIndex int `json:"startIndex"`
}

BatchHistoryRequest models a batch history request.

type BatchHistoryResponse

type BatchHistoryResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates that the response came from the test gateway.
	Test bool `json:"test"`

	// StartDate start date if filtered by start date.
	StartDate time.Time `json:"startDate"`

	// EndDate end date if filtered by end date.
	EndDate time.Time `json:"endDate"`

	// Batches merchant's batch history in descending order.
	Batches []BatchSummary `json:"batches"`

	// MaxResults max results from the original request echoed back.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index from the original request echoed back.
	StartIndex int `json:"startIndex"`

	// TotalResultCount total number of results accessible through paging.
	TotalResultCount int `json:"totalResultCount"`
}

BatchHistoryResponse models response to a batch history request.

type BatchSummary

type BatchSummary struct {
	// BatchID batch identifier.
	BatchID string `json:"batchId"`

	// EntryMethod entry method for the batch, if any.
	EntryMethod string `json:"entryMethod"`

	// DestinationAccountID merchant deposit account into which proceeds should
	// be deposited.
	DestinationAccountID string `json:"destinationAccountId"`

	// CapturedAmount is the new captured amount.
	CapturedAmount string `json:"capturedAmount"`

	// OpenPreauths is the amount of preauths opened during the batch that have
	// not been captured.
	OpenPreauths string `json:"openPreauths"`

	// CurrencyCode is the currency the batch was settled in.
	CurrencyCode string `json:"currencyCode"`

	// Open flag indicating whether or not the batch is open.
	Open bool `json:"open"`

	// OpenDate date and time of the first transaction for this batch.
	OpenDate time.Time `json:"openDate"`

	// CloseDate date and time the batch was closed.
	CloseDate time.Time `json:"closeDate"`
}

BatchSummary models high level information about a single batch.

type BooleanPromptRequest

type BooleanPromptRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// YesCaption is the preferred caption for the 'yes' button.
	YesCaption string `json:"yesCaption"`

	// NoCaption is the preferred caption for the 'no' button.
	NoCaption string `json:"noCaption"`

	// Prompt is the text to be displayed on the terminal.
	Prompt string `json:"prompt"`
}

BooleanPromptRequest contains a simple yes no prompt request.

type BooleanPromptResponse

type BooleanPromptResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Response is the boolean prompt response.
	Response bool `json:"response"`
}

BooleanPromptResponse contains the response to a boolean prompt request.

type BrandingAsset

type BrandingAsset struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID id used to track a branding asset.
	ID string `json:"id"`

	// OwnerID is the id owner of the tenant who owns the branding asset.
	OwnerID string `json:"ownerId"`

	// TerminalID is the terminal id if this branding asset is specific to a
	// single terminal.
	TerminalID string `json:"terminalId"`

	// TerminalGroupID is the terminal group id if this branding asset is
	// specific to a terminal group.
	TerminalGroupID string `json:"terminalGroupId"`

	// MerchantID is the merchant id associated with this branding asset.
	MerchantID string `json:"merchantId"`

	// OrganizationID is the organization id associated with this branding asset.
	OrganizationID string `json:"organizationId"`

	// PartnerID is the partner id associated with this branding asset.
	PartnerID string `json:"partnerId"`

	// SlideShowID is the slide show associated with this branding asset, if any.
	// A branding asset can reference a slide show or media asset, but not both.
	SlideShowID string `json:"slideShowId"`

	// MediaID is the media id associated with this branding asset, if any. A
	// branding asset can reference a slide show or media asset, but not both.
	MediaID string `json:"mediaId"`

	// Padded applies standard margins to images displayed on terminals. Usually
	// the best option for logos.
	Padded bool `json:"padded"`

	// StartDate is the start date if this asset should be displayed based on a
	// schedule. Format: MM/DD/YYYY.
	StartDate string `json:"startDate"`

	// EndDate is the end date if this asset should be displayed based on a
	// schedule. Format: MM/DD/YYYY.
	EndDate string `json:"endDate"`

	// DaysOfWeek is an array of days of the week during which a branding asset
	// should be enabled. Days of the week are coded as integers starting with
	// Sunday (0) and ending with Saturday (6).
	DaysOfWeek []time.Weekday `json:"daysOfWeek"`

	// StartTime is the start date if this asset should be displayed based on a
	// schedule. Format: MM/DD/YYYY.
	StartTime string `json:"startTime"`

	// EndTime is the end date if this asset should be displayed based on a
	// schedule. Format: MM/DD/YYYY.
	EndTime string `json:"endTime"`

	// Ordinal is the ordinal number marking the position of this asset within
	// the branding stack.
	Ordinal int `json:"ordinal"`

	// Enabled enables the asset for display.
	Enabled bool `json:"enabled"`

	// Preview if true, the asset will be displayed in the merchant portal, but
	// not on merchant terminal hardware. Developers will usually want this to
	// always be false.
	Preview bool `json:"preview"`

	// UserID id of the user who created this branding asset, if applicable.
	UserID string `json:"userId"`

	// UserName name of the user who created this branding asset, if applicable.
	UserName string `json:"userName"`

	// Thumbnail the fully qualified URL of the thumbnail image for this branding
	// asset.
	Thumbnail string `json:"thumbnail"`

	// LastModified is the time and date this asset was last modified.
	LastModified string `json:"lastModified"`

	// Notes is a field for notes related to a branding asset.
	Notes string `json:"notes"`

	// Editable if true, the API credentials used to retrieve the branding asset
	// record can be used to update it.
	Editable bool `json:"editable"`

	// AssetType is the type of branding asset.
	AssetType string `json:"assetType"`

	// OwnerType is the type of user or tenant that owns this asset.
	OwnerType string `json:"ownerType"`

	// OwnerTypeCaption is a recommended caption for displaying the owner. Takes
	// into account multiple organization types.
	OwnerTypeCaption string `json:"ownerTypeCaption"`

	// OwnerName is the name of the tenant or entity that owns the branding
	// asset.
	OwnerName string `json:"ownerName"`

	// PreviewImage is the recommended image to be displayed when rendering a
	// preview of this branding asset.
	PreviewImage string `json:"previewImage"`

	// NarrativeEffectiveDates is a compact narrative string explaining the
	// effective date and time rules for a branding asset.
	NarrativeEffectiveDates string `json:"narrativeEffectiveDates"`

	// NarrativeDisplayPeriod is a compact narrative string explaining the
	// display period for a branding asset.
	NarrativeDisplayPeriod string `json:"narrativeDisplayPeriod"`
}

BrandingAsset models the priority and display settings for terminal media.

type BrandingAssetRequest

type BrandingAssetRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// AssetID id used to track a branding asset.
	AssetID string `json:"assetId"`
}

BrandingAssetRequest models a request to retrieve or manipulate terminal slide shows.

type BrandingAssetResponse

type BrandingAssetResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// OwnerID is the id owner of this branding stack.
	OwnerID string `json:"ownerId"`

	// OwnerType is the type of user or tenant that owns this branding stack.
	OwnerType string `json:"ownerType"`

	// OwnerName is the name of the entity or tenant that owns this branding
	// stack.
	OwnerName string `json:"ownerName"`

	// LevelName is the owner level currently being displayed.
	LevelName string `json:"levelName"`

	// NarrativeTime is a narrative description of the current simulate time.
	NarrativeTime string `json:"narrativeTime"`

	// ActiveAsset is the asset currently displayed on the terminal.
	ActiveAsset BrandingAsset `json:"activeAsset"`

	// Results enumerates all branding assets in a given credential scope.
	Results []BrandingAsset `json:"results"`
}

BrandingAssetResponse models a branding asset response.

type CVMType

type CVMType string

CVMType designates a customer verification method.

const (
	CVMTypeSignature  CVMType = "Signature"
	CVMTypeOfflinePIN CVMType = "Offline PIN"
	CVMTypeOnlinePIN  CVMType = "Online PIN"
	CVMTypeCDCVM      CVMType = "CDCVM"
	CVMTypeNoCVM      CVMType = "No CVM"
)

CVMs defined.

type CancelPaymentLinkRequest

type CancelPaymentLinkRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// LinkCode is the payment link code to cancel.
	LinkCode string `json:"linkCode"`
}

CancelPaymentLinkRequest cancels a pending payment link. Payment links that have already been used cannot be canceled and the request will be rejected.

type CancelPaymentLinkResponse

type CancelPaymentLinkResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`
}

CancelPaymentLinkResponse indicates success or failure of a payment link cancellation.

type CaptureRequest

type CaptureRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TransactionID is the ID of the previous transaction being referenced.
	TransactionID string `json:"transactionId"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the requested amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool `json:"surcharge"`

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool `json:"cashDiscount"`

	// TipAmount is the tip amount.
	TipAmount string `json:"tipAmount,omitempty"`

	// TaxAmount is the tax amount.
	TaxAmount string `json:"taxAmount,omitempty"`
}

CaptureRequest contains the information needed to capture a preauth.

type CaptureResponse

type CaptureResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Approved indicates that the transaction was approved.
	Approved bool `json:"approved"`

	// AuthCode is the auth code from the payment network.
	AuthCode string `json:"authCode,omitempty"`

	// AuthResponseCode is the code returned by the terminal or the card issuer
	// to indicate the disposition of the message.
	AuthResponseCode string `json:"authResponseCode,omitempty"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// PartialAuth indicates whether or not the transaction was approved for a
	// partial amount.
	PartialAuth bool `json:"partialAuth"`

	// AltCurrency indicates whether or not an alternate currency was used.
	AltCurrency bool `json:"altCurrency"`

	// FSAAuth indicates whether or not a request was settled on an FSA card.
	FSAAuth bool `json:"fsaAuth"`

	// CurrencyCode is the currency code used for the transaction.
	CurrencyCode string `json:"currencyCode"`

	// RequestedAmount is the requested amount.
	RequestedAmount string `json:"requestedAmount"`

	// AuthorizedAmount is the authorized amount. May not match the requested
	// amount in the event of a partial auth.
	AuthorizedAmount string `json:"authorizedAmount"`

	// RemainingBalance is the remaining balance on the payment method.
	RemainingBalance string `json:"remainingBalance"`

	// TipAmount is the tip amount.
	TipAmount string `json:"tipAmount"`

	// TaxAmount is the tax amount.
	TaxAmount string `json:"taxAmount"`

	// RequestedCashBackAmount is the cash back amount the customer requested
	// during the transaction.
	RequestedCashBackAmount string `json:"requestedCashBackAmount"`

	// AuthorizedCashBackAmount is the amount of cash back authorized by the
	// gateway. This amount will be the entire amount requested, or zero.
	AuthorizedCashBackAmount string `json:"authorizedCashBackAmount"`

	// Token is the payment token, if the payment was enrolled in the vault.
	Token string `json:"token,omitempty"`

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string `json:"paymentType,omitempty"`

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string `json:"network,omitempty"`

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string `json:"logo,omitempty"`

	// MaskedPAN is the masked primary account number.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string `json:"publicKey,omitempty"`

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool `json:"ScopeAlert,omitempty"`

	// CardHolder is the cardholder name.
	CardHolder string `json:"cardHolder,omitempty"`

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year in YY format.
	ExpYear string `json:"expYear,omitempty"`

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse `json:"avsResponse"`

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions `json:"receiptSuggestions"`

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer `json:"customer"`

	// Customers contains customer data, if any.
	Customers []Customer `json:"customers"`
}

CaptureResponse contains the response to a capture request.

type CaptureSignatureRequest

type CaptureSignatureRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// SigFile is a location on the filesystem which a customer signature should
	// be written to.
	SigFile string `json:"sigFile,omitempty"`

	// SigFormat specifies the image format to be used for returning signatures.
	SigFormat SignatureFormat `json:"sigFormat,omitempty"`

	// SigWidth is the width that the signature image should be scaled to,
	// preserving the aspect ratio. If not provided, the signature is returned in
	// the terminal's max resolution.
	SigWidth int `json:"sigWidth,omitempty"`

	// DisableSignature specifies whether or not signature prompt should be
	// skipped on the terminal. The terminal will indicate whether or not a
	// signature is required by the card in the receipt suggestions response.
	DisableSignature bool `json:"disableSignature,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

CaptureSignatureRequest contains a request for customer signature data.

type CaptureSignatureResponse

type CaptureSignatureResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// SigFile contains the hex encoded signature data.
	SigFile string `json:"sigFile,omitempty"`
}

CaptureSignatureResponse contains customer signature data.

type CardType

type CardType int

CardType is used to differentiate credit, debit, and EBT.

const (
	CardTypeCredit CardType = iota
	CardTypeDebit
	CardTypeEBT
	CardTypeBlockchainGift
	CardTypeHealthcare
)

CardTypes.

type CashDiscountRequest

type CashDiscountRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the requested amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool `json:"surcharge"`

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool `json:"cashDiscount"`

	// RoundingMode indicates how partial pennies should be rounded for
	// calculated values like surcharges. Rounding up is the default behavior.
	RoundingMode *RoundingMode `json:"roundingMode"`
}

CashDiscountRequest computes the cash discount for a cash discount if enabled.

type CashDiscountResponse

type CashDiscountResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the new calculated total amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is the normal surcharge for a transaction. Will only be returned
	// if an offsetting cash discount is also returned.
	Surcharge string `json:"surcharge"`

	// CashDiscount is the cash discount. Will not be returned in surcharge only
	// mode.
	CashDiscount string `json:"cashDiscount"`
}

CashDiscountResponse models the results of a cash discount calculation.

type ClearTerminalRequest

type ClearTerminalRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

ClearTerminalRequest contains the information needed to enroll a new payment method in the token vault.

type Client

type Client struct {
	Credentials     APICredentials
	GatewayHost     string
	DashboardHost   string
	TestGatewayHost string
	HTTPS           bool
	RouteCache      string

	GatewayTimeout  time.Duration
	TerminalTimeout time.Duration

	LogRequests bool
	// contains filtered or unexported fields
}

Client is the main interface used by application developers.

func NewClient

func NewClient(creds APICredentials) Client

NewClient returns a default Client configured with the given credentials.

func (*Client) ActivateTerminal

func (client *Client) ActivateTerminal(request TerminalActivationRequest) (*Acknowledgement, error)

ActivateTerminal activates a terminal.

func (*Client) AddTestMerchant

func (client *Client) AddTestMerchant(request AddTestMerchantRequest) (*MerchantProfileResponse, error)

AddTestMerchant adds a test merchant account.

func (*Client) Balance

func (client *Client) Balance(request BalanceRequest) (*BalanceResponse, error)

Balance checks the remaining balance on a payment method.

func (*Client) BatchDetails

func (client *Client) BatchDetails(request BatchDetailsRequest) (*BatchDetailsResponse, error)

BatchDetails returns the batch details for a single batch.

func (*Client) BatchHistory

func (client *Client) BatchHistory(request BatchHistoryRequest) (*BatchHistoryResponse, error)

BatchHistory returns the batch history for a merchant.

func (*Client) BooleanPrompt

func (client *Client) BooleanPrompt(request BooleanPromptRequest) (*BooleanPromptResponse, error)

BooleanPrompt asks the consumer a yes/no question.

func (client *Client) CancelPaymentLink(request CancelPaymentLinkRequest) (*CancelPaymentLinkResponse, error)

CancelPaymentLink cancels a payment link.

func (*Client) Capture

func (client *Client) Capture(request CaptureRequest) (*CaptureResponse, error)

Capture captures a preauthorization.

func (*Client) CaptureSignature

func (client *Client) CaptureSignature(request CaptureSignatureRequest) (*CaptureSignatureResponse, error)

CaptureSignature captures and returns a signature.

func (*Client) CashDiscount

func (client *Client) CashDiscount(request CashDiscountRequest) (*CashDiscountResponse, error)

CashDiscount calculates the discount for actual cash transactions.

func (*Client) Charge

func (client *Client) Charge(request AuthorizationRequest) (*AuthorizationResponse, error)

Charge executes a standard direct preauth and capture.

func (*Client) Clear

func (client *Client) Clear(request ClearTerminalRequest) (*Acknowledgement, error)

Clear clears the line item display and any in progress transaction.

func (*Client) CloseBatch

func (client *Client) CloseBatch(request CloseBatchRequest) (*CloseBatchResponse, error)

CloseBatch closes the current credit card batch.

func (*Client) Customer

func (client *Client) Customer(request CustomerRequest) (*CustomerResponse, error)

Customer retrieves a customer by id.

func (*Client) CustomerSearch

func (client *Client) CustomerSearch(request CustomerSearchRequest) (*CustomerSearchResponse, error)

CustomerSearch searches the customer database.

func (*Client) DashboardRequest

func (client *Client) DashboardRequest(path, method string, request, response interface{}, requestTimeout interface{}) error

DashboardRequest sends a gateway request with the default timeout.

func (*Client) DashboardUpload

func (client *Client) DashboardUpload(path string, request UploadMetadata, reader io.Reader, response interface{}, requestTimeout interface{}) error

DashboardUpload performs a file upload

func (*Client) DeactivateTerminal

func (client *Client) DeactivateTerminal(request TerminalDeactivationRequest) (*Acknowledgement, error)

DeactivateTerminal deactivates a terminal.

func (*Client) DeleteBrandingAsset

func (client *Client) DeleteBrandingAsset(request BrandingAssetRequest) (*Acknowledgement, error)

DeleteBrandingAsset deletes a branding asset.

func (*Client) DeleteCustomer

func (client *Client) DeleteCustomer(request DeleteCustomerRequest) (*DeleteCustomerResponse, error)

DeleteCustomer deletes a customer record.

func (*Client) DeleteMediaAsset

func (client *Client) DeleteMediaAsset(request MediaRequest) (*Acknowledgement, error)

DeleteMediaAsset deletes a media asset.

func (*Client) DeleteMerchantPlatforms

func (client *Client) DeleteMerchantPlatforms(request MerchantPlatformRequest) (*Acknowledgement, error)

DeleteMerchantPlatforms deletes a boarding platform configuration.

func (*Client) DeleteQueuedTransaction

func (client *Client) DeleteQueuedTransaction(request DeleteQueuedTransactionRequest) (*DeleteQueuedTransactionResponse, error)

DeleteQueuedTransaction deletes a queued transaction from the terminal.

func (*Client) DeleteSlideShow

func (client *Client) DeleteSlideShow(request SlideShowRequest) (*Acknowledgement, error)

DeleteSlideShow deletes a single slide show.

func (*Client) DeleteSurveyQuestion

func (client *Client) DeleteSurveyQuestion(request SurveyQuestionRequest) (*Acknowledgement, error)

DeleteSurveyQuestion deletes a survey question.

func (*Client) DeleteTestMerchant

func (client *Client) DeleteTestMerchant(request MerchantProfileRequest) (*Acknowledgement, error)

DeleteTestMerchant deletes a test merchant account. Supports partner scoped API credentials only. Live merchant accounts cannot be deleted.

func (*Client) DeleteToken

func (client *Client) DeleteToken(request DeleteTokenRequest) (*DeleteTokenResponse, error)

DeleteToken deletes a payment token.

func (*Client) Enroll

func (client *Client) Enroll(request EnrollRequest) (*EnrollResponse, error)

Enroll adds a new payment method to the token vault.

func (*Client) ExpireRouteCache

func (client *Client) ExpireRouteCache()

ExpireRouteCache invalidates the route cache to for testing.

func (*Client) GatewayGet

func (client *Client) GatewayGet(path string, responseEntity interface{}) error

GatewayGet retrieves a get request from the api gateway.

func (*Client) GatewayPost

func (client *Client) GatewayPost(path string, requestEntity interface{}, responseEntity interface{}, testTx bool) error

GatewayPost posts a request to the api gateway.

func (*Client) GatewayRequest

func (client *Client) GatewayRequest(path, method string, request, response interface{}, testTx bool, requestTimeout interface{}) error

GatewayRequest sends a gateway request with the default timeout.

func (*Client) GetMerchants

func (client *Client) GetMerchants(request GetMerchantsRequest) (*GetMerchantsResponse, error)

GetMerchants adds a test merchant account.

func (*Client) GiftActivate

func (client *Client) GiftActivate(request GiftActivateRequest) (*GiftActivateResponse, error)

GiftActivate activates or recharges a gift card.

func (*Client) InviteMerchantUser

func (client *Client) InviteMerchantUser(request InviteMerchantUserRequest) (*Acknowledgement, error)

InviteMerchantUser invites a user to join a merchant account.

func (*Client) LinkToken

func (client *Client) LinkToken(request LinkTokenRequest) (*Acknowledgement, error)

LinkToken links a token to a customer record.

func (*Client) ListQueuedTransactions

func (client *Client) ListQueuedTransactions(request ListQueuedTransactionsRequest) (*ListQueuedTransactionsResponse, error)

ListQueuedTransactions returns a list of queued transactions on a terminal.

func (*Client) Locate

func (client *Client) Locate(request LocateRequest) (*LocateResponse, error)

Locate returns routing and location data for a payment terminal.

func (*Client) Media

func (client *Client) Media(request MediaRequest) (*MediaLibraryResponse, error)

Media returns the media library for a given partner, merchant, or organization.

func (*Client) MediaAsset

func (client *Client) MediaAsset(request MediaRequest) (*MediaMetadata, error)

MediaAsset returns the media details for a single media asset.

func (*Client) MerchantPlatforms

func (client *Client) MerchantPlatforms(request MerchantProfileRequest) (*MerchantPlatformsResponse, error)

MerchantPlatforms list all merchant platforms configured for a gateway merchant.

func (*Client) MerchantProfile

func (client *Client) MerchantProfile(request MerchantProfileRequest) (*MerchantProfileResponse, error)

MerchantProfile returns profile information for a merchant.

func (*Client) MerchantUsers

func (client *Client) MerchantUsers(request MerchantProfileRequest) (*MerchantUsersResponse, error)

MerchantUsers list all active users and pending invites for a merchant account.

func (*Client) Message

func (client *Client) Message(request MessageRequest) (*Acknowledgement, error)

Message displays a short message on the terminal.

func (*Client) NewTransactionDisplay

func (client *Client) NewTransactionDisplay(request TransactionDisplayRequest) (*Acknowledgement, error)

NewTransactionDisplay displays a new transaction on the terminal.

func (*Client) Ping

func (client *Client) Ping(request PingRequest) (*PingResponse, error)

Ping tests connectivity with a payment terminal.

func (*Client) Preauth

func (client *Client) Preauth(request AuthorizationRequest) (*AuthorizationResponse, error)

Preauth executes a preauthorization intended to be captured later.

func (*Client) Reboot

func (client *Client) Reboot(request PingRequest) (*Acknowledgement, error)

Reboot reboot a payment terminal.

func (*Client) Refund

func (client *Client) Refund(request RefundRequest) (*AuthorizationResponse, error)

Refund executes a refund.

func (*Client) RelayRequest

func (client *Client) RelayRequest(path, method string, request, response interface{}, testTx bool, requestTimeout interface{}) error

RelayRequest sends a request to the gateway to be relayed to a terminal.

func (*Client) Reverse

func (client *Client) Reverse(request AuthorizationRequest) (*AuthorizationResponse, error)

Reverse executes a manual time out reversal.

We love time out reversals. Don't be afraid to use them whenever a request to a BlockChyp terminal times out. You have up to two minutes to reverse any transaction. The only caveat is that you must assign transactionRef values when you build the original request. Otherwise, we have no real way of knowing which transaction you're trying to reverse because we may not have assigned it an id yet. And if we did assign it an id, you wouldn't know what it is because your request to the terminal timed out before you got a response.

func (client *Client) SendPaymentLink(request PaymentLinkRequest) (*PaymentLinkResponse, error)

SendPaymentLink creates and send a payment link to a customer.

func (*Client) SlideShow

func (client *Client) SlideShow(request SlideShowRequest) (*SlideShow, error)

SlideShow returns a single slide show with slides.

func (*Client) SlideShows

func (client *Client) SlideShows(request SlideShowRequest) (*SlideShowResponse, error)

SlideShows returns a collection of slide shows.

func (*Client) SurveyQuestion

func (client *Client) SurveyQuestion(request SurveyQuestionRequest) (*SurveyQuestion, error)

SurveyQuestion returns a single survey question with response data.

func (*Client) SurveyQuestions

func (client *Client) SurveyQuestions(request SurveyQuestionRequest) (*SurveyQuestionResponse, error)

SurveyQuestions returns all survey questions for a given merchant.

func (*Client) SurveyResults

func (client *Client) SurveyResults(request SurveyResultsRequest) (*SurveyQuestion, error)

SurveyResults returns results for a single survey question.

func (*Client) TCDeleteTemplate

func (client *Client) TCDeleteTemplate(request TermsAndConditionsTemplateRequest) (*Acknowledgement, error)

TCDeleteTemplate deletes a single terms and conditions template.

func (*Client) TCEntry

TCEntry returns a single detailed Terms and Conditions entry.

func (*Client) TCLog

TCLog returns up to 250 entries from the Terms and Conditions log.

func (*Client) TCTemplate

TCTemplate returns a single terms and conditions template.

func (*Client) TCTemplates

TCTemplates returns a list of terms and conditions templates associated with a merchant account.

func (*Client) TCUpdateTemplate

func (client *Client) TCUpdateTemplate(request TermsAndConditionsTemplate) (*TermsAndConditionsTemplate, error)

TCUpdateTemplate updates or creates a terms and conditions template.

func (*Client) TerminalBranding

func (client *Client) TerminalBranding(request BrandingAssetRequest) (*BrandingAssetResponse, error)

TerminalBranding returns the terminal branding stack for a given set of API credentials.

func (*Client) TerminalStatus

func (client *Client) TerminalStatus(request TerminalStatusRequest) (*TerminalStatusResponse, error)

TerminalStatus returns the current status of a terminal.

func (*Client) Terminals

func (client *Client) Terminals(request TerminalProfileRequest) (*TerminalProfileResponse, error)

Terminals returns all terminals associated with the merchant account.

func (*Client) TermsAndConditions

func (client *Client) TermsAndConditions(request TermsAndConditionsRequest) (*TermsAndConditionsResponse, error)

TermsAndConditions prompts the user to accept terms and conditions.

func (*Client) TextPrompt

func (client *Client) TextPrompt(request TextPromptRequest) (*TextPromptResponse, error)

TextPrompt asks the consumer a text based question.

func (*Client) TokenMetadata

func (client *Client) TokenMetadata(request TokenMetadataRequest) (*TokenMetadataResponse, error)

TokenMetadata retrieves payment token metadata.

func (*Client) TransactionHistory

func (client *Client) TransactionHistory(request TransactionHistoryRequest) (*TransactionHistoryResponse, error)

TransactionHistory returns the transaction history for a merchant.

func (*Client) TransactionStatus

func (client *Client) TransactionStatus(request TransactionStatusRequest) (*AuthorizationResponse, error)

TransactionStatus retrieves the current status of a transaction.

func (*Client) UnlinkToken

func (client *Client) UnlinkToken(request UnlinkTokenRequest) (*Acknowledgement, error)

UnlinkToken removes a link between a customer and a token.

func (*Client) UpdateBrandingAsset

func (client *Client) UpdateBrandingAsset(request BrandingAsset) (*BrandingAsset, error)

UpdateBrandingAsset updates a branding asset.

func (*Client) UpdateCustomer

func (client *Client) UpdateCustomer(request UpdateCustomerRequest) (*CustomerResponse, error)

UpdateCustomer updates or creates a customer record.

func (*Client) UpdateMerchant

func (client *Client) UpdateMerchant(request MerchantProfile) (*MerchantProfileResponse, error)

UpdateMerchant adds or updates a merchant account. Can be used to create or update test merchants. Only gateway partners may create new live merchants.

func (*Client) UpdateMerchantPlatforms

func (client *Client) UpdateMerchantPlatforms(request MerchantPlatform) (*Acknowledgement, error)

UpdateMerchantPlatforms list all merchant platforms configured for a gateway merchant.

func (*Client) UpdateSlideShow

func (client *Client) UpdateSlideShow(request SlideShow) (*SlideShow, error)

UpdateSlideShow updates or creates a slide show.

func (*Client) UpdateSurveyQuestion

func (client *Client) UpdateSurveyQuestion(request SurveyQuestion) (*SurveyQuestion, error)

UpdateSurveyQuestion updates or creates a survey question.

func (*Client) UpdateTransactionDisplay

func (client *Client) UpdateTransactionDisplay(request TransactionDisplayRequest) (*Acknowledgement, error)

UpdateTransactionDisplay appends items to an existing transaction display. Subtotal, Tax, and Total are overwritten by the request. Items with the same description are combined into groups.

func (*Client) UploadMedia

func (client *Client) UploadMedia(request UploadMetadata, reader io.Reader) (*MediaMetadata, error)

UploadMedia uploads a media asset to the media library.

func (*Client) UploadStatus

func (client *Client) UploadStatus(request UploadStatusRequest) (*UploadStatus, error)

UploadStatus retrieves the current status of a file upload.

func (*Client) Void

func (client *Client) Void(request VoidRequest) (*VoidResponse, error)

Void discards a previous transaction.

type CloseBatchRequest

type CloseBatchRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// BatchID optional batch id.
	BatchID string `json:"batchId"`
}

CloseBatchRequest contains the information needed to manually close a credit card batch.

type CloseBatchResponse

type CloseBatchResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// Batches is a collection of batches closed during the batch close
	// operation.
	Batches []BatchSummary `json:"batches"`
}

CloseBatchResponse contains the response to a close batch request.

type CommandLineArguments

type CommandLineArguments struct {
	Type                        string `args:"type"` //deprecated - use cmd instead
	Command                     string `args:"cmd"`
	ManualEntry                 bool   `arg:"manual"`
	ConfigFile                  string `arg:"f"`
	GatewayHost                 string `arg:"gateway"`
	DashboardHost               string `arg:"dashboard"`
	TestGatewayHost             string `arg:"testGateway"`
	Dashboard                   string `arg:"dashboard"`
	Test                        bool   `arg:"test"`
	APIKey                      string `arg:"apiKey"`
	BearerToken                 string `arg:"bearerToken"`
	SigningKey                  string `arg:"signingKey"`
	TransactionRef              string `arg:"txRef"`
	Description                 string `arg:"desc"`
	TerminalName                string `arg:"terminal"`
	Token                       string `arg:"token"`
	Amount                      string `arg:"amount"`
	PromptForTip                bool   `arg:"promptForTip"`
	Message                     string `arg:"message"`
	TipAmount                   string `arg:"tip"`
	TaxAmount                   string `arg:"tax"`
	TaxExempt                   bool   `arg:"taxExempt"`
	CurrencyCode                string `arg:"currency"`
	TransactionID               string `arg:"txId"`
	RouteCache                  string `arg:"routeCache"`
	OutputFile                  string `arg:"out"`
	SigFormat                   string `arg:"sigFormat"`
	SigWidth                    int    `arg:"sigWidth"`
	SigFile                     string `arg:"sigFile"`
	HTTPS                       bool   `arg:"secure"`
	Version                     bool   `arg:"version"`
	DisplayTotal                string `arg:"displayTotal"`
	DisplayTax                  string `arg:"displayTax"`
	DisplaySubtotal             string `arg:"displaySubtotal"`
	LineItemID                  string `arg:"lineItemId"`
	LineItemDescription         string `arg:"lineItemDescription"`
	LineItemPrice               string `arg:"lineItemPrice"`
	LineItemQty                 string `arg:"lineItemQty"`
	LineItemExtended            string `arg:"lineItemExtended"`
	LineItemDiscountDescription string `arg:"lineItemDiscountDescription"`
	LineItemDiscountAmount      string `arg:"lineItemDiscountAmount"`
	Prompt                      string `arg:"prompt"`
	PromptType                  string `arg:"promptType"`
	YesCaption                  string `arg:"yesCaption"`
	NoCaption                   string `arg:"noCaption"`
	EBT                         bool   `arg:"ebt"`
	Debit                       bool   `arg:"debit"`
	TCAlias                     string `arg:"tcAlias"`
	TCName                      string `arg:"tcName"`
	TCContent                   string `arg:"tcContent"`
	Timeout                     int    `arg:"timeout"`
	WaitForRemovedCard          bool   `arg:"waitForRemovedCard"`
	Force                       bool   `arg:"force"`
	SigRequired                 bool   `arg:"sigRequired"`
	CashBackEnabled             bool   `arg:"cashback"`
	Enroll                      bool   `arg:"enroll"`
	EnrollOnly                  bool   `arg:"enrollOnly"`
	DisableSignature            bool   `arg:"disableSignature"`
	CustomerID                  string `arg:"customerId"`
	CustomerRef                 string `arg:"customerRef"`
	FirstName                   string `arg:"firstName"`
	LastName                    string `arg:"lastName"`
	CompanyName                 string `arg:"companyName"`
	EMailAddress                string `arg:"email"`
	SMSNumber                   string `arg:"sms"`
	PAN                         string `arg:"pan"`
	ExpiryMonth                 string `arg:"expMonth"`
	ExpiryYear                  string `arg:"expYear"`
	Subject                     string `arg:"subject"`
	AutoSend                    bool   `arg:"autoSend"`
	OrderRef                    string `arg:"orderRef"`
	Query                       string `arg:"query"`
	CallbackURL                 string `arg:"callbackUrl"`
	Surcharge                   bool   `arg:"surcharge"`
	CashDiscount                bool   `arg:"cashDiscount"`
	PostalCode                  string `arg:"postalCode"`
	Address                     string `arg:"address"`
	Cashier                     bool   `arg:"cashier"`
	StartDate                   string `arg:"startDate"`
	EndDate                     string `arg:"endDate"`
	BatchID                     string `arg:"batchId"`
	MaxResults                  int    `arg:"maxResults"`
	StartIndex                  int    `arg:"startIndex"`
	Queue                       bool   `arg:"queue"`
	Async                       bool   `arg:"async"`
	LogRequests                 bool   `arg:"logRequests"`
	LinkCode                    string `arg:"linkCode"`
	Cryptocurrency              string `arg:"crypto"`
	CryptoNetwork               string `arg:"cryptoNetwork"`
	CryptoReceiveAddress        string `arg:"receiveAddress"`
	Label                       string `arg:"label"`
	DBAName                     string `arg:"dbaName"`
	MerchantID                  string `arg:"merchantId"`
	TerminalID                  string `arg:"terminalId"`
	Code                        string `arg:"code"`
	TemplateID                  string `arg:"templateId"`
	LogEntryID                  string `arg:"logEntryId"`
	QuestionID                  string `arg:"questionId"`
	IncludeResponseData         bool   `arg:"includeResponseData"`
	QuestionType                string `arg:"questionType"`
	QuestionText                string `arg:"questionText"`
	Enabled                     bool   `arg:"enabled"`
	Ordinal                     int    `arg:"ordinal"`
	File                        string `arg:"file"`
	UploadID                    string `arg:"uploadId"`
	MediaID                     string `arg:"mediaId"`
	Name                        string `arg:"name"`
	Delay                       int    `arg:"delay"`
	SlideShowID                 string `arg:"slideShowId"`
	AssetID                     string `arg:"assetId"`
	JSON                        string `args:"json"`
	JSONFile                    string `args:"jsonFile"`
	Profile                     string `args:"profile"`
	QRCodeBinary                bool   `args:"qrcodeBinary"`
	QRCodeSize                  int    `args:"qrcodeSize"`
	DaysToExpiration            int    `args:"daysToExpiration"`
	ResetConnection             bool   `args:"resetConnection"`
	RoundingMode                string `args:"roundingMode"`
	Channel                     string `args:"channel"`
	Full                        bool   `args:"full"`
	Archive                     string `args:"archive"`
	Dist                        string `args:"dist"`
	Incremental                 bool   `args:"incremental"`
	ChipRejection               bool   `args:"chipRejection"`
	OutOfOrderReversal          bool   `args:"outOfOrderReversal"`
	AsyncReversals              bool   `args:"asyncReversals"`
}

CommandLineArguments contains arguments which are passed in at runtime.

type ConfigSettings

type ConfigSettings struct {
	APIKey          string `json:"apiKey"`
	BearerToken     string `json:"bearerToken"`
	SigningKey      string `json:"signingKey"`
	GatewayHost     string `json:"gatewayHost"`
	DashboardHost   string `json:"dashboardHost"`
	TestGatewayHost string `json:"testGatewayHost"`
	Secure          bool   `json:"https"`
	RouteCacheTTL   int    `json:"routeCacheTTL"`
	GatewayTimeout  int    `json:"gatewayTimeout"`
	TerminalTimeout int    `json:"terminalTimeout"`
}

ConfigSettings contains configuration options for the CLI.

func LoadConfigSettings

func LoadConfigSettings(args CommandLineArguments) (*ConfigSettings, error)

LoadConfigSettings loads settings from the command line and/or the configuration file.

type CoreRequest

type CoreRequest struct {
	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool

	// Force causes a transaction to override any in-progress transactions.
	Force bool

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string
}

CoreRequest contains core request fields for a transaction.

func (CoreRequest) From

func (r CoreRequest) From(raw interface{}) (result CoreRequest, ok bool)

From creates an instance of CoreRequest with values from a generic type.

type CoreResponse

type CoreResponse struct {
	// TransactionID is the ID assigned to the transaction.
	TransactionID string

	// BatchID is the ID assigned to the batch.
	BatchID string

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string

	// TransactionType is the type of transaction.
	TransactionType string

	// Timestamp is the timestamp of the transaction.
	Timestamp string

	// TickBlock is the hash of the last tick block.
	TickBlock string

	// Test indicates that the transaction was processed on the test gateway.
	Test bool

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string
}

CoreResponse contains core response fields for a transaction.

func (CoreResponse) From

func (r CoreResponse) From(raw interface{}) (result CoreResponse, ok bool)

From creates an instance of CoreResponse with values from a generic type.

type CryptocurrencyResponse

type CryptocurrencyResponse struct {
	// Confirmed indicates that the transaction has met the standard criteria for
	// confirmation on the network. (For example, 6 confirmations for level one
	// bitcoin.)
	Confirmed bool

	// CryptoAuthorizedAmount is the amount submitted to the blockchain.
	CryptoAuthorizedAmount string

	// CryptoNetworkFee is the network level fee assessed for the transaction
	// denominated in cryptocurrency. This fee goes to channel operators and
	// crypto miners, not BlockChyp.
	CryptoNetworkFee string

	// Cryptocurrency is the three letter cryptocurrency code used for the
	// transactions.
	Cryptocurrency string

	// CryptoNetwork indicates whether or not the transaction was processed on
	// the level one or level two network.
	CryptoNetwork string

	// CryptoReceiveAddress the address on the crypto network the transaction was
	// sent to.
	CryptoReceiveAddress string

	// CryptoBlock hash or other identifier that identifies the block on the
	// cryptocurrency network, if available or relevant.
	CryptoBlock string

	// CryptoTransactionID hash or other transaction identifier that identifies
	// the transaction on the cryptocurrency network, if available or relevant.
	CryptoTransactionID string

	// CryptoPaymentRequest is the payment request URI used for the transaction,
	// if available.
	CryptoPaymentRequest string

	// CryptoStatus is used for additional status information related to crypto
	// transactions.
	CryptoStatus string
}

CryptocurrencyResponse contains response details for a cryptocurrency transaction.

func (CryptocurrencyResponse) From

func (r CryptocurrencyResponse) From(raw interface{}) (result CryptocurrencyResponse, ok bool)

From creates an instance of CryptocurrencyResponse with values from a generic type.

type Customer

type Customer struct {
	// ID BlockChyp assigned customer id.
	ID string `json:"id"`

	// CustomerRef optional customer ref that can be used for the client's
	// system's customer id.
	CustomerRef string `json:"customerRef"`

	// FirstName customer's first name.
	FirstName string `json:"firstName"`

	// LastName customer's last name.
	LastName string `json:"lastName"`

	// CompanyName customer's company name.
	CompanyName string `json:"companyName"`

	// EmailAddress customer's email address.
	EmailAddress string `json:"emailAddress"`

	// SmsNumber customer's SMS or mobile number.
	SmsNumber string `json:"smsNumber"`

	// PaymentMethods model saved payment methods associated with a customer.
	PaymentMethods []CustomerToken `json:"paymentMethods"`
}

Customer models a customer record.

type CustomerRequest

type CustomerRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// CustomerID BlockChyp assigned customer id.
	CustomerID string `json:"customerId"`

	// CustomerRef optional customer ref that can be used for the client's
	// system's customer id.
	CustomerRef string `json:"customerRef"`
}

CustomerRequest models a customer data request.

type CustomerResponse

type CustomerResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Customer the customer record.
	Customer *Customer `json:"customer"`
}

CustomerResponse models a customer data response.

type CustomerSearchRequest

type CustomerSearchRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Query search query for customer searches.
	Query string `json:"query"`
}

CustomerSearchRequest models a customer data search request.

type CustomerSearchResponse

type CustomerSearchResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Customers the customer results matching the search query.
	Customers []Customer `json:"customers"`
}

CustomerSearchResponse models customer search results.

type CustomerToken

type CustomerToken struct {
	// Token BlockChyp assigned customer id.
	Token string `json:"token"`

	// MaskedPAN masked primary account number.
	MaskedPAN string `json:"maskedPan"`

	// ExpiryMonth expiration month.
	ExpiryMonth string `json:"expiryMonth"`

	// ExpiryYear expiration month.
	ExpiryYear string `json:"expiryYear"`

	// PaymentType payment type.
	PaymentType string `json:"paymentType"`

	// Customers models customer records associated with a payment token.
	Customers []Customer `json:"customers"`
}

CustomerToken models a customer token.

type DeleteCustomerRequest

type DeleteCustomerRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// CustomerID the ID of the customer to delete.
	CustomerID string `json:"customerId"`
}

DeleteCustomerRequest deletes a customer record.

type DeleteCustomerResponse

type DeleteCustomerResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`
}

DeleteCustomerResponse is the response to a delete customer request.

type DeleteQueuedTransactionRequest

type DeleteQueuedTransactionRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// TransactionRef contains a transaction reference string of the transaction
	// to delete. Passing `*` will clear all queued transactions.
	TransactionRef string `json:"transactionRef"`
}

DeleteQueuedTransactionRequest deletes one or all transactions from a terminal queue.

type DeleteQueuedTransactionResponse

type DeleteQueuedTransactionResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`
}

DeleteQueuedTransactionResponse is the response to a delete queued transaction request.

type DeleteTokenRequest

type DeleteTokenRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token the token to delete.
	Token string `json:"token"`
}

DeleteTokenRequest deletes a payment token.

type DeleteTokenResponse

type DeleteTokenResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`
}

DeleteTokenResponse is the response to a delete token request.

type DownloadMetaData added in v1.24.25

type DownloadMetaData struct {
	URL             string   `json:"url"`
	Packages        []string `json:"packages"`
	IncrementalURLs []string `json:"incrementalUrls"`

	Acknowledgement
}

DownloadMetaData contains data required to download and install an archive.

type EnrollRequest

type EnrollRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token is the payment token to be used for this transaction. This should be
	// used for recurring transactions.
	Token string `json:"token,omitempty"`

	// Track1 contains track 1 magnetic stripe data.
	Track1 string `json:"track1,omitempty"`

	// Track2 contains track 2 magnetic stripe data.
	Track2 string `json:"track2,omitempty"`

	// PAN contains the primary account number. We recommend using the terminal
	// or e-commerce tokenization libraries instead of passing account numbers in
	// directly, as this would put your application in PCI scope.
	PAN string `json:"pan,omitempty"`

	// RoutingNumber is the ACH routing number for ACH transactions.
	RoutingNumber string `json:"routingNumber,omitempty"`

	// CardholderName is the cardholder name. Only required if the request
	// includes a primary account number or track data.
	CardholderName string `json:"cardholderName,omitempty"`

	// ExpMonth is the card expiration month for use with PAN based transactions.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year for use with PAN based transactions.
	ExpYear string `json:"expYear,omitempty"`

	// CVV is the card CVV for use with PAN based transactions.
	CVV string `json:"cvv,omitempty"`

	// Address is the cardholder address for use with address verification.
	Address string `json:"address,omitempty"`

	// PostalCode is the cardholder postal code for use with address
	// verification.
	PostalCode string `json:"postalCode,omitempty"`

	// ManualEntry specifies that the payment entry method is a manual keyed
	// transaction. If this is true, no other payment method will be accepted.
	ManualEntry bool `json:"manualEntry,omitempty"`

	// KSN is the key serial number used for DUKPT encryption.
	KSN string `json:"ksn,omitempty"`

	// PINBlock is the encrypted pin block.
	PINBlock string `json:"pinBlock,omitempty"`

	// CardType designates categories of cards: credit, debit, EBT.
	CardType CardType `json:"cardType,omitempty"`

	// PaymentType designates brands of payment methods: Visa, Discover, etc.
	PaymentType string `json:"paymentType,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// EntryMethod is the method by which the payment card was entered (MSR,
	// CHIP, KEYED, etc.).
	EntryMethod string `json:"entryMethod,omitempty"`

	// Customer customer with which the new token should be associated.
	Customer *Customer `json:"customer"`
}

EnrollRequest contains the information needed to enroll a new payment method in the token vault.

type EnrollResponse

type EnrollResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Approved indicates that the transaction was approved.
	Approved bool `json:"approved"`

	// AuthCode is the auth code from the payment network.
	AuthCode string `json:"authCode,omitempty"`

	// AuthResponseCode is the code returned by the terminal or the card issuer
	// to indicate the disposition of the message.
	AuthResponseCode string `json:"authResponseCode,omitempty"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// Token is the payment token, if the payment was enrolled in the vault.
	Token string `json:"token,omitempty"`

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string `json:"paymentType,omitempty"`

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string `json:"network,omitempty"`

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string `json:"logo,omitempty"`

	// MaskedPAN is the masked primary account number.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string `json:"publicKey,omitempty"`

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool `json:"ScopeAlert,omitempty"`

	// CardHolder is the cardholder name.
	CardHolder string `json:"cardHolder,omitempty"`

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year in YY format.
	ExpYear string `json:"expYear,omitempty"`

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse `json:"avsResponse"`

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions `json:"receiptSuggestions"`

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer `json:"customer"`

	// Customers contains customer data, if any.
	Customers []Customer `json:"customers"`

	// SigFile contains the hex encoded signature data.
	SigFile string `json:"sigFile,omitempty"`
}

EnrollResponse contains the response to an enroll request.

type FirmwareMetadata added in v1.24.25

type FirmwareMetadata struct {
	Archives []string `json:"archives"`
	Packages []string `json:"packages"`

	Acknowledgement
}

FirmwareMetadata models a firmware metadata response

type GetMerchantsRequest

type GetMerchantsRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test indicates whether or not to return test or live merchants.
	Test bool `json:"test"`

	// MaxResults max to be returned in a single page. Defaults to the system max
	// of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for paged results. Defaults to zero.
	StartIndex int `json:"startIndex"`
}

GetMerchantsRequest models a request for merchant information.

type GetMerchantsResponse

type GetMerchantsResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates whether or not these results are for test or live
	// merchants.
	Test bool `json:"test"`

	// MaxResults max to be returned in a single page. Defaults to the system max
	// of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for paged results. Defaults to zero.
	StartIndex int `json:"startIndex"`

	// ResultCount total number of results accessible through paging.
	ResultCount int `json:"resultCount"`

	// Merchants merchants in the current page of results.
	Merchants []MerchantProfileResponse `json:"merchants"`
}

GetMerchantsResponse contains the results for a merchant list request.

type GiftActivateRequest

type GiftActivateRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the requested amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool `json:"surcharge"`

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool `json:"cashDiscount"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

GiftActivateRequest contains the information needed to activate or recharge a gift card.

type GiftActivateResponse

type GiftActivateResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// Approved indicates that the card was activated.
	Approved bool `json:"approved"`

	// Amount is the amount of the transaction.
	Amount string `json:"amount"`

	// CurrentBalance is the current balance of the gift card.
	CurrentBalance string `json:"currentBalance"`

	// CurrencyCode is the currency code used for the transaction.
	CurrencyCode string `json:"currencyCode"`

	// PublicKey is the public key of the activated card.
	PublicKey string `json:"publicKey"`

	// MaskedPAN is the masked card identifier.
	MaskedPAN string `json:"maskedPan,omitempty"`
}

GiftActivateResponse contains the response to a gift activate request.

type Healthcare

type Healthcare struct {
	// Types is a list of healthcare categories in the transaction.
	Types []HealthcareGroup `json:"types"`

	// IIASVerified indicates that the purchased items were verified against an
	// Inventory Information Approval System (IIAS).
	IIASVerified bool `json:"iiasVerified"`

	// IIASExempt indicates that the transaction is exempt from IIAS
	// verification.
	IIASExempt bool `json:"iiasExempt"`
}

Healthcare contains fields for HSA/FSA transactions.

type HealthcareGroup

type HealthcareGroup struct {
	// Type the type of healthcare cost.
	Type HealthcareType `json:"type"`

	// Amount is the amount of this type.
	Amount string `json:"amount"`

	// ProviderID the provider ID used for Mastercard and Discover IIAS requests.
	ProviderID string `json:"providerId"`

	// ServiceTypeCode the service type code used for Mastercard and Discover
	// IIAS requests.
	ServiceTypeCode string `json:"serviceTypeCode"`

	// PayerOrCarrierID thr payer ID/carrier ID used for Mastercard and Discover
	// IIAS requests.
	PayerOrCarrierID string `json:"payerOrCarrierId"`

	// ApprovalRejectReasonCode the approval or reject reason code used for
	// Mastercard and Discover IIAS requests.
	ApprovalRejectReasonCode string `json:"approvalRejectReasonCode"`
}

HealthcareGroup is a group of fields for a specific type of healthcare.

type HealthcareType

type HealthcareType string

HealthcareType is a category of healthcare.

type HeartbeatResponse

type HeartbeatResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Timestamp is the timestamp of the heartbeat.
	Timestamp time.Time `json:"timestamp"`

	// Clockchain is the public key of the clockchain. This is blockchain stuff
	// that you don't really need to worry about. It is a base 58 encoded and
	// compressed eliptic curve public key. For the production clockchain, this
	// will always be: '3cuhsckVUd9HzMjbdUSW17aY5kCcm1d6YAphJMUwmtXRj7WLyU'.
	Clockchain string `json:"clockchain"`

	// LatestTick is the hash of the last tick block.
	LatestTick string `json:"latestTick"`

	// MerchantPublicKey is the public key for the merchant's blockchain.
	MerchantPublicKey string `json:"merchantPk"`
}

HeartbeatResponse contains the response to a basic API health check. If the security context permits it, the response may also include the public key of the current merchant.

type InviteMerchantUserRequest

type InviteMerchantUserRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// MerchantID is the merchant id. Optional for merchant scoped requests.
	MerchantID string `json:"merchantId"`

	// Email is the email address of the user.
	Email string `json:"email"`

	// FirstName is the first name of the new user.
	FirstName string `json:"firstName"`

	// LastName is the last name of the new user.
	LastName string `json:"lastName"`

	// Roles an optional array of role codes that will be assigned to the user.
	// If omitted defaults to the default merchant role.
	Roles []string `json:"roles"`
}

InviteMerchantUserRequest models a request for adding a new user to a merchant account.

type LinkTokenRequest

type LinkTokenRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token the token to delete.
	Token string `json:"token"`

	// CustomerID BlockChyp assigned customer id.
	CustomerID string `json:"customerId"`
}

LinkTokenRequest links a payment token with a customer record.

type ListQueuedTransactionsRequest

type ListQueuedTransactionsRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

ListQueuedTransactionsRequest returns a list of queued transactions on a terminal.

type ListQueuedTransactionsResponse

type ListQueuedTransactionsResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionRefs is a list of queued transactions on the terminal.
	TransactionRefs []string `json:"transactionRefs"`
}

ListQueuedTransactionsResponse contains a list of queued transactions on a terminal.

type LocateRequest

type LocateRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

LocateRequest contains information needed to retrieve location information for a terminal.

type LocateResponse

type LocateResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// TerminalName is the name assigned to the terminal at activation.
	TerminalName string `json:"terminalName"`

	// IPAddress is the local IP address of the terminal.
	IPAddress string `json:"ipAddress"`

	// CloudRelay indicates whether or not the terminal is running in cloud relay
	// mode.
	CloudRelay bool `json:"cloudRelay"`

	// PublicKey is the terminal's public key.
	PublicKey string `json:"publicKey"`
}

LocateResponse contains the response to a locate request.

type MediaLibraryResponse

type MediaLibraryResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// MaxResults max to be returned in a single page. Defaults to the system max
	// of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for paged results. Defaults to zero.
	StartIndex int `json:"startIndex"`

	// ResultCount total number of results accessible through paging.
	ResultCount int `json:"resultCount"`

	// Results enumerates all media assets available in the context.
	Results []MediaMetadata `json:"results"`
}

MediaLibraryResponse models a media library response.

type MediaMetadata

type MediaMetadata struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID id used to identify the media asset.
	ID string `json:"id"`

	// OriginalFile is the original filename assigned to the media asset.
	OriginalFile string `json:"originalFile"`

	// Name is the descriptive name of the media asset.
	Name string `json:"name"`

	// Description is a description of the media asset and its purpose.
	Description string `json:"description"`

	// Tags is an array of tags associated with a media asset.
	Tags []string `json:"tags"`

	// FileURL is the url for the full resolution versio of the media file.
	FileURL string `json:"fileUrl"`

	// ThumbnailURL is the url for to the thumbnail of an image.
	ThumbnailURL string `json:"thumbnailUrl"`

	// Video is an identifier used to flag video files.
	Video bool `json:"video"`
}

MediaMetadata models a request to retrieve survey results.

type MediaRequest

type MediaRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// MediaID id used to track a media asset.
	MediaID string `json:"mediaId"`
}

MediaRequest models a request to retrieve or manipulate media assets.

type MerchantPlatform

type MerchantPlatform struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// ID primary identifier for a given platform configuration.
	ID string `json:"id"`

	// Disabled indicates that a platform configuration is disabled.
	Disabled bool `json:"disabled"`

	// PlatformCode is BlockChyp's code for the boarding platform.
	PlatformCode string `json:"platformCode"`

	// Priority is the platform's priority in a multi platform setup.
	Priority int `json:"priority"`

	// RegistrationID is an optional field specifying the merchant's card brand
	// registration record.
	RegistrationID string `json:"registrationId"`

	// MerchantID is the merchant's primary identifier.
	MerchantID string `json:"merchantId"`

	// AcquirerMid specifies the merchant id assigned by the acquiring bank.
	AcquirerMid string `json:"acquirerMid"`

	// Notes free form notes description the purpose or intent behind the
	// platform configuration.
	Notes string `json:"notes"`

	// EntryMethod is the optional entry method code if a platform should only be
	// used for specific entry methods. Leave blank for 'all'.
	EntryMethod string `json:"entryMethod"`

	// DateCreated is the date the platform configuration was first created.
	DateCreated string `json:"dateCreated"`

	// LastChange is the date the platform configuration was last modified.
	LastChange string `json:"lastChange"`

	// ConfigMap is a map of configuration values specific to the boarding
	// platform. These are not published. Contact your BlockChyp rep for
	// supported values.
	ConfigMap map[string]string `json:"configMap,omitempty"`
}

MerchantPlatform contains details about a merchant board platform configuration.

type MerchantPlatformRequest

type MerchantPlatformRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// PlatformID is the platform configuration id.
	PlatformID string `json:"platformId"`
}

MerchantPlatformRequest models a request related to a platform configuration.

type MerchantPlatformsResponse

type MerchantPlatformsResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates whether or not these results are for test or live
	// merchants.
	Test bool `json:"test"`

	// Results enumerates merchant platform settings.
	Results []MerchantPlatform `json:"results"`
}

MerchantPlatformsResponse contains the results for a merchant platforms inquiry.

type MerchantProfile

type MerchantProfile struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test indicates that the response came from the test gateway.
	Test bool `json:"test"`

	// MerchantID is the merchant id.
	MerchantID string `json:"merchantId"`

	// CompanyName is the merchant's company name.
	CompanyName string `json:"companyName"`

	// DBAName is the dba name of the merchant.
	DBAName string `json:"dbaName"`

	// InvoiceName is the name the merchant prefers on payment link invoices.
	InvoiceName string `json:"invoiceName"`

	// ContactName is the contact name for the merchant.
	ContactName string `json:"contactName"`

	// ContactNumber is the contact number for the merchant.
	ContactNumber string `json:"contactNumber"`

	// LocationName is the location name.
	LocationName string `json:"locationName"`

	// StoreNumber is the store number.
	StoreNumber string `json:"storeNumber"`

	// PartnerRef is the partner assigne reference for this merchant.
	PartnerRef string `json:"partnerRef"`

	// TimeZone is the merchant's local time zone.
	TimeZone string `json:"timeZone"`

	// BatchCloseTime is the batch close time in the merchant's time zone.
	BatchCloseTime string `json:"batchCloseTime"`

	// TerminalUpdateTime is the terminal firmware update time.
	TerminalUpdateTime string `json:"terminalUpdateTime"`

	// AutoBatchClose flag indicating whether or not the batch automatically
	// closes.
	AutoBatchClose bool `json:"autoBatchClose"`

	// DisableBatchEmails flag indicating whether or not batch closure emails
	// should be automatically sent.
	DisableBatchEmails bool `json:"disableBatchEmails"`

	// PINEnabled flag indicating whether or not pin entry is enabled.
	PINEnabled bool `json:"pinEnabled"`

	// CashBackEnabled flag indicating whether or not cash back is enabled.
	CashBackEnabled bool `json:"cashBackEnabled"`

	// StoreAndForwardEnabled flag indicating whether or not store and forward is
	// enabled.
	StoreAndForwardEnabled bool `json:"storeAndForwardEnabled"`

	// PartialAuthEnabled flag indicating whether or not partial authorizations
	// are supported for this merchant.
	PartialAuthEnabled bool `json:"partialAuthEnabled"`

	// SplitBankAccountsEnabled flag indicating whether or not this merchant
	// support split settlement.
	SplitBankAccountsEnabled bool `json:"splitBankAccountsEnabled"`

	// StoreAndForwardFloorLimit floor limit for store and forward transactions.
	StoreAndForwardFloorLimit string `json:"storeAndForwardFloorLimit"`

	// PublicKey is the blockchyp public key for this merchant.
	PublicKey string `json:"publicKey"`

	// Status is the underwriting/processing status for the the merchant.
	Status string `json:"status"`

	// CashDiscountEnabled enables cash discount or surcharging.
	CashDiscountEnabled bool `json:"cashDiscountEnabled"`

	// SurveyTimeout is the post transaction survey timeout in seconds.
	SurveyTimeout int `json:"surveyTimeout"`

	// CooldownTimeout is time a transaction result is displayed on a terminal
	// before the terminal is automatically cleared in seconds.
	CooldownTimeout int `json:"cooldownTimeout"`

	// TipEnabled indicates that tips are enabled for a merchant account.
	TipEnabled bool `json:"tipEnabled"`

	// PromptForTip indicates that tips should be automatically prompted for
	// after charge and preauth transactions.
	PromptForTip bool `json:"promptForTip"`

	// TipDefaults three default values for tips. Can be provided as a percentage
	// if a percent sign is provided. Otherwise the values are assumed to be
	// basis points.
	TipDefaults []string `json:"tipDefaults"`

	// CashbackPresets four default values for cashback prompts.
	CashbackPresets []string `json:"cashbackPresets"`

	// EBTEnabled indicates that EBT cards are enabled.
	EBTEnabled bool `json:"ebtEnabled"`

	// FreeRangeRefundsEnabled indicates that refunds without transaction
	// references are permitted.
	FreeRangeRefundsEnabled bool `json:"freeRangeRefundsEnabled"`

	// PINBypassEnabled indicates that pin bypass is enabled.
	PINBypassEnabled bool `json:"pinBypassEnabled"`

	// GiftCardsDisabled indicates that gift cards are disabled.
	GiftCardsDisabled bool `json:"giftCardsDisabled"`

	// TCDisabled disables terms and conditions pages in the merchant UI.
	TCDisabled bool `json:"tcDisabled"`

	// DigitalSignaturesEnabled indicates that digital signature capture is
	// enabled.
	DigitalSignaturesEnabled bool `json:"digitalSignaturesEnabled"`

	// DigitalSignatureReversal indicates that transactions should auto-reverse
	// when signatures are refused.
	DigitalSignatureReversal bool `json:"digitalSignatureReversal"`

	// BillingAddress is the address to be used for billing correspondence.
	BillingAddress Address `json:"billingAddress"`

	// ShippingAddress is the address to be used for shipping.
	ShippingAddress Address `json:"shippingAddress"`

	// Visa indicates that Visa cards are supported.
	Visa bool `json:"visa"`

	// MasterCard indicates that MasterCard is supported.
	MasterCard bool `json:"masterCard"`

	// AMEX indicates that American Express is supported.
	AMEX bool `json:"amex"`

	// Discover indicates that Discover cards are supported.
	Discover bool `json:"discover"`

	// JCB indicates that JCB (Japan Card Bureau) cards are supported.
	JCB bool `json:"jcb"`

	// UnionPay indicates that China Union Pay cards are supported.
	UnionPay bool `json:"unionPay"`

	// ContactlessEMV indicates that contactless EMV cards are supported.
	ContactlessEMV bool `json:"contactlessEmv"`

	// ManualEntryEnabled indicates that manual card entry is enabled.
	ManualEntryEnabled bool `json:"manualEntryEnabled"`

	// ManualEntryPromptZip requires a zip code to be entered for manually
	// entered transactions.
	ManualEntryPromptZip bool `json:"manualEntryPromptZip"`

	// ManualEntryPromptStreetNumber requires a street number to be entered for
	// manually entered transactions.
	ManualEntryPromptStreetNumber bool `json:"manualEntryPromptStreetNumber"`

	// GatewayOnly indicates that this merchant is boarded on BlockChyp in
	// gateway only mode.
	GatewayOnly bool `json:"gatewayOnly"`

	// BankAccounts bank accounts for split bank account merchants.
	BankAccounts []BankAccount `json:"bankAccounts"`
}

MerchantProfile models a merchant profile.

type MerchantProfileRequest

type MerchantProfileRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// MerchantID is the merchant id. Optional for merchant scoped requests.
	MerchantID string `json:"merchantId"`
}

MerchantProfileRequest models a request for information about the merchant profile.

type MerchantProfileResponse

type MerchantProfileResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates that the response came from the test gateway.
	Test bool `json:"test"`

	// MerchantID is the merchant id.
	MerchantID string `json:"merchantId"`

	// CompanyName is the merchant's company name.
	CompanyName string `json:"companyName"`

	// DBAName is the dba name of the merchant.
	DBAName string `json:"dbaName"`

	// InvoiceName is the name the merchant prefers on payment link invoices.
	InvoiceName string `json:"invoiceName"`

	// ContactName is the contact name for the merchant.
	ContactName string `json:"contactName"`

	// ContactNumber is the contact number for the merchant.
	ContactNumber string `json:"contactNumber"`

	// LocationName is the location name.
	LocationName string `json:"locationName"`

	// StoreNumber is the store number.
	StoreNumber string `json:"storeNumber"`

	// PartnerRef is the partner assigne reference for this merchant.
	PartnerRef string `json:"partnerRef"`

	// TimeZone is the merchant's local time zone.
	TimeZone string `json:"timeZone"`

	// BatchCloseTime is the batch close time in the merchant's time zone.
	BatchCloseTime string `json:"batchCloseTime"`

	// TerminalUpdateTime is the terminal firmware update time.
	TerminalUpdateTime string `json:"terminalUpdateTime"`

	// AutoBatchClose flag indicating whether or not the batch automatically
	// closes.
	AutoBatchClose bool `json:"autoBatchClose"`

	// DisableBatchEmails flag indicating whether or not batch closure emails
	// should be automatically sent.
	DisableBatchEmails bool `json:"disableBatchEmails"`

	// PINEnabled flag indicating whether or not pin entry is enabled.
	PINEnabled bool `json:"pinEnabled"`

	// CashBackEnabled flag indicating whether or not cash back is enabled.
	CashBackEnabled bool `json:"cashBackEnabled"`

	// StoreAndForwardEnabled flag indicating whether or not store and forward is
	// enabled.
	StoreAndForwardEnabled bool `json:"storeAndForwardEnabled"`

	// PartialAuthEnabled flag indicating whether or not partial authorizations
	// are supported for this merchant.
	PartialAuthEnabled bool `json:"partialAuthEnabled"`

	// SplitBankAccountsEnabled flag indicating whether or not this merchant
	// support split settlement.
	SplitBankAccountsEnabled bool `json:"splitBankAccountsEnabled"`

	// StoreAndForwardFloorLimit floor limit for store and forward transactions.
	StoreAndForwardFloorLimit string `json:"storeAndForwardFloorLimit"`

	// PublicKey is the blockchyp public key for this merchant.
	PublicKey string `json:"publicKey"`

	// Status is the underwriting/processing status for the the merchant.
	Status string `json:"status"`

	// CashDiscountEnabled enables cash discount or surcharging.
	CashDiscountEnabled bool `json:"cashDiscountEnabled"`

	// SurveyTimeout is the post transaction survey timeout in seconds.
	SurveyTimeout int `json:"surveyTimeout"`

	// CooldownTimeout is time a transaction result is displayed on a terminal
	// before the terminal is automatically cleared in seconds.
	CooldownTimeout int `json:"cooldownTimeout"`

	// TipEnabled indicates that tips are enabled for a merchant account.
	TipEnabled bool `json:"tipEnabled"`

	// PromptForTip indicates that tips should be automatically prompted for
	// after charge and preauth transactions.
	PromptForTip bool `json:"promptForTip"`

	// TipDefaults three default values for tips. Can be provided as a percentage
	// if a percent sign is provided. Otherwise the values are assumed to be
	// basis points.
	TipDefaults []string `json:"tipDefaults"`

	// CashbackPresets four default values for cashback prompts.
	CashbackPresets []string `json:"cashbackPresets"`

	// EBTEnabled indicates that EBT cards are enabled.
	EBTEnabled bool `json:"ebtEnabled"`

	// FreeRangeRefundsEnabled indicates that refunds without transaction
	// references are permitted.
	FreeRangeRefundsEnabled bool `json:"freeRangeRefundsEnabled"`

	// PINBypassEnabled indicates that pin bypass is enabled.
	PINBypassEnabled bool `json:"pinBypassEnabled"`

	// GiftCardsDisabled indicates that gift cards are disabled.
	GiftCardsDisabled bool `json:"giftCardsDisabled"`

	// TCDisabled disables terms and conditions pages in the merchant UI.
	TCDisabled bool `json:"tcDisabled"`

	// DigitalSignaturesEnabled indicates that digital signature capture is
	// enabled.
	DigitalSignaturesEnabled bool `json:"digitalSignaturesEnabled"`

	// DigitalSignatureReversal indicates that transactions should auto-reverse
	// when signatures are refused.
	DigitalSignatureReversal bool `json:"digitalSignatureReversal"`

	// BillingAddress is the address to be used for billing correspondence.
	BillingAddress Address `json:"billingAddress"`

	// ShippingAddress is the address to be used for shipping.
	ShippingAddress Address `json:"shippingAddress"`

	// Visa indicates that Visa cards are supported.
	Visa bool `json:"visa"`

	// MasterCard indicates that MasterCard is supported.
	MasterCard bool `json:"masterCard"`

	// AMEX indicates that American Express is supported.
	AMEX bool `json:"amex"`

	// Discover indicates that Discover cards are supported.
	Discover bool `json:"discover"`

	// JCB indicates that JCB (Japan Card Bureau) cards are supported.
	JCB bool `json:"jcb"`

	// UnionPay indicates that China Union Pay cards are supported.
	UnionPay bool `json:"unionPay"`

	// ContactlessEMV indicates that contactless EMV cards are supported.
	ContactlessEMV bool `json:"contactlessEmv"`

	// ManualEntryEnabled indicates that manual card entry is enabled.
	ManualEntryEnabled bool `json:"manualEntryEnabled"`

	// ManualEntryPromptZip requires a zip code to be entered for manually
	// entered transactions.
	ManualEntryPromptZip bool `json:"manualEntryPromptZip"`

	// ManualEntryPromptStreetNumber requires a street number to be entered for
	// manually entered transactions.
	ManualEntryPromptStreetNumber bool `json:"manualEntryPromptStreetNumber"`

	// GatewayOnly indicates that this merchant is boarded on BlockChyp in
	// gateway only mode.
	GatewayOnly bool `json:"gatewayOnly"`

	// BankAccounts bank accounts for split bank account merchants.
	BankAccounts []BankAccount `json:"bankAccounts"`
}

MerchantProfileResponse models a response for a single merchant profile.

type MerchantUser

type MerchantUser struct {
	// Test indicates whether or not these results are for test or live
	// merchants.
	Test bool `json:"test"`

	// ID is the user's primary key.
	ID string `json:"id"`

	// FirstName is the user's first name.
	FirstName string `json:"firstName"`

	// LastName is the user's last name.
	LastName string `json:"lastName"`

	// Email is the user's email address.
	Email string `json:"email"`

	// Status is the user account status.
	Status string `json:"status"`

	// Type is the type of user account.
	Type string `json:"type"`

	// Roles are the role codes assigned to this user.
	Roles []string `json:"roles"`

	// Locked indicates whether or not this user account is locked.
	Locked bool `json:"locked"`
}

MerchantUser contains details about a merchant user.

type MerchantUsersResponse

type MerchantUsersResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates whether or not these results are for test or live
	// merchants.
	Test bool `json:"test"`

	// Results users and pending invites associated with the merchant.
	Results []MerchantUser `json:"results"`
}

MerchantUsersResponse contains the results for a merchant users list.

type MessageRequest

type MessageRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// Message is the message to be displayed on the terminal.
	Message string `json:"message"`
}

MessageRequest contains a message to be displayed on the terminal screen.

type PaymentAmounts

type PaymentAmounts struct {
	// PartialAuth indicates whether or not the transaction was approved for a
	// partial amount.
	PartialAuth bool

	// AltCurrency indicates whether or not an alternate currency was used.
	AltCurrency bool

	// FSAAuth indicates whether or not a request was settled on an FSA card.
	FSAAuth bool

	// CurrencyCode is the currency code used for the transaction.
	CurrencyCode string

	// RequestedAmount is the requested amount.
	RequestedAmount string

	// AuthorizedAmount is the authorized amount. May not match the requested
	// amount in the event of a partial auth.
	AuthorizedAmount string

	// RemainingBalance is the remaining balance on the payment method.
	RemainingBalance string

	// TipAmount is the tip amount.
	TipAmount string

	// TaxAmount is the tax amount.
	TaxAmount string

	// RequestedCashBackAmount is the cash back amount the customer requested
	// during the transaction.
	RequestedCashBackAmount string

	// AuthorizedCashBackAmount is the amount of cash back authorized by the
	// gateway. This amount will be the entire amount requested, or zero.
	AuthorizedCashBackAmount string
}

PaymentAmounts contains response details about tender amounts.

func (PaymentAmounts) From

func (r PaymentAmounts) From(raw interface{}) (result PaymentAmounts, ok bool)

From creates an instance of PaymentAmounts with values from a generic type.

type PaymentLinkRequest

type PaymentLinkRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the requested amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool `json:"surcharge"`

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool `json:"cashDiscount"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// AutoSend automatically send the link via an email.
	AutoSend bool `json:"autoSend"`

	// Enroll indicates that the payment method should be added to the token
	// vault alongside the authorization.
	Enroll bool `json:"enroll,omitempty"`

	// EnrollOnly indicates that the link should be used to enroll a token only.
	// Can only be used in cashier mode.
	EnrollOnly bool `json:"enrollOnly,omitempty"`

	// QrcodeBinary indicates that the QR Code binary should be returned.
	QrcodeBinary bool `json:"qrcodeBinary,omitempty"`

	// QrcodeSize determines the size of the qr code to be returned.
	QrcodeSize int `json:"qrcodeSize,omitempty"`

	// DaysToExpiration number of days until the payment link expires.
	DaysToExpiration int `json:"daysToExpiration,omitempty"`

	// Cashier flags the payment link as cashier facing.
	Cashier bool `json:"cashier"`

	// Description description explaining the transaction for display to the
	// user.
	Description string `json:"description"`

	// Subject subject of the payment email.
	Subject string `json:"subject"`

	// Transaction transaction details for display on the payment email.
	Transaction *TransactionDisplayTransaction `json:"transaction"`

	// Customer contains customer information.
	Customer Customer `json:"customer"`

	// CallbackURL optional callback url to which transaction responses for this
	// link will be posted.
	CallbackURL string `json:"callbackUrl"`

	// TCAlias is an alias for a Terms and Conditions template configured in the
	// BlockChyp dashboard.
	TCAlias string `json:"tcAlias"`

	// TCName contains the name of the Terms and Conditions the user is
	// accepting.
	TCName string `json:"tcName"`

	// TCContent is the content of the terms and conditions that will be
	// presented to the user.
	TCContent string `json:"tcContent"`

	// Cryptocurrency indicates that the transaction should be a cryptocurrency
	// transaction. Value should be a crypto currency code (ETH, BTC) or ANY to
	// prompt the user to choose from supported cryptocurrencies.
	Cryptocurrency *string `json:"cryptocurrency"`

	// CryptoNetwork is an optional parameter that can be used to force a crypto
	// transaction onto a level one or level two network. Valid values are L1 and
	// L2. Defaults to L1.
	CryptoNetwork *string `json:"cryptoNetwork"`

	// CryptoReceiveAddress can be used to specify a specific receive address for
	// a crypto transaction. Disabled by default. This should only be used by
	// sophisticated users with access to properly configured hot wallets.
	CryptoReceiveAddress *string `json:"cryptoReceiveAddress"`

	// PaymentRequestLabel can optionally add a label to the payment request if
	// the target cryptocurrency supports labels. Defaults to the merchant's DBA
	// Name.
	PaymentRequestLabel *string `json:"paymentRequestLabel"`

	// PaymentRequestMessage can optionally add a message to the payment request
	// if the target cryptocurrency supports labels. Defaults to empty.
	PaymentRequestMessage *string `json:"paymentRequestMessage"`
}

PaymentLinkRequest creates a payment link.

type PaymentLinkResponse

type PaymentLinkResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// LinkCode is the payment link code.
	LinkCode string `json:"linkCode"`

	// URL is the url for the payment link.
	URL string `json:"url"`

	// QrcodeURL is the url for a QR Code associated with this link.
	QrcodeURL string `json:"qrcodeUrl"`

	// QrcodeBinary is the hex encoded binary for the QR Code, if requested.
	// Encoded in PNG format.
	QrcodeBinary string `json:"qrcodeBinary"`

	// CustomerID is the customer id created or used for the payment.
	CustomerID string `json:"customerId"`
}

PaymentLinkResponse creates a payment link.

type PaymentMethod

type PaymentMethod struct {
	// Token is the payment token to be used for this transaction. This should be
	// used for recurring transactions.
	Token string

	// Track1 contains track 1 magnetic stripe data.
	Track1 string

	// Track2 contains track 2 magnetic stripe data.
	Track2 string

	// PAN contains the primary account number. We recommend using the terminal
	// or e-commerce tokenization libraries instead of passing account numbers in
	// directly, as this would put your application in PCI scope.
	PAN string

	// RoutingNumber is the ACH routing number for ACH transactions.
	RoutingNumber string

	// CardholderName is the cardholder name. Only required if the request
	// includes a primary account number or track data.
	CardholderName string

	// ExpMonth is the card expiration month for use with PAN based transactions.
	ExpMonth string

	// ExpYear is the card expiration year for use with PAN based transactions.
	ExpYear string

	// CVV is the card CVV for use with PAN based transactions.
	CVV string

	// Address is the cardholder address for use with address verification.
	Address string

	// PostalCode is the cardholder postal code for use with address
	// verification.
	PostalCode string

	// ManualEntry specifies that the payment entry method is a manual keyed
	// transaction. If this is true, no other payment method will be accepted.
	ManualEntry bool

	// KSN is the key serial number used for DUKPT encryption.
	KSN string

	// PINBlock is the encrypted pin block.
	PINBlock string

	// CardType designates categories of cards: credit, debit, EBT.
	CardType CardType

	// PaymentType designates brands of payment methods: Visa, Discover, etc.
	PaymentType string
}

PaymentMethod contains request details about a payment method.

func (PaymentMethod) From

func (r PaymentMethod) From(raw interface{}) (result PaymentMethod, ok bool)

From creates an instance of PaymentMethod with values from a generic type.

type PaymentMethodResponse

type PaymentMethodResponse struct {
	// Token is the payment token, if the payment was enrolled in the vault.
	Token string

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string

	// MaskedPAN is the masked primary account number.
	MaskedPAN string

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool

	// CardHolder is the cardholder name.
	CardHolder string

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string

	// ExpYear is the card expiration year in YY format.
	ExpYear string

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer

	// Customers contains customer data, if any.
	Customers []Customer
}

PaymentMethodResponse contains response details about a payment method.

func (PaymentMethodResponse) From

func (r PaymentMethodResponse) From(raw interface{}) (result PaymentMethodResponse, ok bool)

From creates an instance of PaymentMethodResponse with values from a generic type.

type PingRequest

type PingRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

PingRequest contains information needed to test connectivity with a terminal.

type PingResponse

type PingResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`
}

PingResponse contains the response to a ping request.

type PreviousTransaction

type PreviousTransaction struct {
	// TransactionID is the ID of the previous transaction being referenced.
	TransactionID string
}

PreviousTransaction contains a reference to a previous transaction.

func (PreviousTransaction) From

func (r PreviousTransaction) From(raw interface{}) (result PreviousTransaction, ok bool)

From creates an instance of PreviousTransaction with values from a generic type.

type PromptType

type PromptType string

PromptType is used to specify the type of text input data being requested from a customer.

type RawPublicKey

type RawPublicKey struct {
	Curve string `json:"curve"`
	X     string `json:"x"`
	Y     string `json:"Y"`
}

RawPublicKey models the primitive form of an ECC public key. A little simpler than X509, ASN and the usual nonsense.

type ReceiptSuggestions

type ReceiptSuggestions struct {
	// AID is the EMV Application Identifier.
	AID string `json:"aid,omitempty"`

	// ARQC is the EMV Application Request Cryptogram.
	ARQC string `json:"arqc,omitempty"`

	// IAD is the EMV Issuer Application Data.
	IAD string `json:"iad,omitempty"`

	// ARC is the EMV Authorization Response Code.
	ARC string `json:"arc,omitempty"`

	// TC is the EMV Transaction Certificate.
	TC string `json:"tc,omitempty"`

	// TVR is the EMV Terminal Verification Response.
	TVR string `json:"tvr,omitempty"`

	// TSI is the EMV Transaction Status Indicator.
	TSI string `json:"tsi,omitempty"`

	// TerminalID is the ID of the payment terminal.
	TerminalID string `json:"terminalId,omitempty"`

	// MerchantName is the name of the merchant's business.
	MerchantName string `json:"merchantName,omitempty"`

	// MerchantID is the ID of the merchant.
	MerchantID string `json:"merchantId,omitempty"`

	// MerchantKey is the partially masked merchant key required on EMV receipts.
	MerchantKey string `json:"merchantKey,omitempty"`

	// ApplicationLabel is a description of the selected AID.
	ApplicationLabel string `json:"applicationLabel,omitempty"`

	// RequestSignature indicates that the receipt should contain a signature
	// line.
	RequestSignature bool `json:"requestSignature"`

	// MaskedPAN is the masked primary account number of the payment card, as
	// required.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// AuthorizedAmount is the amount authorized by the payment network. Could be
	// less than the requested amount for partial auth.
	AuthorizedAmount string `json:"authorizedAmount"`

	// TransactionType is the type of transaction performed (CHARGE, PREAUTH,
	// REFUND, etc).
	TransactionType string `json:"transactionType"`

	// EntryMethod is the method by which the payment card was entered (MSR,
	// CHIP, KEYED, etc.).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PINVerified indicates that PIN verification was performed.
	PINVerified bool `json:"pinVerified,omitempty"`

	// CVMUsed indicates the customer verification method used for the
	// transaction.
	CVMUsed CVMType `json:"cvmUsed,omitempty"`

	// Fallback indicates that a chip read failure caused the transaction to fall
	// back to the magstripe.
	Fallback bool `json:"fallback,omitempty"`

	// BatchSequence is the sequence of the transaction in the batch.
	BatchSequence int `json:"batchSequence,omitempty"`

	// CashBackAmount is the amount of cash back that was approved.
	CashBackAmount string `json:"cashBackAmount,omitempty"`

	// Surcharge is the amount added to the transaction to cover eligible credit
	// card fees.
	Surcharge string `json:"surcharge,omitempty"`

	// CashDiscount is the discount applied to the transaction for payment
	// methods ineligible for surcharges.
	CashDiscount string `json:"cashDiscount,omitempty"`
}

ReceiptSuggestions contains EMV fields we recommend developers put on their receipts.

type RefundRequest

type RefundRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token is the payment token to be used for this transaction. This should be
	// used for recurring transactions.
	Token string `json:"token,omitempty"`

	// Track1 contains track 1 magnetic stripe data.
	Track1 string `json:"track1,omitempty"`

	// Track2 contains track 2 magnetic stripe data.
	Track2 string `json:"track2,omitempty"`

	// PAN contains the primary account number. We recommend using the terminal
	// or e-commerce tokenization libraries instead of passing account numbers in
	// directly, as this would put your application in PCI scope.
	PAN string `json:"pan,omitempty"`

	// RoutingNumber is the ACH routing number for ACH transactions.
	RoutingNumber string `json:"routingNumber,omitempty"`

	// CardholderName is the cardholder name. Only required if the request
	// includes a primary account number or track data.
	CardholderName string `json:"cardholderName,omitempty"`

	// ExpMonth is the card expiration month for use with PAN based transactions.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year for use with PAN based transactions.
	ExpYear string `json:"expYear,omitempty"`

	// CVV is the card CVV for use with PAN based transactions.
	CVV string `json:"cvv,omitempty"`

	// Address is the cardholder address for use with address verification.
	Address string `json:"address,omitempty"`

	// PostalCode is the cardholder postal code for use with address
	// verification.
	PostalCode string `json:"postalCode,omitempty"`

	// ManualEntry specifies that the payment entry method is a manual keyed
	// transaction. If this is true, no other payment method will be accepted.
	ManualEntry bool `json:"manualEntry,omitempty"`

	// KSN is the key serial number used for DUKPT encryption.
	KSN string `json:"ksn,omitempty"`

	// PINBlock is the encrypted pin block.
	PINBlock string `json:"pinBlock,omitempty"`

	// CardType designates categories of cards: credit, debit, EBT.
	CardType CardType `json:"cardType,omitempty"`

	// PaymentType designates brands of payment methods: Visa, Discover, etc.
	PaymentType string `json:"paymentType,omitempty"`

	// TransactionID is the ID of the previous transaction being referenced.
	TransactionID string `json:"transactionId"`

	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string `json:"currencyCode"`

	// Amount is the requested amount.
	Amount string `json:"amount"`

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool `json:"taxExempt"`

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool `json:"surcharge"`

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool `json:"cashDiscount"`

	// SigFile is a location on the filesystem which a customer signature should
	// be written to.
	SigFile string `json:"sigFile,omitempty"`

	// SigFormat specifies the image format to be used for returning signatures.
	SigFormat SignatureFormat `json:"sigFormat,omitempty"`

	// SigWidth is the width that the signature image should be scaled to,
	// preserving the aspect ratio. If not provided, the signature is returned in
	// the terminal's max resolution.
	SigWidth int `json:"sigWidth,omitempty"`

	// DisableSignature specifies whether or not signature prompt should be
	// skipped on the terminal. The terminal will indicate whether or not a
	// signature is required by the card in the receipt suggestions response.
	DisableSignature bool `json:"disableSignature,omitempty"`

	// TipAmount is the tip amount.
	TipAmount string `json:"tipAmount,omitempty"`

	// TaxAmount is the tax amount.
	TaxAmount string `json:"taxAmount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// Healthcare contains details for HSA/FSA transactions.
	Healthcare *Healthcare `json:"healthcare,omitempty"`

	// SimulateChipRejection instructs the terminal to simulate a post auth chip
	// rejection that would trigger an automatic reversal.
	SimulateChipRejection bool `json:"simulateChipRejection,omitempty"`

	// SimulateOutOfOrderReversal instructs the terminal to simulate an out of
	// order automatic reversal.
	SimulateOutOfOrderReversal bool `json:"simulateOutOfOrderReversal,omitempty"`

	// AsyncReversals causes auto-reversals on the terminal to be executed
	// asyncronously. Use with caution and in conjunction with the transaction
	// status API.
	AsyncReversals bool `json:"asyncReversals,omitempty"`
}

RefundRequest contains a refund request.

type RequestAmount

type RequestAmount struct {
	// CurrencyCode indicates the transaction currency code.
	CurrencyCode string

	// Amount is the requested amount.
	Amount string

	// TaxExempt indicates that the request is tax exempt. Only required for tax
	// exempt level 2 processing.
	TaxExempt bool

	// Surcharge is a flag to add a surcharge to the transaction to cover credit
	// card fees, if permitted.
	Surcharge bool

	// CashDiscount is a flag that applies a discount to negate the surcharge for
	// debit transactions or other surcharge ineligible payment methods.
	CashDiscount bool
}

RequestAmount contains request details about tender amounts.

func (RequestAmount) From

func (r RequestAmount) From(raw interface{}) (result RequestAmount, ok bool)

From creates an instance of RequestAmount with values from a generic type.

type RoundingMode added in v1.24.19

type RoundingMode string

RoundingMode indicates how partial penny rounding operations should work

type RouteCache

type RouteCache struct {
	Routes map[string]routeCacheEntry `json:"routes"`
}

RouteCache models offline route cache information.

type SideLoadRequest added in v1.24.25

type SideLoadRequest struct {
	Terminal        string
	Channel         string
	Full            bool
	HTTPS           bool
	Incremental     bool
	Archive         string
	TempDir         string
	Dist            string
	PlatformMap     map[string][]Archive
	BlockChypClient *Client
	HTTPClient      *http.Client
}

SideLoadRequest models a request to sideload software onto a terminal

type SideLogger added in v1.24.25

type SideLogger interface {

	// Infoln wraps the logrus Infoln function
	Infoln(args ...interface{})

	// Infof wraps the logrus Infof function
	Infof(format string, args ...interface{})
}

SideLogger is a simple interface to handle sideloader process logging

type SignatureFormat

type SignatureFormat string

SignatureFormat is used to specify the output format for customer signature images.

type SignatureRequest

type SignatureRequest struct {
	// SigFile is a location on the filesystem which a customer signature should
	// be written to.
	SigFile string

	// SigFormat specifies the image format to be used for returning signatures.
	SigFormat SignatureFormat

	// SigWidth is the width that the signature image should be scaled to,
	// preserving the aspect ratio. If not provided, the signature is returned in
	// the terminal's max resolution.
	SigWidth int

	// DisableSignature specifies whether or not signature prompt should be
	// skipped on the terminal. The terminal will indicate whether or not a
	// signature is required by the card in the receipt suggestions response.
	DisableSignature bool
}

SignatureRequest contains a request for customer signature data.

func (SignatureRequest) From

func (r SignatureRequest) From(raw interface{}) (result SignatureRequest, ok bool)

From creates an instance of SignatureRequest with values from a generic type.

type SignatureResponse

type SignatureResponse struct {
	// SigFile contains the hex encoded signature data.
	SigFile string
}

SignatureResponse contains customer signature data.

func (SignatureResponse) From

func (r SignatureResponse) From(raw interface{}) (result SignatureResponse, ok bool)

From creates an instance of SignatureResponse with values from a generic type.

type Slide

type Slide struct {
	// MediaID is the id for the media asset to be used for this slide. Must be
	// an image.
	MediaID string `json:"mediaId"`

	// Ordinal position of the slide within the slide show.
	Ordinal int `json:"ordinal"`

	// ThumbnailURL is the fully qualified thumbnail url for the slide.
	ThumbnailURL string `json:"thumbnailUrl"`
}

Slide models a slide within a slide show.

type SlideShow

type SlideShow struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID is the primary id for the slide show.
	ID string `json:"id"`

	// Name is the name of the slide show.
	Name string `json:"name"`

	// Delay time between slides in seconds.
	Delay int `json:"delay"`

	// Slides enumerates all slides in the display sequence.
	Slides []*Slide `json:"slides"`
}

SlideShow models a media library response.

type SlideShowRequest

type SlideShowRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// SlideShowID id used to track a slide show.
	SlideShowID string `json:"slideShowId"`
}

SlideShowRequest models a request to retrieve or manipulate terminal slide shows.

type SlideShowResponse

type SlideShowResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// MaxResults max to be returned in a single page. Defaults to the system max
	// of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for paged results. Defaults to zero.
	StartIndex int `json:"startIndex"`

	// ResultCount total number of results accessible through paging.
	ResultCount int `json:"resultCount"`

	// Results enumerates all slide shows responsive to the original query.
	Results []SlideShow `json:"results"`
}

SlideShowResponse models a slide show response.

type Subtotals

type Subtotals struct {
	// TipAmount is the tip amount.
	TipAmount string

	// TaxAmount is the tax amount.
	TaxAmount string
}

Subtotals contains request subtotals.

func (Subtotals) From

func (r Subtotals) From(raw interface{}) (result Subtotals, ok bool)

From creates an instance of Subtotals with values from a generic type.

type SurveyDataPoint

type SurveyDataPoint struct {
	// AnswerKey is a unique identifier for a specific answer type.
	AnswerKey string `json:"answerKey"`

	// AnswerDescription is a narrative description of the answer.
	AnswerDescription string `json:"answerDescription"`

	// ResponseCount is the number of responses.
	ResponseCount int `json:"responseCount"`

	// ResponsePercentage is response rate as a percentage of total transactions.
	ResponsePercentage float64 `json:"responsePercentage"`

	// AverageTransaction is the average transaction amount for a given answer.
	AverageTransaction float64 `json:"averageTransaction"`
}

SurveyDataPoint models a request to retrieve or manipulate survey questions.

type SurveyQuestion

type SurveyQuestion struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID internal id for a survey question.
	ID string `json:"id"`

	// Ordinal ordinal number indicating the position of the survey question in
	// the post transaction sequence.
	Ordinal int `json:"ordinal"`

	// Enabled determines whether or not the question will be presented post
	// transaction.
	Enabled bool `json:"enabled"`

	// QuestionText is the full text of the transaction.
	QuestionText string `json:"questionText"`

	// QuestionType indicates the type of question. Valid values are 'yes_no' and
	// 'scaled'.
	QuestionType string `json:"questionType"`

	// TransactionCount is the total number of transactions processed during the
	// query period if results are requested.
	TransactionCount int `json:"transactionCount,omitempty"`

	// ResponseCount is the total number of responses during the query period if
	// results are requested.
	ResponseCount int `json:"responseCount,omitempty"`

	// ResponseRate is the response rate, expressed as a ratio, if results are
	// requested.
	ResponseRate float64 `json:"responseRate,omitempty"`

	// Responses is the set of response data points.
	Responses []SurveyDataPoint `json:"responses"`
}

SurveyQuestion models a survey question.

type SurveyQuestionRequest

type SurveyQuestionRequest struct {
	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// QuestionID id of a single question.
	QuestionID string `json:"questionId"`

	// Timeout is an optional timeout override.
	Timeout int `json:"timeout"`
}

SurveyQuestionRequest models a request to retrieve or manipulate survey questions.

type SurveyQuestionResponse

type SurveyQuestionResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Results is the full result set responsive to the original request.
	Results []SurveyQuestion `json:"results"`
}

SurveyQuestionResponse models a survey question response.

type SurveyResultsRequest

type SurveyResultsRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// QuestionID id of a single question.
	QuestionID string `json:"questionId"`

	// StartDate is an optional start date for filtering response data.
	StartDate string `json:"startDate"`

	// EndDate is an optional end date for filtering response data.
	EndDate string `json:"endDate"`
}

SurveyResultsRequest models a request to retrieve survey results.

type TerminalActivationRequest

type TerminalActivationRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// MerchantID is the optional merchant id.
	MerchantID string `json:"merchantId"`

	// ActivationCode is the terminal activation code displayed on the terminal.
	ActivationCode string `json:"activationCode"`

	// TerminalName is the name to be assigned to the terminal. Must be unique
	// for the merchant account.
	TerminalName string `json:"terminalName"`

	// CloudRelay indicates that the terminal should be activated in cloud relay
	// mode.
	CloudRelay bool `json:"cloudRelay"`
}

TerminalActivationRequest models a terminal activation request.

type TerminalAuthorizationRequest

type TerminalAuthorizationRequest struct {
	APICredentials
	Request AuthorizationRequest `json:"request"`
}

TerminalAuthorizationRequest contains an authorization request for a charge, preauth, or reverse transaction.

type TerminalBalanceRequest

type TerminalBalanceRequest struct {
	APICredentials
	Request BalanceRequest `json:"request"`
}

TerminalBalanceRequest contains a request for the remaining balance on a payment type.

type TerminalBooleanPromptRequest

type TerminalBooleanPromptRequest struct {
	APICredentials
	Request BooleanPromptRequest `json:"request"`
}

TerminalBooleanPromptRequest contains a simple yes no prompt request.

type TerminalCaptureSignatureRequest

type TerminalCaptureSignatureRequest struct {
	APICredentials
	Request CaptureSignatureRequest `json:"request"`
}

TerminalCaptureSignatureRequest contains a request for customer signature data.

type TerminalClearTerminalRequest

type TerminalClearTerminalRequest struct {
	APICredentials
	Request ClearTerminalRequest `json:"request"`
}

TerminalClearTerminalRequest contains the information needed to enroll a new payment method in the token vault.

type TerminalDeactivationRequest

type TerminalDeactivationRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TerminalName is the terminal name assigned to the terminal.
	TerminalName string `json:"terminalName"`

	// TerminalID is the id assigned by BlockChyp to the terminal.
	TerminalID string `json:"terminalId"`
}

TerminalDeactivationRequest models a terminal deactivation request.

type TerminalDeleteQueuedTransactionRequest

type TerminalDeleteQueuedTransactionRequest struct {
	APICredentials
	Request DeleteQueuedTransactionRequest `json:"request"`
}

TerminalDeleteQueuedTransactionRequest deletes one or all transactions from a terminal queue.

type TerminalEnrollRequest

type TerminalEnrollRequest struct {
	APICredentials
	Request EnrollRequest `json:"request"`
}

TerminalEnrollRequest contains the information needed to enroll a new payment method in the token vault.

type TerminalGiftActivateRequest

type TerminalGiftActivateRequest struct {
	APICredentials
	Request GiftActivateRequest `json:"request"`
}

TerminalGiftActivateRequest contains the information needed to activate or recharge a gift card.

type TerminalListQueuedTransactionsRequest

type TerminalListQueuedTransactionsRequest struct {
	APICredentials
	Request ListQueuedTransactionsRequest `json:"request"`
}

TerminalListQueuedTransactionsRequest returns a list of queued transactions on a terminal.

type TerminalLocateRequest

type TerminalLocateRequest struct {
	APICredentials
	Request LocateRequest `json:"request"`
}

TerminalLocateRequest contains information needed to retrieve location information for a terminal.

type TerminalMessageRequest

type TerminalMessageRequest struct {
	APICredentials
	Request MessageRequest `json:"request"`
}

TerminalMessageRequest contains a message to be displayed on the terminal screen.

type TerminalPingRequest

type TerminalPingRequest struct {
	APICredentials
	Request PingRequest `json:"request"`
}

TerminalPingRequest contains information needed to test connectivity with a terminal.

type TerminalProfile

type TerminalProfile struct {
	// ID primary identifier for a given terminal.
	ID string `json:"id"`

	// IPAddress is the terminal's local IP address.
	IPAddress string `json:"ipAddress"`

	// TerminalName is the name assigned to the terminal during activation.
	TerminalName string `json:"terminalName"`

	// TerminalType is the terminal type.
	TerminalType string `json:"terminalType"`

	// TerminalTypeDisplayString is the terminal type display string.
	TerminalTypeDisplayString string `json:"terminalTypeDisplayString"`

	// BlockChypFirmwareVersion is the current firmware version deployed on the
	// terminal.
	BlockChypFirmwareVersion string `json:"blockChypFirmwareVersion"`

	// CloudBased indicates whether or not the terminal is configured for cloud
	// relay.
	CloudBased bool `json:"cloudBased"`

	// PublicKey is the terminal's elliptic curve public key.
	PublicKey string `json:"publicKey"`

	// SerialNumber is the manufacturer's serial number.
	SerialNumber string `json:"serialNumber"`

	// Online indicates whether or not the terminal is currently online.
	Online bool `json:"online"`

	// Since the date and time the terminal was first brought online.
	Since string `json:"since"`

	// TotalMemory is the total memory on the terminal.
	TotalMemory int `json:"totalMemory"`

	// TotalStorage is the storage on the terminal.
	TotalStorage int `json:"totalStorage"`

	// AvailableMemory is the available (unused) memory on the terminal.
	AvailableMemory int `json:"availableMemory"`

	// AvailableStorage is the available (unused) storage on the terminal.
	AvailableStorage int `json:"availableStorage"`

	// UsedMemory is the memory currently in use on the terminal.
	UsedMemory int `json:"usedMemory"`

	// UsedStorage is the storage currently in use on the terminal.
	UsedStorage int `json:"usedStorage"`

	// BrandingPreview is the branding asset currently displayed on the terminal.
	BrandingPreview string `json:"brandingPreview"`

	// GroupID the id of the terminal group to which the terminal belongs, if
	// any.
	GroupID string `json:"groupId"`

	// GroupName the name of the terminal group to which the terminal belongs, if
	// any.
	GroupName string `json:"groupName"`
}

TerminalProfile contains details about a merchant board platform configuration.

type TerminalProfileRequest

type TerminalProfileRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`
}

TerminalProfileRequest models a terminal profile request.

type TerminalProfileResponse

type TerminalProfileResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Results enumerates all terminal profiles in the response.
	Results []TerminalProfile `json:"results"`
}

TerminalProfileResponse models a terminal profile response.

type TerminalReference

type TerminalReference struct {
	// TerminalName is the name of the target payment terminal.
	TerminalName string

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool
}

TerminalReference contains a reference to a terminal name.

func (TerminalReference) From

func (r TerminalReference) From(raw interface{}) (result TerminalReference, ok bool)

From creates an instance of TerminalReference with values from a generic type.

type TerminalRefundRequest

type TerminalRefundRequest struct {
	APICredentials
	Request RefundRequest `json:"request"`
}

TerminalRefundRequest contains a refund request.

type TerminalRoute

type TerminalRoute struct {
	Exists               bool           `json:"exists"`
	TerminalName         string         `json:"terminalName"`
	IPAddress            string         `json:"ipAddress"`
	CloudRelayEnabled    bool           `json:"cloudRelayEnabled"`
	TransientCredentials APICredentials `json:"transientCredentials,omitempty"`
	PublicKey            string         `json:"publicKey"`
	RawKey               RawPublicKey   `json:"rawKey"`
	Timestamp            time.Time      `json:"timestamp"`
	HTTPS                bool           `json:"https"`
}

TerminalRoute models route information for a payment terminal.

type TerminalRouteResponse

type TerminalRouteResponse struct {
	TerminalRoute
	Success bool   `json:"success"`
	Error   string `json:"error"`
}

TerminalRouteResponse models a terminal route response from the gateway.

type TerminalStatusRequest

type TerminalStatusRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`
}

TerminalStatusRequest contains a request for the status of a terminal.

type TerminalStatusResponse

type TerminalStatusResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Idle indicates that the terminal is idle.
	Idle bool `json:"idle"`

	// CardInSlot indicates whether or not a card is currently in the card slot.
	CardInSlot bool `json:"cardInSlot"`

	// Status contains the operation that the terminal is performing.
	Status string `json:"status"`

	// TransactionRef contains the transaction reference for an ongoing
	// transaction, if one was specified at request time.
	TransactionRef string `json:"transactionRef"`

	// Since is the timestamp of the last status change.
	Since time.Time `json:"since"`
}

TerminalStatusResponse contains the current status of a terminal.

type TerminalTerminalStatusRequest

type TerminalTerminalStatusRequest struct {
	APICredentials
	Request TerminalStatusRequest `json:"request"`
}

TerminalTerminalStatusRequest contains a request for the status of a terminal.

type TerminalTermsAndConditionsRequest

type TerminalTermsAndConditionsRequest struct {
	APICredentials
	Request TermsAndConditionsRequest `json:"request"`
}

TerminalTermsAndConditionsRequest contains the fields needed for custom Terms and Conditions prompts.

type TerminalTermsAndConditionsResponse

type TerminalTermsAndConditionsResponse struct {
	APICredentials
	Request TermsAndConditionsResponse `json:"request"`
}

TerminalTermsAndConditionsResponse contains a signature capture response for Terms and Conditions.

type TerminalTextPromptRequest

type TerminalTextPromptRequest struct {
	APICredentials
	Request TextPromptRequest `json:"request"`
}

TerminalTextPromptRequest contains a text prompt request.

type TerminalTransactionDisplayRequest

type TerminalTransactionDisplayRequest struct {
	APICredentials
	Request TransactionDisplayRequest `json:"request"`
}

TerminalTransactionDisplayRequest is used to start or update a transaction line item display on a terminal.

type TerminalVolume

type TerminalVolume struct {
	// TerminalName is the terminal name assigned during activation.
	TerminalName string `json:"terminalName"`

	// SerialNumber is the manufacturer's serial number.
	SerialNumber string `json:"serialNumber"`

	// TerminalType is the terminal type.
	TerminalType string `json:"terminalType"`

	// CapturedAmount is the captured amount.
	CapturedAmount string `json:"capturedAmount"`

	// TransactionCount is the number of transactions run on this terminal.
	TransactionCount int `json:"transactionCount"`
}

TerminalVolume models transaction volume for a single terminal.

type TermsAndConditionsLogEntry

type TermsAndConditionsLogEntry struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID internal id for a Terms and Conditions entry.
	ID string `json:"id"`

	// TerminalID id of the terminal that captured this terms and conditions
	// entry.
	TerminalID string `json:"terminalId"`

	// TerminalName name of the terminal that captured this terms and conditions
	// entry.
	TerminalName string `json:"terminalName"`

	// Test is a flag indicating whether or not the terminal was a test terminal.
	Test bool `json:"test"`

	// Timestamp date and time the terms and conditions acceptance occurred.
	Timestamp string `json:"timestamp"`

	// TransactionRef optional transaction ref if the terms and conditions was
	// associated with a transaction.
	TransactionRef string `json:"transactionRef"`

	// TransactionID optional transaction id if only log entries related to a
	// transaction should be returned.
	TransactionID string `json:"transactionId"`

	// Alias alias of the terms and conditions template used for this entry, if
	// any.
	Alias string `json:"alias"`

	// Name title of the document displayed on the terminal at the time of
	// capture.
	Name string `json:"name"`

	// Content full text of the document agreed to at the time of signature
	// capture.
	Content string `json:"content"`

	// ContentLeader first 32 characters of the full text. Used to support user
	// interfaces that show summaries.
	ContentLeader string `json:"contentLeader"`

	// HasSignature is a flag that indicates whether or not a signature has been
	// captured.
	HasSignature bool `json:"hasSignature"`

	// SigFormat specifies the image format to be used for returning signatures.
	SigFormat SignatureFormat `json:"sigFormat,omitempty"`

	// Signature is the base 64 encoded signature image if the format requested.
	Signature string `json:"signature"`
}

TermsAndConditionsLogEntry models a Terms and Conditions log entry.

type TermsAndConditionsLogRequest

type TermsAndConditionsLogRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// LogEntryID is the identifier of the log entry to be returned for single
	// result requests.
	LogEntryID string `json:"logEntryId"`

	// TransactionID optional transaction id if only log entries related to a
	// transaction should be returned.
	TransactionID string `json:"transactionId"`

	// MaxResults max to be returned in a single page. Defaults to the system max
	// of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for paged results. Defaults to zero.
	StartIndex int `json:"startIndex"`

	// StartDate is an optional start date for filtering response data.
	StartDate string `json:"startDate"`

	// EndDate is an optional end date for filtering response data.
	EndDate string `json:"endDate"`
}

TermsAndConditionsLogRequest models a Terms and Conditions history request.

type TermsAndConditionsLogResponse

type TermsAndConditionsLogResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID optional transaction id if only log entries related to a
	// transaction should be returned.
	TransactionID string `json:"transactionId"`

	// MaxResults max to be returned in a single page. Defaults to the system max
	// of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for paged results. Defaults to zero.
	StartIndex int `json:"startIndex"`

	// ResultCount total number of results accessible through paging.
	ResultCount int `json:"resultCount"`

	// Results is the full result set responsive to the original request, subject
	// to pagination limits.
	Results []TermsAndConditionsLogEntry `json:"results"`
}

TermsAndConditionsLogResponse models a Terms and Conditions history request.

type TermsAndConditionsRequest

type TermsAndConditionsRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TransactionID is the ID of the previous transaction being referenced.
	TransactionID string `json:"transactionId"`

	// SigFile is a location on the filesystem which a customer signature should
	// be written to.
	SigFile string `json:"sigFile,omitempty"`

	// SigFormat specifies the image format to be used for returning signatures.
	SigFormat SignatureFormat `json:"sigFormat,omitempty"`

	// SigWidth is the width that the signature image should be scaled to,
	// preserving the aspect ratio. If not provided, the signature is returned in
	// the terminal's max resolution.
	SigWidth int `json:"sigWidth,omitempty"`

	// DisableSignature specifies whether or not signature prompt should be
	// skipped on the terminal. The terminal will indicate whether or not a
	// signature is required by the card in the receipt suggestions response.
	DisableSignature bool `json:"disableSignature,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// TCAlias is an alias for a Terms and Conditions template configured in the
	// BlockChyp dashboard.
	TCAlias string `json:"tcAlias"`

	// TCName contains the name of the Terms and Conditions the user is
	// accepting.
	TCName string `json:"tcName"`

	// TCContent is the content of the terms and conditions that will be
	// presented to the user.
	TCContent string `json:"tcContent"`

	// ContentHash is a hash of the terms and conditions content that can be used
	// for caching.
	ContentHash string `json:"contentHash"`

	// SigRequired indicates that a signature should be requested.
	SigRequired bool `json:"sigRequired"`
}

TermsAndConditionsRequest contains the fields needed for custom Terms and Conditions prompts.

type TermsAndConditionsResponse

type TermsAndConditionsResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// SigFile contains the hex encoded signature data.
	SigFile string `json:"sigFile,omitempty"`
}

TermsAndConditionsResponse contains a signature capture response for Terms and Conditions.

type TermsAndConditionsTemplate

type TermsAndConditionsTemplate struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID primary identifier for a given template.
	ID string `json:"id"`

	// Alias is an alias or code used to refer to a template.
	Alias string `json:"alias"`

	// Name is the name of the template. Displayed as the agreement title on the
	// terminal.
	Name string `json:"name"`

	// Content is the full text of the agreement template.
	Content string `json:"content"`
}

TermsAndConditionsTemplate models a full terms and conditions template.

type TermsAndConditionsTemplateRequest

type TermsAndConditionsTemplateRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TemplateID id of a single template.
	TemplateID string `json:"templateId"`
}

TermsAndConditionsTemplateRequest models a request to retrieve or manipulate terms and conditions data.

type TermsAndConditionsTemplateResponse

type TermsAndConditionsTemplateResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Results results responsive to a request.
	Results []TermsAndConditionsTemplate `json:"results"`

	// Timeout is an optional timeout override.
	Timeout int `json:"timeout"`
}

TermsAndConditionsTemplateResponse models a set of templates responsive to a request.

type TextPromptRequest

type TextPromptRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// PromptType is the prompt type (email, phone, etc).
	PromptType PromptType `json:"promptType"`
}

TextPromptRequest contains a text prompt request.

type TextPromptResponse

type TextPromptResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Response is the text prompt response.
	Response string `json:"response"`
}

TextPromptResponse contains the response to a text prompt request.

type TimeoutRequest

type TimeoutRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool
}

TimeoutRequest models a low level request with a timeout and test flag.

func (TimeoutRequest) From

func (r TimeoutRequest) From(raw interface{}) (result TimeoutRequest, ok bool)

From creates an instance of TimeoutRequest with values from a generic type.

type TokenMetadataRequest

type TokenMetadataRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token the token to retrieve.
	Token string `json:"token"`
}

TokenMetadataRequest retrieves token metadata.

type TokenMetadataResponse

type TokenMetadataResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Token the token metadata for a given query.
	Token CustomerToken `json:"token"`
}

TokenMetadataResponse models a payment token metadata response.

type TransactionDisplayDiscount

type TransactionDisplayDiscount struct {
	// Description is the discount description.
	Description string `json:"description"`

	// Amount is the amount of the discount.
	Amount string `json:"amount"`
}

TransactionDisplayDiscount is an item level discount for transaction display. Discounts never combine.

type TransactionDisplayItem

type TransactionDisplayItem struct {
	// ID is a unique value identifying the item. This is not required, but
	// recommended since it is required to update or delete line items.
	ID string `json:"id"`

	// Description is a description of the line item.
	Description string `json:"description"`

	// Price is the price of the line item.
	Price string `json:"price"`

	// Quantity is the quantity of the line item.
	Quantity float64 `json:"quantity"`

	// Extended is an item category in a transaction display. Groups combine if
	// their descriptions match. Calculated subtotal amounts are rounded to two
	// decimal places of precision. Quantity is a floating point number that is
	// not rounded at all.
	Extended string `json:"extended"`

	// UnitCode is an alphanumeric code for units of measurement as used in
	// international trade.
	UnitCode string `json:"unitCode"`

	// CommodityCode is an international description code of the item.
	CommodityCode string `json:"commodityCode"`

	// ProductCode is a merchant-defined description code of the item.
	ProductCode string `json:"productCode"`

	// Discounts are displayed under their corresponding item.
	Discounts []*TransactionDisplayDiscount `json:"discounts"`
}

TransactionDisplayItem is an item category in a transaction display. Groups combine if their descriptions match. Calculated subtotal amounts are rounded to two decimal places of precision. Quantity is a floating point number that is not rounded at all.

type TransactionDisplayRequest

type TransactionDisplayRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TerminalName is the name of the target payment terminal.
	TerminalName string `json:"terminalName,omitempty"`

	// ResetConnection forces the terminal cloud connection to be reset while a
	// transactions is in flight. This is a diagnostic settings that can be used
	// only for test transactions.
	ResetConnection bool `json:"resetConnection"`

	// Transaction transaction to display on the terminal.
	Transaction *TransactionDisplayTransaction `json:"transaction"`
}

TransactionDisplayRequest is used to start or update a transaction line item display on a terminal.

type TransactionDisplayTransaction

type TransactionDisplayTransaction struct {
	// Subtotal is the subtotal to display.
	Subtotal string `json:"subtotal"`

	// Tax is the tax to display.
	Tax string `json:"tax"`

	// Total is the total to display.
	Total string `json:"total"`

	// Items is an item to display. Can be overwritten or appended, based on the
	// request type.
	Items []*TransactionDisplayItem `json:"items"`
}

TransactionDisplayTransaction contains the items to display on a terminal.

type TransactionHistoryRequest

type TransactionHistoryRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Query optional search query. Will match amount, last 4 and customer name.
	// batchId and terminalName are not supported with this option.
	Query string `json:"query"`

	// BatchID optional batch id.
	BatchID string `json:"batchId"`

	// TerminalName optional terminal name.
	TerminalName string `json:"terminalName"`

	// StartDate optional start date filter for batch history.
	StartDate time.Time `json:"startDate"`

	// EndDate optional end date filter for batch history.
	EndDate time.Time `json:"endDate"`

	// MaxResults max results to be returned by this request.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index for results to be returned.
	StartIndex int `json:"startIndex"`
}

TransactionHistoryRequest models a batch history request.

type TransactionHistoryResponse

type TransactionHistoryResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Test indicates that the response came from the test gateway.
	Test bool `json:"test"`

	// BatchID batch identifier if filtered by batch.
	BatchID string `json:"batchId"`

	// TerminalName terminal name if filtered by terminal.
	TerminalName string `json:"terminalName"`

	// StartDate start date if filtered by start date.
	StartDate time.Time `json:"startDate"`

	// EndDate end date if filtered by end date.
	EndDate time.Time `json:"endDate"`

	// MaxResults max results from the original request echoed back. Defaults to
	// the system max of 250.
	MaxResults int `json:"maxResults"`

	// StartIndex starting index from the original request echoed back.
	StartIndex int `json:"startIndex"`

	// TotalResultCount total number of results accessible through paging.
	TotalResultCount int `json:"totalResultCount"`

	// Transactions matching transaction history.
	Transactions []AuthorizationResponse `json:"transactions"`
}

TransactionHistoryResponse models response to a batch history request.

type TransactionStatus

type TransactionStatus struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Approved indicates that the transaction was approved.
	Approved bool `json:"approved"`

	// AuthCode is the auth code from the payment network.
	AuthCode string `json:"authCode,omitempty"`

	// AuthResponseCode is the code returned by the terminal or the card issuer
	// to indicate the disposition of the message.
	AuthResponseCode string `json:"authResponseCode,omitempty"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// PartialAuth indicates whether or not the transaction was approved for a
	// partial amount.
	PartialAuth bool `json:"partialAuth"`

	// AltCurrency indicates whether or not an alternate currency was used.
	AltCurrency bool `json:"altCurrency"`

	// FSAAuth indicates whether or not a request was settled on an FSA card.
	FSAAuth bool `json:"fsaAuth"`

	// CurrencyCode is the currency code used for the transaction.
	CurrencyCode string `json:"currencyCode"`

	// RequestedAmount is the requested amount.
	RequestedAmount string `json:"requestedAmount"`

	// AuthorizedAmount is the authorized amount. May not match the requested
	// amount in the event of a partial auth.
	AuthorizedAmount string `json:"authorizedAmount"`

	// RemainingBalance is the remaining balance on the payment method.
	RemainingBalance string `json:"remainingBalance"`

	// TipAmount is the tip amount.
	TipAmount string `json:"tipAmount"`

	// TaxAmount is the tax amount.
	TaxAmount string `json:"taxAmount"`

	// RequestedCashBackAmount is the cash back amount the customer requested
	// during the transaction.
	RequestedCashBackAmount string `json:"requestedCashBackAmount"`

	// AuthorizedCashBackAmount is the amount of cash back authorized by the
	// gateway. This amount will be the entire amount requested, or zero.
	AuthorizedCashBackAmount string `json:"authorizedCashBackAmount"`

	// Token is the payment token, if the payment was enrolled in the vault.
	Token string `json:"token,omitempty"`

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string `json:"paymentType,omitempty"`

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string `json:"network,omitempty"`

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string `json:"logo,omitempty"`

	// MaskedPAN is the masked primary account number.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string `json:"publicKey,omitempty"`

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool `json:"ScopeAlert,omitempty"`

	// CardHolder is the cardholder name.
	CardHolder string `json:"cardHolder,omitempty"`

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year in YY format.
	ExpYear string `json:"expYear,omitempty"`

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse `json:"avsResponse"`

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions `json:"receiptSuggestions"`

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer `json:"customer"`

	// Customers contains customer data, if any.
	Customers []Customer `json:"customers"`

	// SigFile contains the hex encoded signature data.
	SigFile string `json:"sigFile,omitempty"`

	// StoreAndForward indicates that the transaction was flagged for store and
	// forward due to network problems.
	StoreAndForward bool `json:"storeAndForward"`
}

TransactionStatus models the status of a transaction.

type TransactionStatusRequest

type TransactionStatusRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TransactionID is the BlockChyp assigned transaction id.
	TransactionID string `json:"transactionId,omitempty"`
}

TransactionStatusRequest models the request for updated information about a transaction.

type UnlinkTokenRequest

type UnlinkTokenRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Token the token to delete.
	Token string `json:"token"`

	// CustomerID BlockChyp assigned customer id.
	CustomerID string `json:"customerId"`
}

UnlinkTokenRequest removes a link between a payment token with a customer record, if one exists.

type UpdateCustomerRequest

type UpdateCustomerRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Customer models a customer update request.
	Customer Customer `json:"customer"`
}

UpdateCustomerRequest models a customer data search request.

type UploadMetadata

type UploadMetadata struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// UploadID optional id used to track status and progress of an upload while
	// in progress.
	UploadID string `json:"uploadId"`

	// FileSize is the size of the file to be uploaded in bytes.
	FileSize int64 `json:"fileSize"`

	// FileName is the name of file to be uploaded.
	FileName string `json:"fileName"`
}

UploadMetadata models information needed to process a file upload.

type UploadStatus

type UploadStatus struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// ID id used to track status and progress of an upload while in progress.
	ID string `json:"id"`

	// MediaID is the media id assigned to the result.
	MediaID string `json:"mediaId"`

	// FileSize is the size of the file to be uploaded in bytes.
	FileSize int64 `json:"fileSize"`

	// UploadedAmount is the amount of the file already uploaded.
	UploadedAmount int64 `json:"uploadedAmount"`

	// Status is the current status of a file upload.
	Status string `json:"status"`

	// Complete indicates whether or not the upload and associated file
	// processing is complete.
	Complete bool `json:"complete"`

	// Processing indicates whether or not the file is processing. This normally
	// applied to video files undergoing format transcoding.
	Processing bool `json:"processing"`

	// Percentage current upload progress rounded to the nearest integer.
	Percentage int `json:"percentage"`

	// ThumbnailLocation is the url of a thumbnail for the file, if available.
	ThumbnailLocation string `json:"thumbnailLocation"`
}

UploadStatus models the current status of a file upload.

type UploadStatusRequest

type UploadStatusRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// UploadID id used to track status and progress of an upload while in
	// progress.
	UploadID string `json:"uploadId"`
}

UploadStatusRequest is used to request the status of a file upload.

type VoidRequest

type VoidRequest struct {
	// Timeout is the request timeout in seconds.
	Timeout int `json:"timeout"`

	// Test specifies whether or not to route transaction to the test gateway.
	Test bool `json:"test"`

	// TransactionRef contains a user-assigned reference that can be used to
	// recall or reverse transactions.
	TransactionRef string `json:"transactionRef,omitempty"`

	// AutogeneratedRef indicates that the transaction reference was
	// autogenerated and should be ignored for the purposes of duplicate
	// detection.
	AutogeneratedRef bool `json:"autogeneratedRef"`

	// Async defers the response to the transaction and returns immediately.
	// Callers should retrive the transaction result using the Transaction Status
	// API.
	Async bool `json:"async"`

	// Queue adds the transaction to the queue and returns immediately. Callers
	// should retrive the transaction result using the Transaction Status API.
	Queue bool `json:"queue"`

	// WaitForRemovedCard specifies whether or not the request should block until
	// all cards have been removed from the card reader.
	WaitForRemovedCard bool `json:"waitForRemovedCard,omitempty"`

	// Force causes a transaction to override any in-progress transactions.
	Force bool `json:"force,omitempty"`

	// OrderRef is an identifier from an external point of sale system.
	OrderRef string `json:"orderRef,omitempty"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// TransactionID is the ID of the previous transaction being referenced.
	TransactionID string `json:"transactionId"`
}

VoidRequest contains a void request.

type VoidResponse

type VoidResponse struct {
	// Success indicates whether or not the request succeeded.
	Success bool `json:"success"`

	// Error is the error, if an error occurred.
	Error string `json:"error"`

	// ResponseDescription contains a narrative description of the transaction
	// result.
	ResponseDescription string `json:"responseDescription"`

	// Approved indicates that the transaction was approved.
	Approved bool `json:"approved"`

	// AuthCode is the auth code from the payment network.
	AuthCode string `json:"authCode,omitempty"`

	// AuthResponseCode is the code returned by the terminal or the card issuer
	// to indicate the disposition of the message.
	AuthResponseCode string `json:"authResponseCode,omitempty"`

	// TransactionID is the ID assigned to the transaction.
	TransactionID string `json:"transactionId"`

	// BatchID is the ID assigned to the batch.
	BatchID string `json:"batchId,omitempty"`

	// TransactionRef is the transaction reference string assigned to the
	// transaction request. If no transaction ref was assiged on the request,
	// then the gateway will randomly generate one.
	TransactionRef string `json:"transactionRef,omitempty"`

	// TransactionType is the type of transaction.
	TransactionType string `json:"transactionType"`

	// Timestamp is the timestamp of the transaction.
	Timestamp string `json:"timestamp"`

	// TickBlock is the hash of the last tick block.
	TickBlock string `json:"tickBlock"`

	// Test indicates that the transaction was processed on the test gateway.
	Test bool `json:"test"`

	// DestinationAccount is the settlement account for merchants with split
	// settlements.
	DestinationAccount string `json:"destinationAccount,omitempty"`

	// Sig is the ECC signature of the response. Can be used to ensure that it
	// was signed by the terminal and detect man-in-the middle attacks.
	Sig string `json:"sig,omitempty"`

	// Token is the payment token, if the payment was enrolled in the vault.
	Token string `json:"token,omitempty"`

	// EntryMethod is the entry method for the transaction (CHIP, MSR, KEYED,
	// etc).
	EntryMethod string `json:"entryMethod,omitempty"`

	// PaymentType is the card brand (VISA, MC, AMEX, DEBIT, etc).
	PaymentType string `json:"paymentType,omitempty"`

	// Network provides network level detail on how a transaction was routed,
	// especially for debit transactions.
	Network string `json:"network,omitempty"`

	// used to indicate the major logo on a card, even when debit transactions
	// are routed on a different network.
	Logo string `json:"logo,omitempty"`

	// MaskedPAN is the masked primary account number.
	MaskedPAN string `json:"maskedPan,omitempty"`

	// PublicKey is the BlockChyp public key if the user presented a BlockChyp
	// payment card.
	PublicKey string `json:"publicKey,omitempty"`

	// ScopeAlert indicates that the transaction did something that would put the
	// system in PCI scope.
	ScopeAlert bool `json:"ScopeAlert,omitempty"`

	// CardHolder is the cardholder name.
	CardHolder string `json:"cardHolder,omitempty"`

	// ExpMonth is the card expiration month in MM format.
	ExpMonth string `json:"expMonth,omitempty"`

	// ExpYear is the card expiration year in YY format.
	ExpYear string `json:"expYear,omitempty"`

	// AVSResponse contains address verification results if address information
	// was submitted.
	AVSResponse AVSResponse `json:"avsResponse"`

	// ReceiptSuggestions contains suggested receipt fields.
	ReceiptSuggestions ReceiptSuggestions `json:"receiptSuggestions"`

	// Customer contains customer data, if any. Preserved for reverse
	// compatibility.
	Customer *Customer `json:"customer"`

	// Customers contains customer data, if any.
	Customers []Customer `json:"customers"`

	// SigFile contains the hex encoded signature data.
	SigFile string `json:"sigFile,omitempty"`
}

VoidResponse contains the response to a void request.

type WhiteListedCard

type WhiteListedCard struct {
	// Bin is the card BIN.
	Bin string `json:"bin"`

	// Track1 is the track 1 data from the card.
	Track1 string `json:"track1"`

	// Track2 is the track 2 data from the card.
	Track2 string `json:"track2"`

	// PAN is the card primary account number.
	PAN string `json:"pan"`
}

WhiteListedCard shows details about a white listed card.

Directories

Path Synopsis
cmd
pkg
scripts

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL