-
Notifications
You must be signed in to change notification settings - Fork 6
Gateway endpoint #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kaizencodes
wants to merge
3
commits into
master
Choose a base branch
from
gateway-endpoint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gateway endpoint #283
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| ] | ||
| } |
24 changes: 24 additions & 0 deletions
24
...payment_gateways/preferences_payments_read-preferences_payments_write-scope-response.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": { | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
api_calls/reference/payment_gateways/preferences_payments_write-scope-response.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": { | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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 | ||
| ~~~~~~ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitelist what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitelist all credentials
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.