Skip to content

Commit

Permalink
Merge pull request #55 from ahilles107/update_dependencies
Browse files Browse the repository at this point in the history
update dependencies
  • Loading branch information
ahilles107 committed Jul 23, 2019
2 parents 2385d6f + 51ca384 commit 1307515
Show file tree
Hide file tree
Showing 13 changed files with 2,067 additions and 1,269 deletions.
4 changes: 2 additions & 2 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ fos_rest:
- { path: '^/', stop: true }

lexik_jwt_authentication:
private_key_path: '%jwt_private_key_path%'
public_key_path: '%jwt_public_key_path%'
private_key_path: '%jwt_private_key_path%'
public_key_path: '%jwt_public_key_path%'
pass_phrase: '%jwt_key_pass_phrase%'
token_ttl: '%jwt_token_ttl%'

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"php": ">=7.1",
"doctrine/doctrine-bundle": "^1.6.7",
"doctrine/doctrine-migrations-bundle": "1.2.1",
"doctrine/orm": "v2.5.6",
"doctrine/orm": "2.6.*",
"incenteev/composer-parameter-handler": "^2.0",
"lexik/jwt-authentication-bundle": "^2.4",
"nelmio/cors-bundle": "^1.5@dev",
Expand Down
3,277 changes: 2,012 additions & 1,265 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions features/api/payments/editing_payment_method.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Feature: Editing existing payment methods
"""
Then the response status code should be 204
And the response should be empty
Given I am authenticated as "admin"
Given I am want to get JSON
Then I send a "GET" request to "/api/v1/payment-methods/off"
And the header "Content-Type" should be equal to "application/json"
And the JSON nodes should contain:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: Getting a single subscription
Given I am authenticated as "admin"

Scenario: Get a single subscription
Given I am want to get JSON
Given the system has a payment method "Offline" with a code "cash_on_delivery"
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
Expand All @@ -24,6 +25,9 @@ Feature: Getting a single subscription
}
}
"""

Given I am authenticated as "admin"
Given I am want to get JSON
And I add "Accept" header equal to "application/json"
When I am on "/api/v1/subscriptions/1"
Then the response status code should be 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Prevent creating a new subscription if the gateway's config of a paymen

Scenario: Validate the subscription's amount field based on the payment method's gateway configuration
Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/payment-methods/new/paypal_express_checkout" with body:
Expand Down Expand Up @@ -34,6 +35,9 @@ Feature: Prevent creating a new subscription if the gateway's config of a paymen
}
"""
Then the response status code should be 201

Given I am authenticated as "admin"
Given I am want to get JSON
And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/subscriptions/" with body:
Expand All @@ -50,6 +54,9 @@ Feature: Prevent creating a new subscription if the gateway's config of a paymen
And the header "Content-Type" should be equal to "application/json"
And the JSON nodes should contain:
| errors.children.amount.errors[0] | This value should be 1 or more. |

Given I am authenticated as "admin"
Given I am want to get JSON
And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/subscriptions/" with body:
Expand All @@ -66,6 +73,9 @@ Feature: Prevent creating a new subscription if the gateway's config of a paymen
And the header "Content-Type" should be equal to "application/json"
And the JSON nodes should contain:
| errors.children.amount.errors[0] | This value should be 5 or less. |

Given I am authenticated as "admin"
Given I am want to get JSON
And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/subscriptions/" with body:
Expand Down
4 changes: 4 additions & 0 deletions features/api/webhooks/deleting_webhook.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Deleting existing webhook

Scenario: Delete a single webhook by id
Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/webhooks/" with body:
Expand All @@ -17,6 +18,9 @@ Feature: Deleting existing webhook
"""
Then the response status code should be 201
And the response should be in JSON

Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "DELETE" request to "/api/v1/webhooks/1"
Expand Down
7 changes: 7 additions & 0 deletions features/api/webhooks/editing_webhook.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Editing existing webhook

Scenario: Edit a single webhook by id
Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/webhooks/" with body:
Expand All @@ -17,6 +18,9 @@ Feature: Editing existing webhook
"""
Then the response status code should be 201
And the response should be in JSON

Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "PATCH" request to "/api/v1/webhooks/1" with body:
Expand All @@ -27,6 +31,9 @@ Feature: Editing existing webhook
"""
Then the response status code should be 204
And the response should be empty

Given I am authenticated as "admin"
Given I am want to get JSON
Then I send a "GET" request to "/api/v1/webhooks/1"
Then the response status code should be 200
And the response should be in JSON
Expand Down
4 changes: 4 additions & 0 deletions features/api/webhooks/getting_single_webhook.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Getting a single existing webhook

Scenario: Get a single webhook by id
Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/webhooks/" with body:
Expand All @@ -17,6 +18,9 @@ Feature: Getting a single existing webhook
"""
Then the response status code should be 201
And the response should be in JSON

Given I am authenticated as "admin"
Given I am want to get JSON
Then I send a "GET" request to "/api/v1/webhooks/1"
Then the response status code should be 200
And the response should be in JSON
Expand Down
4 changes: 4 additions & 0 deletions features/api/webhooks/listing_webhooks.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Listing webhooks

Scenario: List webhooks
Given I am authenticated as "admin"
Given I am want to get JSON
When I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "POST" request to "/api/v1/webhooks/" with body:
Expand All @@ -17,6 +18,9 @@ Feature: Listing webhooks
"""
Then the response status code should be 201
And the response should be in JSON

Given I am authenticated as "admin"
Given I am want to get JSON
And I send a "GET" request to "/api/v1/webhooks/"
Then the response status code should be 200
And the response should be in JSON
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,22 @@ Feature: Paying offline for a subscription
}
"""
Then the response status code should be 201

Then I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "GET" request to "/public-api/v1/subscriptions/12345abcde"
Then the response status code should be 200

And I send a "GET" request to "/public-api/v1/subscriptions/12345abcde/pay/"
Then the response status code should be 302
And I am authenticated as "admin"

Given I am authenticated as "admin"
Given I am want to get JSON
And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "PUT" request to "/api/v1/subscriptions/1/payments/1/complete"
Then the response status code should be 204

And I add "Content-Type" header equal to "application/json"
And I add "Accept" header equal to "application/json"
And I send a "GET" request to "/public-api/v1/subscriptions/12345abcde"
Expand Down
10 changes: 10 additions & 0 deletions features/bootstrap/RestJwtContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ public function iAmAuthenticatedAs(string $username)
$this->request->setHttpHeader('Authorization', 'Bearer '.$token);
}

/**
* @param string $username
*
* @Given I am want to get JSON
*/
public function iWantToGetJson()
{
$this->request->setHttpHeader('Accept', 'application/json');
}

/**
* @BeforeScenario
*/
Expand Down
1 change: 1 addition & 0 deletions src/PH/Bundle/CoreBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ph_api_subscription_payment_complete:
defaults:
_controller: sylius.controller.payment:applyStateMachineTransitionAction
_sylius:
csrf_protection: false
event: complete
repository:
method: findOneBySubscriptionId
Expand Down

0 comments on commit 1307515

Please sign in to comment.