Payment Gateways

  1. Overview
  2. List Payment Gateways
  3. Get a single Payment Gateway
  4. Create a new Payment Gateway
  5. Update a Payment Gateway

Overview

This resource represents Payment Gateways (allowing integration with providers such Stripe, Ingenico etc.) that you can later assign to Rentals and start accepting payments via credit card.

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Payment Gateway
id BigInteger Read Uniq identifier.
name String Read Payment Gateway’s name serving as an additional identifier.
test Boolean Read Submitted requests will not be charged if set to true.
gateway_name String Read Payment Gateway’s name, available values are described in enums section
credentials Object Read Credentials used for payment gateway authentication.
supported_cardtypes Array Read Array of String values containing supported cardtypes for selected gateway.
supported_currencies Array Read Array of string values containing supported currencies for selected gateway.
tokenize_credit_card_details Boolean Read Credit Card details will be tokenized if set to true before card’s authorization. The value will be automatically set to true when handling 3DS flow.
host_booking_pay_wallet_id String Read Wallet ID for BookingPay host.
created_at Time Read Payment Gateway’s creation time.
updated_at Time Read Payment Gateway’s creation time.
Name Type Read/Write Description Constraints
account Integer Read Account’s ID related to the Payment Gateway  
id BigInteger Read Uniq identifier.  
name String Read/Write Payment Gateway’s name serving as an additional identifier. Required, must not contain non-printing characters
test Boolean Read/Write Submitted requests will not be charged if set to true (test mode/sandbox will be used).  
gateway_name String Read/Write Payment Gateway’s name, available values are described in: enums section Required, must be one of the available gateway names
credentials Object Read/Write Credentials used for payment gateway authentication. Required, the schema depends on gateway_name
supported_cardtypes Array Read/Write Array of String values containing supported cardtypes for selected gateway, available values are described in: enums section Required, must contain valid cardtypes supported by a given payment gateway
supported_currencies Array Read/Write Array of string values containing supported currencies for selected gateway. Required, must contain valid currencies
tokenize_credit_card_details Boolean Read/Write Credit Card details will be tokenized if set to true before card’s authorization. The value will be automatically set to true when handling 3DS flow.  
host_booking_pay_wallet_id String Read Wallet ID for BookingPay host.  
created_at Time Read Payment Gateway’s creation time.  
updated_at Time Read Payment Gateway’s creation time.  

List Payment Gateways

List all Payment Gateways for a given account.

GET /payment_gateways

Response

{
  "links": {
    "payment_gateways.account": "https://www.bookingsync.com/api/v3/accounts/{payment_gateways.account}"
  },
  "payment_gateways": [
    {
      "id": 1,
      "credentials": {
        "login": "login"
      },
      "gateway_name": "bogus",
      "host_booking_pay_wallet_id": null,
      "name": "TestingGatewayName",
      "supported_cardtypes": [
        "visa",
        "master"
      ],
      "supported_currencies": [
        "EUR",
        "THB"
      ],
      "test": true,
      "tokenize_credit_card_details": true,
      "created_at": "2019-08-15T14:27:48Z",
      "updated_at": "2019-08-21T16:07:47Z",
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1",
      "last": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Get a single Payment Gateway

Returns a single payment gateway identified by ID.

GET /payment_gateways/:payment_gateway_id

Response

{
  "links": {
    "payment_gateways.account": "https://www.bookingsync.com/api/v3/accounts/{payment_gateways.account}"
  },
  "payment_gateways": [
    {
      "id": 1,
      "credentials": {
        "login": "login"
      },
      "gateway_name": "bogus",
      "host_booking_pay_wallet_id": null,
      "name": "TestingGatewayName",
      "supported_cardtypes": [
        "visa",
        "master"
      ],
      "supported_currencies": [
        "EUR",
        "THB"
      ],
      "test": true,
      "tokenize_credit_card_details": true,
      "created_at": "2019-08-15T14:27:48Z",
      "updated_at": "2019-08-21T16:07:47Z",
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1",
      "last": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Create a new Payment Gateway

Creates a Payment Gateway

POST /payment_gateways

Example JSON request

{
  "payment_gateways": [
    {
      "credentials": {
        "login": "login"
      },
      "gateway_name": "bogus",
      "name": "TestingGatewayName",
      "supported_cardtypes": [
        "visa",
        "master"
      ],
      "supported_currencies": [
        "EUR",
        "THB"
      ],
      "test": true,
      "tokenize_credit_card_details": true
    }
  ]
}

Response

{
  "links": {
    "payment_gateways.account": "https://www.bookingsync.com/api/v3/accounts/{payment_gateways.account}"
  },
  "payment_gateways": [
    {
      "id": 1,
      "credentials": {
        "login": "login"
      },
      "gateway_name": "bogus",
      "host_booking_pay_wallet_id": null,
      "name": "TestingGatewayName",
      "supported_cardtypes": [
        "visa",
        "master"
      ],
      "supported_currencies": [
        "EUR",
        "THB"
      ],
      "test": true,
      "tokenize_credit_card_details": true,
      "created_at": "2019-08-15T14:27:48Z",
      "updated_at": "2019-08-21T16:07:47Z",
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1",
      "last": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}

Update a Payment Gateway

Returns an updated payment gateway identified by ID.

PUT /payment_gateways/:payment_gateway_id

Example JSON request

{
  "payment_gateways": [
    {
      "credentials": {
        "login": "login"
      },
      "gateway_name": "bogus",
      "name": "TestingGatewayName",
      "supported_cardtypes": [
        "visa",
        "master"
      ],
      "supported_currencies": [
        "EUR",
        "THB"
      ],
      "test": true,
      "tokenize_credit_card_details": true
    }
  ]
}

Response

{
  "links": {
    "payment_gateways.account": "https://www.bookingsync.com/api/v3/accounts/{payment_gateways.account}"
  },
  "payment_gateways": [
    {
      "id": 1,
      "credentials": {
        "login": "login"
      },
      "gateway_name": "bogus",
      "host_booking_pay_wallet_id": null,
      "name": "TestingGatewayName",
      "supported_cardtypes": [
        "visa",
        "master"
      ],
      "supported_currencies": [
        "EUR",
        "THB"
      ],
      "test": true,
      "tokenize_credit_card_details": true,
      "created_at": "2019-08-15T14:27:48Z",
      "updated_at": "2019-08-21T16:07:47Z",
      "links": {
        "account": 1
      }
    }
  ],
  "meta": {
    "Link": {
      "first": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1",
      "last": "https://www.bookingsync.com/api/v3/payment_gateways/1.json?bookings%5B%5D%5Bcanceled_at%5D=&page=1"
    },
    "X-Per-Page": "100",
    "X-Total-Count": "1",
    "X-Total-Pages": "1"
  }
}