Skip to content

Commit

Permalink
Release 4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wallee-deployment-user committed May 14, 2024
1 parent b193efa commit 7d880d3
Show file tree
Hide file tree
Showing 55 changed files with 571 additions and 614 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wallee/sdk",
"version": "4.1.0",
"version": "4.2.0",
"description": "wallee SDK for PHP",
"keywords": [
"wallee",
Expand Down
4 changes: 2 additions & 2 deletions lib/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class ApiClient {
* @var array
*/
private $defaultHeaders = [
'x-meta-sdk-version' => "4.1.0",
'x-meta-sdk-version' => "4.2.0",
'x-meta-sdk-language' => 'php',
'x-meta-sdk-provider' => "wallee",
];
Expand All @@ -58,7 +58,7 @@ final class ApiClient {
*
* @var string
*/
private $userAgent = 'PHP-Client/4.1.0/php';
private $userAgent = 'PHP-Client/4.2.0/php';

/**
* The path to the certificate authority file.
Expand Down
6 changes: 3 additions & 3 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'Wallee\Sdk/4.1.0/php';
protected $userAgent = 'Wallee\Sdk/4.2.0/php';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -388,8 +388,8 @@ public static function toDebugReport()
$report = 'PHP SDK (Wallee\Sdk) Debug Report:' . PHP_EOL;
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' OpenAPI Spec Version: 4.1.0' . PHP_EOL;
$report .= ' SDK Package Version: 4.1.0' . PHP_EOL;
$report .= ' OpenAPI Spec Version: 4.2.0' . PHP_EOL;
$report .= ' SDK Package Version: 4.2.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
26 changes: 24 additions & 2 deletions lib/Http/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public function isSupported() {

public function send(ApiClient $apiClient, HttpRequest $request) {
$curl = curl_init();

$tempCAFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "wallee-ca-bundle.crt";

// set timeout, if needed
if ($request->getTimeOut() !== 0) {
curl_setopt($curl, CURLOPT_TIMEOUT, $request->getTimeOut());
Expand All @@ -58,7 +61,11 @@ public function send(ApiClient $apiClient, HttpRequest $request) {
} else {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curl, CURLOPT_CAINFO, $apiClient->getCertificateAuthority());
if (file_exists($tempCAFile)) {
// use the temporal CA Bundle if it was set, which indicates a previous error.
$apiClient->setCertificateAuthority($tempCAFile);
curl_setopt($curl, CURLOPT_CAINFO, $apiClient->getCertificateAuthority());
}
}

if ($request->getMethod() === HttpRequest::POST) {
Expand Down Expand Up @@ -102,7 +109,22 @@ public function send(ApiClient $apiClient, HttpRequest $request) {

// Make the request
$response = curl_exec($curl);
$response = $this->handleResponse($apiClient, $request, $curl, $response, $request->getUrl());
if ($response) {
$response = $this->handleResponse($apiClient, $request, $curl, $response, $request->getUrl());
} else {
// if there was an error, try again with the CA bundle provided by this SDK.
if (!file_exists($tempCAFile)) {
$caContent = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "ca-bundle.crt");
file_put_contents($tempCAFile, $caContent);

// Try again the request, this time with the CA bundle provided by this SDK.
$apiClient->setCertificateAuthority($tempCAFile);
curl_setopt($curl, CURLOPT_CAINFO, $apiClient->getCertificateAuthority());
$response = curl_exec($curl);
$response = $this->handleResponse($apiClient, $request, $curl, $response, $request->getUrl());
}
}

curl_close($curl);
fclose($debugFilePointer);

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/AbstractDebtCollectionCaseUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function getSpaceViewId()
/**
* Sets space_view_id
*
* @param int $space_view_id
* @param int $space_view_id The ID of the space view this object is linked to.
*
* @return $this
*/
Expand Down
10 changes: 5 additions & 5 deletions lib/Model/AbstractTokenUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function getCustomerEmailAddress()
/**
* Sets customer_email_address
*
* @param string $customer_email_address The customer email address is the email address of the customer.
* @param string $customer_email_address The customer's email address.
*
* @return $this
*/
Expand Down Expand Up @@ -284,7 +284,7 @@ public function getCustomerId()
/**
* Sets customer_id
*
* @param string $customer_id The customer ID identifies the customer in the merchant system. In case the customer ID has been provided it has to correspond with the customer ID provided on the transaction. The customer ID will not be changed automatically. The merchant system has to provide it.
* @param string $customer_id The unique identifier of the customer in the external system.
*
* @return $this
*/
Expand All @@ -309,7 +309,7 @@ public function getEnabledForOneClickPayment()
/**
* Sets enabled_for_one_click_payment
*
* @param bool $enabled_for_one_click_payment When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments.
* @param bool $enabled_for_one_click_payment Whether the token is enabled for one-click payments, which simplify the payment process for the customer. One-click tokens are linked to customers via the customer ID.
*
* @return $this
*/
Expand Down Expand Up @@ -359,7 +359,7 @@ public function getTimeZone()
/**
* Sets time_zone
*
* @param string $time_zone The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer.
* @param string $time_zone The customer's time zone, which affects how dates and times are formatted when communicating with the customer.
*
* @return $this
*/
Expand All @@ -384,7 +384,7 @@ public function getTokenReference()
/**
* Sets token_reference
*
* @param string $token_reference Use something that it is easy to identify and may help you find the token (e.g. customer id, email address).
* @param string $token_reference The reference used to identify the payment token (e.g. the customer's ID or email address).
*
* @return $this
*/
Expand Down
34 changes: 17 additions & 17 deletions lib/Model/AbstractTransactionPending.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function getAllowedPaymentMethodBrands()
/**
* Sets allowed_payment_method_brands
*
* @param int[] $allowed_payment_method_brands
* @param int[] $allowed_payment_method_brands The payment method brands that can be used to authorize the transaction.
*
* @return $this
*/
Expand All @@ -395,7 +395,7 @@ public function getAllowedPaymentMethodConfigurations()
/**
* Sets allowed_payment_method_configurations
*
* @param int[] $allowed_payment_method_configurations
* @param int[] $allowed_payment_method_configurations The payment method configurations that can be used to authorize the transaction.
*
* @return $this
*/
Expand All @@ -420,7 +420,7 @@ public function getBillingAddress()
/**
* Sets billing_address
*
* @param \Wallee\Sdk\Model\AddressCreate $billing_address
* @param \Wallee\Sdk\Model\AddressCreate $billing_address The address associated with the payment method for invoicing and transaction processing purposes.
*
* @return $this
*/
Expand All @@ -445,7 +445,7 @@ public function getCompletionBehavior()
/**
* Sets completion_behavior
*
* @param \Wallee\Sdk\Model\TransactionCompletionBehavior $completion_behavior The completion behavior controls when the transaction is completed.
* @param \Wallee\Sdk\Model\TransactionCompletionBehavior $completion_behavior The behavior that controls when the transaction is completed.
*
* @return $this
*/
Expand All @@ -470,7 +470,7 @@ public function getCurrency()
/**
* Sets currency
*
* @param string $currency
* @param string $currency The three-letter code (ISO 4217 format) of the transaction's currency.
*
* @return $this
*/
Expand All @@ -495,7 +495,7 @@ public function getCustomerEmailAddress()
/**
* Sets customer_email_address
*
* @param string $customer_email_address The customer email address is the email address of the customer. If no email address is provided on the shipping or billing address this address is used.
* @param string $customer_email_address The customer's email address.
*
* @return $this
*/
Expand Down Expand Up @@ -524,7 +524,7 @@ public function getCustomerId()
/**
* Sets customer_id
*
* @param string $customer_id
* @param string $customer_id The unique identifier of the customer in the external system.
*
* @return $this
*/
Expand All @@ -549,7 +549,7 @@ public function getFailedUrl()
/**
* Sets failed_url
*
* @param string $failed_url The user will be redirected to failed URL when the transaction could not be authorized or completed. In case no failed URL is specified a default failed page will be displayed.
* @param string $failed_url The URL to redirect the customer back to after they canceled or failed to authenticated their payment.
*
* @return $this
*/
Expand Down Expand Up @@ -581,7 +581,7 @@ public function getInvoiceMerchantReference()
/**
* Sets invoice_merchant_reference
*
* @param string $invoice_merchant_reference
* @param string $invoice_merchant_reference The merchant's reference used to identify the invoice.
*
* @return $this
*/
Expand Down Expand Up @@ -635,7 +635,7 @@ public function getLineItems()
/**
* Sets line_items
*
* @param \Wallee\Sdk\Model\LineItemCreate[] $line_items
* @param \Wallee\Sdk\Model\LineItemCreate[] $line_items The line items purchased by the customer.
*
* @return $this
*/
Expand All @@ -660,7 +660,7 @@ public function getMerchantReference()
/**
* Sets merchant_reference
*
* @param string $merchant_reference
* @param string $merchant_reference The merchant's reference used to identify the transaction.
*
* @return $this
*/
Expand Down Expand Up @@ -714,7 +714,7 @@ public function getShippingAddress()
/**
* Sets shipping_address
*
* @param \Wallee\Sdk\Model\AddressCreate $shipping_address
* @param \Wallee\Sdk\Model\AddressCreate $shipping_address The address to where the order will be shipped.
*
* @return $this
*/
Expand All @@ -739,7 +739,7 @@ public function getShippingMethod()
/**
* Sets shipping_method
*
* @param string $shipping_method
* @param string $shipping_method The name of the shipping method used to ship the products.
*
* @return $this
*/
Expand Down Expand Up @@ -768,7 +768,7 @@ public function getSuccessUrl()
/**
* Sets success_url
*
* @param string $success_url The user will be redirected to success URL when the transaction could be authorized or completed. In case no success URL is specified a default success page will be displayed.
* @param string $success_url The URL to redirect the customer back to after they successfully authenticated their payment.
*
* @return $this
*/
Expand Down Expand Up @@ -800,7 +800,7 @@ public function getTimeZone()
/**
* Sets time_zone
*
* @param string $time_zone The time zone defines in which time zone the customer is located in. The time zone may affects how dates are formatted when interacting with the customer.
* @param string $time_zone The customer's time zone, which affects how dates and times are formatted when communicating with the customer.
*
* @return $this
*/
Expand All @@ -825,7 +825,7 @@ public function getToken()
/**
* Sets token
*
* @param int $token
* @param int $token The payment token that should be used to charge the customer.
*
* @return $this
*/
Expand All @@ -850,7 +850,7 @@ public function getTokenizationMode()
/**
* Sets tokenization_mode
*
* @param \Wallee\Sdk\Model\TokenizationMode $tokenization_mode The tokenization mode controls if and how the tokenization of payment information is applied to the transaction.
* @param \Wallee\Sdk\Model\TokenizationMode $tokenization_mode The tokenization mode specifies whether and how the tokenization of payment information is applied to the transaction.
*
* @return $this
*/
Expand Down
32 changes: 32 additions & 0 deletions lib/Model/AbstractWebhookListenerUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $swaggerTypes = [
'enable_payload_signature_and_state' => 'bool',
'entity_states' => 'string[]',
'name' => 'string',
'notify_every_change' => 'bool',
Expand All @@ -60,6 +61,7 @@ class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $swaggerFormats = [
'enable_payload_signature_and_state' => null,
'entity_states' => null,
'name' => null,
'notify_every_change' => null,
Expand All @@ -73,6 +75,7 @@ class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $attributeMap = [
'enable_payload_signature_and_state' => 'enablePayloadSignatureAndState',
'entity_states' => 'entityStates',
'name' => 'name',
'notify_every_change' => 'notifyEveryChange',
Expand All @@ -85,6 +88,7 @@ class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $setters = [
'enable_payload_signature_and_state' => 'setEnablePayloadSignatureAndState',
'entity_states' => 'setEntityStates',
'name' => 'setName',
'notify_every_change' => 'setNotifyEveryChange',
Expand All @@ -97,6 +101,7 @@ class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $getters = [
'enable_payload_signature_and_state' => 'getEnablePayloadSignatureAndState',
'entity_states' => 'getEntityStates',
'name' => 'getName',
'notify_every_change' => 'getNotifyEveryChange',
Expand All @@ -121,6 +126,8 @@ class AbstractWebhookListenerUpdate implements ModelInterface, ArrayAccess
public function __construct(array $data = null)
{

$this->container['enable_payload_signature_and_state'] = isset($data['enable_payload_signature_and_state']) ? $data['enable_payload_signature_and_state'] : null;

$this->container['entity_states'] = isset($data['entity_states']) ? $data['entity_states'] : null;

$this->container['name'] = isset($data['name']) ? $data['name'] : null;
Expand Down Expand Up @@ -224,6 +231,31 @@ public function valid()



/**
* Gets enable_payload_signature_and_state
*
* @return bool
*/
public function getEnablePayloadSignatureAndState()
{
return $this->container['enable_payload_signature_and_state'];
}

/**
* Sets enable_payload_signature_and_state
*
* @param bool $enable_payload_signature_and_state Whether signature header and state property are enabled in webhook payload.
*
* @return $this
*/
public function setEnablePayloadSignatureAndState($enable_payload_signature_and_state)
{
$this->container['enable_payload_signature_and_state'] = $enable_payload_signature_and_state;

return $this;
}


/**
* Gets entity_states
*
Expand Down
Loading

0 comments on commit 7d880d3

Please sign in to comment.