Skip to content
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

Jr-6621 : Support HTTP Client Guzzle7 (as well as previous Guzzle6) #78

Merged
merged 4 commits into from
Oct 7, 2022
Merged
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ To make a new payment with full card details:
```
**Note:** Please make sure that you are using a unique Consumer Reference for each different consumer, and a unique Payment Reference for each transaction.

Card address details can optionally be included for use in AVS checks as follows, (see full list of parameters [here](https://docs.judopay.com/#register-a-card))
Card address details can optionally be included for use in AVS checks as follows, (see full list of parameters [here](https://docs.judopay.com/Content/Server%20SDKs/Server%20SDKs_1.htm#Server))

```php
$payment = $judopay->getModel('Payment');
Expand All @@ -73,14 +73,14 @@ Card address details can optionally be included for use in AVS checks as follows
);
```

You can check on the required fields and the format of each field in the [Judopay REST API reference](https://docs.judopay.com/api/index.html).
You can check on the required fields and the format of each field in the [Judopay REST API reference](https://docs.judopay.com/api-reference/index.html).
To send the request to the API, call:
```php
$response = $payment->create();
```

##### 4. Check the payment result
If the payment is successful, you'll receive a response array like this (see full response [here](https://docs.judopay.com/#card-payment)):
If the payment is successful, you'll receive a response array like this (see full response [here](https://docs.judopay.com/Content/Server%20SDKs/Server%20SDKs_1.htm#Server)):
```php
Array
(
Expand All @@ -94,7 +94,7 @@ If the payment is successful, you'll receive a response array like this (see ful
[yourPaymentReference] => 12345
)
```
Also important to handle different exceptions in your code. See more details in our [error handling section](https://github.com/JudoPay/PhpSdk/wiki/Error-handling).
Also important to handle different exceptions in your code. See more details in our [error handling section](https://docs.judopay.com/Content/Sandbox%20Testing/Test%20Scenarios.htm).
```php
try {
$response = $payment->create();
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"repositories": [],
"require": {
"php": ">=5.5",
"guzzlehttp/guzzle": "~6.0",
"guzzlehttp/guzzle": "~6.0 | ^7.0",
"pimple/pimple": "~3.0",
"psr/log": "^1.0",
"ext-openssl": ">=0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion spec/SpecHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static function getFixtureResponse($responseCode, $fixtureFile = null)
$fixtureContent = file_get_contents(__DIR__.'/fixtures/'.$fixtureFile);
}

$stream = Psr7\stream_for($fixtureContent);
$stream = Psr7\Utils::streamFor($fixtureContent);

$mockResponse = new Response(
$responseCode, // statusCode
Expand Down
3 changes: 2 additions & 1 deletion tests/ThreeDSecureTwoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ public function testPaymentWithThreeDSecureTwoNoDeviceDetailsOrChallenge()
{
// Build a threeDSecureTwo payment
$threeDSecureTwo = array(
'authenticationSource' => "Browser"
'authenticationSource' => "Browser",
'challengeRequestIndicator' => "NoPreference"
);

// Using a cardholder name that results in no device details or challenge call
Expand Down