Skip to content

Commit

Permalink
Merge pull request #78 from Judopay/JR-6621-Guzzle7
Browse files Browse the repository at this point in the history
Jr-6621 : Support HTTP Client Guzzle7 (as well as previous Guzzle6)
  • Loading branch information
Stuart-Baillie authored Oct 7, 2022
2 parents d8ebd40 + 8a0549d commit 58ea75b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
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

0 comments on commit 58ea75b

Please sign in to comment.