Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api_calls/reference/payment_gateways/create-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"payment_gateways": [
{
"name": "Payment Gateway",
"gateway_name": "stripe",
"credentials": { "login": "login" },
"supported_cardtypes": ["visa", "mastercard"],
"supported_currencies": ["EUR", "USD"],
"test": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"links": {
"payment_gateways.account": "https://www.bookingsync.com/api/v3/accounts/{payment_gateways.account}"
},
"payment_gateways": [
{
"links": {
"account": 1
},
"id": 1,
"test": false,
"name": "Payment Gateway",
"gateway_name": "Gateway name",
"credentials": "login: 12345",
"supported_cardtypes": ["visa", "mastercard"],
"supported_currencies": ["EUR", "USD"],
"tokenize_credit_card_details": "token",
"created_at": "2017-08-10T09:36:10Z",
"updated_at": "2017-08-10T09:36:10Z"
}
],
"meta": {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"links": {
"payment_gateways.account": "https://www.bookingsync.com/api/v3/accounts/{payment_gateways.account}"
},
"payment_gateways": [
{
"links": {
"account": 1
},
"id": 1,
"test": false,
"name": "Payment Gateway",
"gateway_name": "Gateway name",
"credentials": "login: 12345",
"supported_cardtypes": ["visa", "mastercard"],
"supported_currencies": ["EUR", "USD"],
"tokenize_credit_card_details": "token",
"created_at": "2017-08-10T09:36:10Z",
"updated_at": "2017-08-10T09:36:10Z"
}
],
"meta": {
}
}
12 changes: 12 additions & 0 deletions api_calls/reference/payment_gateways/update-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"payment_gateways": [
{
"name": "Payment Gateway",
"gateway_name": "stripe",
"credentials": { "login": "login" },
"supported_cardtypes": ["visa", "mastercard"],
"supported_currencies": ["EUR", "USD"],
"test": false
}
]
}
3 changes: 2 additions & 1 deletion api_calls/reference/payments/create-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"zip": "07671-8254",
"city": "East Winifred",
"state": "Monatana",
"country_code": "US"
"country_code": "US",
"gateway_id": 1,
}
]
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"links": {
"payments.account": "https://www.bookingsync.com/api/v3/accounts/{payments.account}",
"payments.payment_gateway": "https://www.bookingsync.com/api/v3/payment_gateways/{payments.payment_gateway}",
"payments.bookings": "https://www.bookingsync.com/api/v3/bookings/{payments.bookings}",
"payments.bookings_payments": "https://www.bookingsync.com/api/v3/bookings_payments/{payments.bookings_payments}"
},
"payments": [
{
"links": {
"account": 33,
"payment_gateway": 1,
"bookings": [
21
],
Expand Down Expand Up @@ -39,7 +41,8 @@
"zip": "07671-8254",
"city": "East Winifred",
"state": "Monatana",
"country_code": "US"
"country_code": "US",
"credit_card_token": "credit_card_token"
}
]
}
3 changes: 2 additions & 1 deletion api_calls/reference/payments/update-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"zip": "07671-8254",
"city": "East Winifred",
"state": "Monatana",
"country_code": "US"
"country_code": "US",
"gateway_id": 1,
}
]
}
110 changes: 110 additions & 0 deletions content/reference/endpoints/payment_gateways.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Payment Gateways

1. TOC
{:toc}

### Parameters
<ul class="nav nav-pills" role="tablist">
<li class="disabled"><a>OAuth Scopes:</a></li>
<li class="preferences_payments_read"><a href="#public" role="tab" data-toggle="pill">preferences_payments_read</a></li>
<li><a href="#preferences_payments_write" role="tab" data-toggle="pill">preferences_payments_write</a></li>
</ul>
<div class="tab-content" markdown="1">
<div class="tab-pane active" id="preferences_payments_write" markdown="1">
Name | Type | Read/Write | Description
------------------------------|---------|------------|------------
id | Integer | Read | Payment Gateway's id.
account_id | Integer | Read | Account id related to the payment gateway.
gateway_name | String | Write | Name of the gateway. Accepted gateways:authorize_net, blue_pay, bogus, braintree, moneris, moneris_us, ogone, omise, paybox_direct, paybox_direct_plus, paymill, paypal, paypal_ca, quickpay, sage, stripe, vacaypay, wepay
credentials | Array | Write | List of credentials. accepted keys: login, password, merchant_id, public_key, private_key, user, signature, signature_encryptor, secret_key, account_id, api_login, api_key, account_uuid, publishable_key, client_id, access_token
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should whitelist that, it's quite unstable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitelist what?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitelist all credentials

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what do you suggest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe just add a comment that this is payment-gateway dependent and likely to change.

supported_cardtypes | Array | Write | List of supported card types. Accepted types depend on the gateway.
supported_currencies | Array | Write | List of supported currencies.
test | Boolean | Write | Set it true if payment gateway is used for testing.
tokenize_credit_card_details | Boolean | Write | If true payments will store tokenized cc data when possible (depends on gateway).
name | String | Write | Name of the payment gateway.
created_at | [Time](/reference/enums#formats) | Read | Payment Gateway's create time.
updated_at | [Time](/reference/enums#formats) | Read | Payment Gateway's update time.
{: class="table table-bordered"}
</div>
<div class="tab-pane active" id="preferences_payments_read" markdown="1">
Name | Type | Read/Write | Description
------------------------------|---------|------------|------------
id | Integer | Read | Payment Gateway's id.
account_id | Integer | Read | Account id related to the payment gateway.
gateway_name | String | Read | Name of the gateway. Accepted gateways:authorize_net, blue_pay, bogus, braintree, moneris, moneris_us, ogone, omise, paybox_direct, paybox_direct_plus, paymill, paypal, paypal_ca, payu_latam, quickpay, sage, stripe, vacaypay, wepay
credentials | Array | Read | List of credentials. accepted keys: login, password, merchant_id, public_key, private_key, user, signature, signature_encryptor, secret_key, account_id, api_login, api_key, account_uuid, publishable_key, client_id, access_token
supported_cardtypes | Array | Read | List of supported card types. Accepted types depend on the gateway.
supported_currencies | Array | Read | List of supported currencies.
test | Boolean | Read | Set it true if payment gateway is used for testing.
tokenize_credit_card_details | Boolean | Read | If true payments will store tokenized cc data when possible (depends on gateway).
name | String | Read | Name of the payment gateway.
created_at | [Time](/reference/enums#formats) | Read | Payment Gateway's create time.
updated_at | [Time](/reference/enums#formats) | Read | Payment Gateway's update time.
{: class="table table-bordered"}
</div>
</div>

## List payment_gateways

Scope | Read Permissions
-------------------------|------------
`:preferences_payments_read` | Display all payment_gateways for current account(s)
`:preferences_payments_write` | Display all payment_gateways for current account(s)
{: class="table table-bordered"}

Returns a list of all payment_gateways for current account(s).

~~~
GET /payment_gateways
~~~

<%= render 'json_response', endpoint: "payment_gateways",
scopes: %w(preferences_payments_read-preferences_payments_write) %>

## Get a single payment_gateway

Returns a single payment_gateway identified by ID

~~~
GET /payment_gateways/:payment_gateway_id
~~~

<%= render 'json_response', endpoint: "payment_gateways",
scopes: %w(preferences_payments_read-preferences_payments_write) %>

## Create a new payment_gateway

<div class="callout callout-info" markdown="1">
<h4>Supported card types</h4>
At least one supported card type must be given.
</div>

Creates a payment_gateway for your account.

~~~~
POST /payment_gateways
~~~~

<%= render 'json_response', endpoint: "payment_gateways", request: "create",
scopes: %w(preferences_payments_write) %>

## Update a payment_gateway

Returns an updated payment_gateway identified by ID.

~~~
PUT /payment_gateways/:payment_gateway_id
~~~

<%= render 'json_response', endpoint: "payment_gateways", request: "update",
scopes: [ {preferences_payments_write: "preferences_payments_write" }] %>

## Destroy a payment_gateway

Required OAuth scope: `:preferences_payments_write`

Returns an empty response with '204 No Content' status code on success.

~~~~~~
DELETE /payment_gateways/:payment_gateway_id
~~~~~~