diff --git a/CHANGELOG.md b/CHANGELOG.md index 6753aca..d7b641f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [0.0.1](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v0.0.6...v0.0.1) (2024-09-02) + +### Bug Fixes + +* fix: update version script to actually set the version ([9193d60c4e3f3160ef628c8e093573394a802bc4](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/commit/9193d60c4e3f3160ef628c8e093573394a802bc4)) + +### Features + +* feat: add apple pay transformer and tests ([110182da3735202d0d3ee2b6bde2f57739221d49](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/commit/110182da3735202d0d3ee2b6bde2f57739221d49)) + ## [0.0.1](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v0.0.5...v0.0.1) (2024-08-29) ## [0.0.1](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v0.0.4...v0.0.1) (2024-08-28) diff --git a/README.md b/README.md index d8852b9..a94ce6f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Welcome to the Ruby SDK for the PAYONE Commerce Platform! This repository contai ## Installation ```sh -gem install PCP-server-Ruby-SDK +gem install pcp-server-ruby-sdk ``` **[back to top](#table-of-contents)** @@ -60,12 +60,12 @@ communicator_configuration = PCPServerSDK::CommunicatorConfiguration.new( ) ``` -With the configuration you can create an API client for each reource you want to interact with. For example to create a commerce case you can use the `PCPServerSDK::Endpoints::`. +With the configuration you can create an API client for each reource you want to interact with. For example to create a commerce case you can use the `PCPServerSDK::Endpoints::CommerceCaseApiClient`. ```rb require 'pcp-server-ruby-sdk' -client = PCPServerSDK::Endpoints::.new(communicator_configuration) +client = PCPServerSDK::Endpoints::CommerceCaseApiClient.new(communicator_configuration) ``` All payloads and reponses are availabe as ruby classes within the `pcp-server-ruby-sdk` package. The serialization and deserialization is handled by the SDK internally. For example, to create an empty commerce case you can pass a `PCPServerSDK::Models::CreateCommerceCaseRequest` instance: @@ -92,12 +92,14 @@ For most [payment methods](https://docs.payone.com/pcp/commerce-platform-payment ### Apple Pay -When a client is successfully made a payment via ApplePay it receives a [ApplePayPayment](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment). This structure is accessible as the `ApplePayPayment` class. You can use the `ApplePayTransformer` to map an `ApplePayPayment` to a `MobilePaymentMethodSpecificInput` which can be used for payment executions or order requests. The transformer has a static method `transformApplePayPaymentToMobilePaymentMethodSpecificInput()` which takes an `ApplePayPayment` and returns a `MobilePaymentMethodSpecificInput`. The transformer does not check if the response is complete, if anything is missing the field will be set to `null`. +When a client is successfully made a payment via ApplePay it receives a [ApplePayPayment](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment). This structure is accessible as the `PCPServerSDK::Models::ApplePayPayment` class. You can use the `PCPServerSDK::Transformer::ApplePayTransformer` to map an `PCPServerSDK::Models::ApplePayPayment` to a `PCPServerSDK::Models::MobilePaymentMethodSpecificInput` which can be used for payment executions or order requests. The transformer has a static method `PCPServerSDK::Transformer::transformApplePayPaymentToMobilePaymentMethodSpecificInput` which takes an `PCPServerSDK::Models::ApplePayPayment` and returns a `PCPServerSDK::Models::MobilePaymentMethodSpecificInput`. The transformer does not check if the response is complete, if anything is missing the field will be set to `null`. ```rb require 'pcp-server-ruby-sdk' -# TODO +payment = PCPServerSDK::Models::ApplePayPayment.new(get_json_string_from_request_somehow) +# input is of type PCPServerSDK::Models::MobilePaymentMethodSpecificInput +input = PCPServerSDK::Transformer::transformApplePayPaymentToMobilePaymentMethodSpecificInput(payment) ``` **[back to top](#table-of-contents)** diff --git a/lib/PCP-server-Ruby-SDK/utils/server_meta_info.rb b/lib/PCP-server-Ruby-SDK/utils/server_meta_info.rb index 27b5ca5..1998636 100644 --- a/lib/PCP-server-Ruby-SDK/utils/server_meta_info.rb +++ b/lib/PCP-server-Ruby-SDK/utils/server_meta_info.rb @@ -9,7 +9,7 @@ class ServerMetaInfo def initialize(integrator = '') @platform_identifier = "#{RbConfig::CONFIG['host_os']}, ruby version is: #{RUBY_VERSION}" - @sdk_identifier = 'RubyServerSDK/v1.0.0' # Adjust version as needed + @sdk_identifier = "RubyServerSDK/v#{PCPServerSDK::VERSION}" # Adjust version as needed @sdk_creator = 'PAYONE GmbH' @integrator = integrator end diff --git a/lib/PCP-server-Ruby-SDK/version.rb b/lib/PCP-server-Ruby-SDK/version.rb index 4c567e1..9304243 100644 --- a/lib/PCP-server-Ruby-SDK/version.rb +++ b/lib/PCP-server-Ruby-SDK/version.rb @@ -1,4 +1,4 @@ module PCPServerSDK - VERSION = '0.0.6' + VERSION = '1.0.0' end diff --git a/package-lock.json b/package-lock.json index 4ab7142..0dadb77 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1069,6 +1069,23 @@ } } }, + "node_modules/git-semver-tags/node_modules/conventional-commits-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.0.0.tgz", + "integrity": "sha512-TbsINLp48XeMXR8EvGjTnKGsZqBemisPoyWESlpRyR8lif0lcwzqz+NMtYSj1ooF/WYjSuu7wX0CtdeeMEQAmA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "meow": "^13.0.0" + }, + "bin": { + "conventional-commits-parser": "dist/cli/index.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/global-directory": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-4.0.1.tgz", @@ -2006,6 +2023,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uglify-js": { "version": "3.19.2", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.2.tgz",