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

feat: downgrade transbank api version #266

Merged
merged 34 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
028d9b5
feat: remove api 1.3 deferred capture methods on webpay plus transaction
isabellaahc Nov 16, 2023
1e47107
feat: remove api 1.3 deferred capture methods on webpay plus mall tra…
isabellaahc Nov 16, 2023
92ff153
refactor: delete reverse preauthorized amount response file
isabellaahc Nov 16, 2023
e562a00
refactor: delete deferred capture history response file
isabellaahc Nov 16, 2023
3246f38
refactor: delete increase amount response file
isabellaahc Nov 16, 2023
5505635
refactor: delete increase authorization date response file
isabellaahc Nov 16, 2023
ffd047e
refactor: delete mall reverse preauthorized amount response file
isabellaahc Nov 16, 2023
88a9407
refactor: delete mall deferred capture history response file
isabellaahc Nov 16, 2023
8f43beb
refactor: delete mall increase amount response file
isabellaahc Nov 16, 2023
fd00462
refactor: delete mall increase authorization date response file
isabellaahc Nov 16, 2023
88b7fe1
feat: remove api 1.3 deferred capture methods on oneclick mall transa…
isabellaahc Nov 16, 2023
91000ae
refactor: delete oneclick mall deferred capture history response file
isabellaahc Nov 16, 2023
6a7b2b9
refactor: delete oneclick mall increase amount response file
isabellaahc Nov 16, 2023
d9aadc6
refactor: delete oneclick mall increase authorization date response file
isabellaahc Nov 16, 2023
c3be6d2
refactor: delete oneclick mall reverse preauthorized amount response …
isabellaahc Nov 16, 2023
cd0b6f4
refactor: delete reverse preauthorized amount exception file
isabellaahc Nov 16, 2023
04df3fa
refactor: delete mall reverse preauthorized amount exception file
isabellaahc Nov 16, 2023
4e33ded
refactor: delete mall increase authorization date exception file
isabellaahc Nov 16, 2023
fbaf617
refactor: delete increase authorization date exception file
isabellaahc Nov 16, 2023
4646670
refactor: delete increase amount exception file
isabellaahc Nov 16, 2023
ea47329
refactor: delete mall increase amount exception file
isabellaahc Nov 16, 2023
ce89643
refactor: delete deferred capture history exception file
isabellaahc Nov 16, 2023
8ef0171
refactor: delete mall deferred capture history exception file
isabellaahc Nov 16, 2023
e0437b1
feat: remove api 1.3 deferred capture methods on full transaction
isabellaahc Nov 17, 2023
bf2369d
feat: remove api 1.3 deferred capture methods on mall full transaction
isabellaahc Nov 17, 2023
f155f02
refactor: delete common base deferred capture history file
isabellaahc Nov 17, 2023
8474d22
refactor: delete common base deferred history details file
isabellaahc Nov 17, 2023
d222d63
feat: update api version to webpay plus endpoints
isabellaahc Nov 17, 2023
24e210b
feat: update api version to webpay plus mall endpoints
isabellaahc Nov 17, 2023
0ac1e60
feat: update api version to oneclick mall transaction endpoints
isabellaahc Nov 17, 2023
5bf16eb
feat: update api version to oneclick mall inscription endpoints
isabellaahc Nov 17, 2023
8f1ba9d
feat: update api version to full transaction endpoints
isabellaahc Nov 17, 2023
2f7bf3b
feat: update api version to mall full transaction endpoints
isabellaahc Nov 17, 2023
34eafa0
refactor: remove api 1.3 full transaction responses file
isabellaahc Nov 20, 2023
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
19 changes: 0 additions & 19 deletions src/Common/Responses/BaseDeferredCaptureHistoryResponse.php

This file was deleted.

50 changes: 0 additions & 50 deletions src/Common/Responses/HistoryDetails.php

This file was deleted.

147 changes: 6 additions & 141 deletions src/TransaccionCompleta/MallTransaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ class MallTransaction
{
use InteractsWithWebpayApi;

const ENDPOINT_CREATE = 'rswebpaytransaction/api/webpay/v1.3/transactions';
const ENDPOINT_INSTALLMENTS = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/installments';
const ENDPOINT_COMMIT = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}';
const ENDPOINT_REFUND = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/refunds';
const ENDPOINT_STATUS = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}';
const ENDPOINT_CAPTURE = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/capture';
const ENDPOINT_INCREASE_AMOUNT = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/amount';
const ENDPOINT_INCREASE_AUTHORIZATION_DATE = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/authorization_date';
const ENDPOINT_REVERSE_PRE_AUTHORIZE_AMOUNT = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/reverse/amount';
const ENDPOINT_DEFERRED_CAPTURE_HISTORY = 'rswebpaytransaction/api/webpay/v1.3/transactions/{token}/details';
const ENDPOINT_CREATE = 'rswebpaytransaction/api/webpay/v1.2/transactions';
const ENDPOINT_INSTALLMENTS = 'rswebpaytransaction/api/webpay/v1.2/transactions/{token}/installments';
const ENDPOINT_COMMIT = 'rswebpaytransaction/api/webpay/v1.2/transactions/{token}';
const ENDPOINT_REFUND = 'rswebpaytransaction/api/webpay/v1.2/transactions/{token}/refunds';
const ENDPOINT_STATUS = 'rswebpaytransaction/api/webpay/v1.2/transactions/{token}';
const ENDPOINT_CAPTURE = 'rswebpaytransaction/api/webpay/v1.2/transactions/{token}/capture';

public function create(
$buyOrder,
Expand Down Expand Up @@ -183,137 +179,6 @@ public function capture($token, $commerceCode, $buyOrder, $authorizationCode, $c
return new Responses\MallTransactionCaptureResponse($response);
}

/**
* @param $token
* @param $buyOrder
* @param $authorizationCode
* @param $amount
* @param $commerceCode
*
* @throws MallIncreaseAmountException
* @throws GuzzleException
*
* @return MallIncreaseAmountResponse
*/
public function increaseAmount($token, $buyOrder, $authorizationCode, $amount, $commerceCode)
{
$payload = [
'buy_order' => $buyOrder,
'authorization_code' => $authorizationCode,
'amount' => $amount,
'commerce_code' => $commerceCode,
];

try {
$response = $this->sendRequest(
'PUT',
str_replace('{token}', $token, static::ENDPOINT_INCREASE_AMOUNT),
$payload
);
} catch (WebpayRequestException $e) {
throw MallIncreaseAmountException::raise($e);
}

return new MallIncreaseAmountResponse($response);
}

/**
* @param $token
* @param $buyOrder
* @param $authorizationCode
* @param $commerceCode
*
* @throws MallIncreaseAuthorizationDateException
* @throws GuzzleException
*
* @return MallIncreaseAuthorizationDateResponse
*/
public function increaseAuthorizationDate($token, $buyOrder, $authorizationCode, $commerceCode)
{
$payload = [
'buy_order' => $buyOrder,
'authorization_code' => $authorizationCode,
'commerce_code' => $commerceCode,
];

try {
$response = $this->sendRequest(
'PUT',
str_replace('{token}', $token, static::ENDPOINT_INCREASE_AUTHORIZATION_DATE),
$payload
);
} catch (WebpayRequestException $e) {
throw MallIncreaseAuthorizationDateException::raise($e);
}

return new MallIncreaseAuthorizationDateResponse($response);
}

/**
* @param $token
* @param $buyOrder
* @param $authorizationCode
* @param $amount
* @param $commerceCode
*
* @throws MallReversePreAuthorizedAmountException
* @throws GuzzleException
*
* @return MallReversePreAuthorizedAmountResponse
*/
public function reversePreAuthorizedAmount($token, $buyOrder, $authorizationCode, $amount, $commerceCode)
{
$payload = [
'buy_order' => $buyOrder,
'authorization_code' => $authorizationCode,
'amount' => $amount,
'commerce_code' => $commerceCode,
];

try {
$response = $this->sendRequest(
'PUT',
str_replace('{token}', $token, static::ENDPOINT_REVERSE_PRE_AUTHORIZE_AMOUNT),
$payload
);
} catch (WebpayRequestException $e) {
throw MallReversePreAuthorizedAmountException::raise($e);
}

return new MallReversePreAuthorizedAmountResponse($response);
}

/**
* @param $token
* @param $buyOrder
* @param $commerceCode
*
* @throws MallDeferredCaptureHistoryException
* @throws GuzzleException
*
* @return MallDeferredCaptureHistoryResponse
*/
public function deferredCaptureHistory($token, $buyOrder, $commerceCode)
{
$payload = [
'buy_order' => $buyOrder,
'commerce_code' => $commerceCode,
];

try {
$response = $this->sendRequest(
'POST',
str_replace('{token}', $token, static::ENDPOINT_DEFERRED_CAPTURE_HISTORY),
$payload
);
var_dump($response);
} catch (WebpayRequestException $e) {
throw MallDeferredCaptureHistoryException::raise($e);
}

return new MallDeferredCaptureHistoryResponse($response);
}

public static function getDefaultOptions()
{
return Options::forIntegration(TransaccionCompleta::DEFAULT_MALL_COMMERCE_CODE);
Expand Down

This file was deleted.

9 changes: 0 additions & 9 deletions src/TransaccionCompleta/Responses/IncreaseAmountResponse.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading