digital-payments-sdk 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +33 -20
- data/lib/{shell_ev → shell_smart_pay_api}/api_helper.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/client.rb +4 -4
- data/lib/{shell_ev → shell_smart_pay_api}/configuration.rb +11 -8
- data/lib/{shell_ev → shell_smart_pay_api}/controllers/base_controller.rb +11 -11
- data/lib/shell_smart_pay_api/controllers/digital_payment_enablement_controller.rb +57 -0
- data/lib/{shell_ev → shell_smart_pay_api}/controllers/fueling_controller.rb +50 -49
- data/lib/{shell_ev → shell_smart_pay_api}/controllers/partner_notification_controller.rb +27 -27
- data/lib/{shell_ev → shell_smart_pay_api}/controllers/shell_api_platform_security_authentication_controller.rb +9 -9
- data/lib/{shell_ev → shell_smart_pay_api}/controllers/station_locator_controller.rb +22 -22
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/access_token_error_exception.rb +28 -16
- data/lib/shell_smart_pay_api/exceptions/api_exception.rb +21 -0
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/cancel_fueling_error_response_error_exception.rb +31 -17
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/mpp_acces_token_error_response_exception.rb +31 -17
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/payment_enablement_error_response_exception.rb +28 -16
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/station_locator_bad_request_exception.rb +30 -17
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/station_locator_forbidden_exception.rb +30 -17
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/station_locator_internal_server_error_exception.rb +30 -17
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/station_locator_not_found_exception.rb +30 -17
- data/lib/{shell_ev → shell_smart_pay_api}/exceptions/station_locator_unauthorized_exception.rb +30 -17
- data/lib/{shell_ev → shell_smart_pay_api}/http/auth/mpp_token.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/http/auth/o_auth_token_post.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/http/http_call_back.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/http/http_method_enum.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/http/http_request.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/http/http_response.rb +2 -2
- data/lib/{shell_ev → shell_smart_pay_api}/models/access_token_response.rb +17 -4
- data/lib/{shell_ev → shell_smart_pay_api}/models/around_location_array.rb +16 -4
- data/lib/shell_smart_pay_api/models/base_model.rb +110 -0
- data/lib/{shell_ev → shell_smart_pay_api}/models/cancel_fueling_error_response.rb +17 -5
- data/lib/{shell_ev → shell_smart_pay_api}/models/cancel_fueling_request.rb +16 -4
- data/lib/{shell_ev → shell_smart_pay_api}/models/collecting_company.rb +14 -2
- data/lib/{shell_ev/models/around_location_array_data_items.rb → shell_smart_pay_api/models/datum.rb} +78 -57
- data/lib/{shell_ev/models/fault_response_fault_detail.rb → shell_smart_pay_api/models/detail.rb} +17 -5
- data/lib/{shell_ev/models/prepare_fueling_request_device_details_items.rb → shell_smart_pay_api/models/device_detail.rb} +23 -11
- data/lib/{shell_ev/models/fault_response_fault.rb → shell_smart_pay_api/models/fault.rb} +21 -10
- data/lib/{shell_ev → shell_smart_pay_api}/models/fault_response.rb +16 -4
- data/lib/{shell_ev → shell_smart_pay_api}/models/finalise_fueling_request.rb +31 -18
- data/lib/{shell_ev/models/around_location_array_data_items_loc.rb → shell_smart_pay_api/models/loc.rb} +25 -15
- data/lib/{shell_ev → shell_smart_pay_api}/models/loyalty_details.rb +16 -4
- data/lib/{shell_ev → shell_smart_pay_api}/models/mobile_payment_registration_request.rb +22 -10
- data/lib/{shell_ev → shell_smart_pay_api}/models/mpp_acces_token_response.rb +18 -6
- data/lib/{shell_ev → shell_smart_pay_api}/models/mpp_error.rb +18 -7
- data/lib/{shell_ev/models/around_location_array_data_items_opening_hours_items.rb → shell_smart_pay_api/models/opening_hour.rb} +40 -24
- data/lib/{shell_ev/models/finalise_fueling_request_payment.rb → shell_smart_pay_api/models/payment.rb} +22 -10
- data/lib/{shell_ev/models/payment_details_items.rb → shell_smart_pay_api/models/payment_details.rb} +22 -9
- data/lib/{shell_ev → shell_smart_pay_api}/models/payment_enablement_response.rb +14 -2
- data/lib/{shell_ev → shell_smart_pay_api}/models/payment_properties.rb +24 -10
- data/lib/{shell_ev → shell_smart_pay_api}/models/prepare_fueling_request.rb +31 -24
- data/lib/{shell_ev → shell_smart_pay_api}/models/prepare_fueling_response.rb +16 -4
- data/lib/{shell_ev/models/finalise_fueling_request_products_items.rb → shell_smart_pay_api/models/product.rb} +22 -10
- data/lib/{shell_ev → shell_smart_pay_api}/utilities/date_time_helper.rb +2 -2
- data/lib/shell_smart_pay_api/utilities/file_wrapper.rb +28 -0
- data/lib/shell_smart_pay_api.rb +89 -0
- data/test/controllers/controller_test_base.rb +3 -3
- data/test/controllers/test_fueling_controller.rb +1 -1
- data/test/controllers/test_partner_notification_controller.rb +1 -1
- data/test/controllers/test_shell_api_platform_security_authentication_controller.rb +1 -1
- data/test/controllers/test_station_locator_controller.rb +1 -1
- data/test/http_response_catcher.rb +2 -2
- metadata +63 -72
- data/lib/shell_ev/controllers/digital_payment_enablement_controller.rb +0 -56
- data/lib/shell_ev/exceptions/api_exception.rb +0 -10
- data/lib/shell_ev/models/base_model.rb +0 -62
- data/lib/shell_ev/models/mpp_token_request_body.rb +0 -73
- data/lib/shell_ev/models/oauth_token_post_request_body.rb +0 -73
- data/lib/shell_ev/models/partner_token_request_body.rb +0 -73
- data/lib/shell_ev/utilities/file_wrapper.rb +0 -16
- data/lib/shell_ev.rb +0 -85
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34c4cd6df5faa1671b8e19b288ad4e0e9859811d48fd42ad503ff4d30af75e8f
|
4
|
+
data.tar.gz: b6e656ffdd51d0a5f344308b89c14b7330fd1a17258a7bbdb29fc47f06732aba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9e9be98628cc75dd8347dfe299f9e1818b8afe7ada6054c2488d95a3b7bca54e91b6fb48346f431b582553672d0e058d746c18902178687d7754d15e66d7c3f
|
7
|
+
data.tar.gz: dd859199af5ce2a9ea548f2f5556f5ac341c7658e8ef2a893e137df81c0207c7532d48d7b2d454784dace06efd7eae6190814ef55420a3f9aa85523d11c9c4c9
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
# Getting Started with Shell
|
2
|
+
# Getting Started with Shell SmartPay API
|
3
3
|
|
4
4
|
## Introduction
|
5
5
|
|
@@ -9,17 +9,17 @@ The APIs detailed within this document will enable Shell's Fleet Solutions Custo
|
|
9
9
|
|
10
10
|
Install the gem from the command line:
|
11
11
|
|
12
|
-
```
|
13
|
-
gem install digital-payments-sdk -v 1.
|
12
|
+
```bash
|
13
|
+
gem install digital-payments-sdk -v 1.1.0
|
14
14
|
```
|
15
15
|
|
16
16
|
Or add the gem to your Gemfile and run `bundle`:
|
17
17
|
|
18
18
|
```ruby
|
19
|
-
gem 'digital-payments-sdk', '1.
|
19
|
+
gem 'digital-payments-sdk', '1.1.0'
|
20
20
|
```
|
21
21
|
|
22
|
-
For additional gem details, see the [RubyGems page for the digital-payments-sdk gem](https://rubygems.org/gems/digital-payments-sdk/versions/1.
|
22
|
+
For additional gem details, see the [RubyGems page for the digital-payments-sdk gem](https://rubygems.org/gems/digital-payments-sdk/versions/1.1.0).
|
23
23
|
|
24
24
|
## Test the SDK
|
25
25
|
|
@@ -31,12 +31,13 @@ rake
|
|
31
31
|
|
32
32
|
## Initialize the API Client
|
33
33
|
|
34
|
-
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
34
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/client.md)
|
35
35
|
|
36
36
|
The following parameters are configurable for the API Client:
|
37
37
|
|
38
38
|
| Parameter | Type | Description |
|
39
39
|
| --- | --- | --- |
|
40
|
+
| `environment` | `Environment` | The API environment. <br> **Default: `Environment.TEST`** |
|
40
41
|
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
41
42
|
| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
42
43
|
| `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 60** |
|
@@ -46,40 +47,52 @@ The following parameters are configurable for the API Client:
|
|
46
47
|
| `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
47
48
|
| `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
48
49
|
| `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
49
|
-
| `mpp_token_credentials` | [`MppTokenCredentials`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
50
|
-
| `o_auth_token_post_credentials` | [`OAuthTokenPostCredentials`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
50
|
+
| `mpp_token_credentials` | [`MppTokenCredentials`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/auth/custom-header-signature.md) | The credential object for Custom Header Signature |
|
51
|
+
| `o_auth_token_post_credentials` | [`OAuthTokenPostCredentials`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/auth/custom-header-signature-1.md) | The credential object for Custom Header Signature |
|
51
52
|
|
52
53
|
The API client can be initialized as follows:
|
53
54
|
|
54
55
|
```ruby
|
55
|
-
client =
|
56
|
+
client = ShellSmartPayApi::Client.new(
|
56
57
|
mpp_token_credentials: MppTokenCredentials.new(
|
57
58
|
authorization: 'Authorization'
|
58
59
|
),
|
59
60
|
o_auth_token_post_credentials: OAuthTokenPostCredentials.new(
|
60
61
|
x_apigee_authorization: 'X-Apigee-Authorization'
|
61
|
-
)
|
62
|
+
),
|
63
|
+
environment: Environment::TEST
|
62
64
|
)
|
63
65
|
```
|
64
66
|
|
67
|
+
## Environments
|
68
|
+
|
69
|
+
The SDK can be configured to use a different environment for making API calls. Available environments are:
|
70
|
+
|
71
|
+
### Fields
|
72
|
+
|
73
|
+
| Name | Description |
|
74
|
+
| --- | --- |
|
75
|
+
| Test | **Default** |
|
76
|
+
| Production | - |
|
77
|
+
|
65
78
|
## Authorization
|
66
79
|
|
67
80
|
This API uses the following authentication schemes.
|
68
81
|
|
69
|
-
* [`MppToken (Custom Header Signature)`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
70
|
-
* [`oAuthTokenPost (Custom Header Signature)`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
82
|
+
* [`MppToken (Custom Header Signature)`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/auth/custom-header-signature.md)
|
83
|
+
* [`oAuthTokenPost (Custom Header Signature)`](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/auth/custom-header-signature-1.md)
|
71
84
|
|
72
85
|
## List of APIs
|
73
86
|
|
74
|
-
* [Shell API Platform Security Authentication](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
75
|
-
* [Digital Payment Enablement](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
76
|
-
* [Station Locator](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
77
|
-
* [Partner Notification](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
78
|
-
* [Fueling](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
87
|
+
* [Shell API Platform Security Authentication](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/controllers/shell-api-platform-security-authentication.md)
|
88
|
+
* [Digital Payment Enablement](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/controllers/digital-payment-enablement.md)
|
89
|
+
* [Station Locator](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/controllers/station-locator.md)
|
90
|
+
* [Partner Notification](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/controllers/partner-notification.md)
|
91
|
+
* [Fueling](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/controllers/fueling.md)
|
79
92
|
|
80
93
|
## Classes Documentation
|
81
94
|
|
82
|
-
* [Utility Classes](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
83
|
-
* [HttpResponse](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
84
|
-
* [HttpRequest](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.
|
95
|
+
* [Utility Classes](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/utility-classes.md)
|
96
|
+
* [HttpResponse](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/http-response.md)
|
97
|
+
* [HttpRequest](https://www.github.com/sdks-io/digital-payments-ruby-sdk/tree/1.1.0/doc/http-request.md)
|
85
98
|
|
@@ -1,10 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# shell_smart_pay_api
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
module
|
7
|
-
#
|
6
|
+
module ShellSmartPayApi
|
7
|
+
# shell_smart_pay_api client class.
|
8
8
|
class Client
|
9
9
|
include CoreLibrary
|
10
10
|
attr_reader :config, :auth_managers
|
@@ -44,7 +44,7 @@ module ShellEv
|
|
44
44
|
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
45
45
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
46
46
|
retry_methods: %i[get put], http_callback: nil,
|
47
|
-
environment: Environment::
|
47
|
+
environment: Environment::TEST, mpp_token_credentials: nil,
|
48
48
|
o_auth_token_post_credentials: nil, config: nil
|
49
49
|
)
|
50
50
|
@config = if config.nil?
|
@@ -1,21 +1,21 @@
|
|
1
|
-
#
|
1
|
+
# shell_smart_pay_api
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
module
|
6
|
+
module ShellSmartPayApi
|
7
7
|
# An enum for SDK environments.
|
8
8
|
class Environment
|
9
|
-
# PRODUCTION: Digital Payment APIs
|
10
9
|
ENVIRONMENT = [
|
11
|
-
|
10
|
+
TEST = 'Test'.freeze,
|
11
|
+
PRODUCTION = 'Production'.freeze
|
12
12
|
].freeze
|
13
13
|
end
|
14
14
|
|
15
15
|
# An enum for API servers.
|
16
16
|
class Server
|
17
17
|
SERVER = [
|
18
|
-
|
18
|
+
SHELL = 'Shell'.freeze
|
19
19
|
].freeze
|
20
20
|
end
|
21
21
|
|
@@ -35,7 +35,7 @@ module ShellEv
|
|
35
35
|
max_retries: 0, retry_interval: 1, backoff_factor: 2,
|
36
36
|
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
|
37
37
|
retry_methods: %i[get put], http_callback: nil,
|
38
|
-
environment: Environment::
|
38
|
+
environment: Environment::TEST, mpp_token_credentials: nil,
|
39
39
|
o_auth_token_post_credentials: nil
|
40
40
|
)
|
41
41
|
|
@@ -88,8 +88,11 @@ module ShellEv
|
|
88
88
|
|
89
89
|
# All the environments the SDK can run in.
|
90
90
|
ENVIRONMENTS = {
|
91
|
+
Environment::TEST => {
|
92
|
+
Server::SHELL => 'https://api-test.shell.com/ShellDigitalCommerceServices/Payments/B2B/Partner'
|
93
|
+
},
|
91
94
|
Environment::PRODUCTION => {
|
92
|
-
Server::
|
95
|
+
Server::SHELL => 'https://api.shell.com/ShellDigitalCommerceServices/Payments/B2B/Partner'
|
93
96
|
}
|
94
97
|
}.freeze
|
95
98
|
|
@@ -97,7 +100,7 @@ module ShellEv
|
|
97
100
|
# @param [Configuration::Server] server The server enum for which the base URI is
|
98
101
|
# required.
|
99
102
|
# @return [String] The base URI.
|
100
|
-
def get_base_uri(server = Server::
|
103
|
+
def get_base_uri(server = Server::SHELL)
|
101
104
|
ENVIRONMENTS[environment][server].clone
|
102
105
|
end
|
103
106
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# shell_smart_pay_api
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
module
|
6
|
+
module ShellSmartPayApi
|
7
7
|
# BaseController.
|
8
8
|
class BaseController
|
9
9
|
include CoreLibrary
|
@@ -30,15 +30,15 @@ module ShellEv
|
|
30
30
|
end
|
31
31
|
|
32
32
|
# Creates a new builder for the Api Call instance.
|
33
|
-
# @return [ApiCall] The instance of ApiCall.
|
34
|
-
def new_api_call_builder
|
35
|
-
@api_call.new_builder
|
36
|
-
end
|
37
|
-
|
38
|
-
# Creates a new instance of the request builder.
|
39
|
-
# @param [String] http_method The HTTP method to use in the request.
|
40
|
-
# @param [String] path The endpoint path to use in the request.
|
41
|
-
# @param [String] server The server to extract the base uri for the request.
|
33
|
+
# @return [ApiCall] The instance of ApiCall.
|
34
|
+
def new_api_call_builder
|
35
|
+
@api_call.new_builder
|
36
|
+
end
|
37
|
+
|
38
|
+
# Creates a new instance of the request builder.
|
39
|
+
# @param [String] http_method The HTTP method to use in the request.
|
40
|
+
# @param [String] path The endpoint path to use in the request.
|
41
|
+
# @param [String] server The server to extract the base uri for the request.
|
42
42
|
# @return [RequestBuilder] The instance of RequestBuilder.
|
43
43
|
def new_request_builder(http_method, path, server)
|
44
44
|
RequestBuilder.new
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# shell_smart_pay_api
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module ShellSmartPayApi
|
7
|
+
# DigitalPaymentEnablementController
|
8
|
+
class DigitalPaymentEnablementController < BaseController
|
9
|
+
# Generates a DPAN and stores the relationship between the Reference ID,
|
10
|
+
# DPAN and the real PAN. This method is called during the customer
|
11
|
+
# registration process, ahead of any payment. The Reference ID is an
|
12
|
+
# identifier chosen by the client system for mobile payment registration. It
|
13
|
+
# must be unique in context of the client system, and is the key to
|
14
|
+
# obtaining and managing the payment details later.
|
15
|
+
# @param [MobilePaymentRegistrationRequest] body Required parameter:
|
16
|
+
# Example:
|
17
|
+
# @return [PaymentEnablementResponse] response from the API call.
|
18
|
+
def mpay_v1_tokens_ref_put(body)
|
19
|
+
new_api_call_builder
|
20
|
+
.request(new_request_builder(HttpMethodEnum::PUT,
|
21
|
+
'/PaymentEnablement/v1/ref',
|
22
|
+
Server::SHELL)
|
23
|
+
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
24
|
+
.body_param(new_parameter(body))
|
25
|
+
.header_param(new_parameter('application/json', key: 'accept'))
|
26
|
+
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
27
|
+
.auth(Single.new('oAuthTokenPost')))
|
28
|
+
.response(new_response_handler
|
29
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
30
|
+
.deserialize_into(PaymentEnablementResponse.method(:from_hash))
|
31
|
+
.local_error('400',
|
32
|
+
'Error Occurred. The server cannot or will not process the'\
|
33
|
+
' request due to an apparent client error (e.g., malformed'\
|
34
|
+
' request syntax, invalid request message).',
|
35
|
+
PaymentEnablementErrorResponseException)
|
36
|
+
.local_error('401',
|
37
|
+
'Unauthorized. The request has not been applied because it'\
|
38
|
+
' lacks valid authentication credentials for the target resource'\
|
39
|
+
'.',
|
40
|
+
APIException)
|
41
|
+
.local_error('403',
|
42
|
+
'Forbidden. The server understood the request but refuses to'\
|
43
|
+
' authorize it.',
|
44
|
+
APIException)
|
45
|
+
.local_error('404',
|
46
|
+
'Not Found. The origin server did not find a current'\
|
47
|
+
' representation for the target resource or is not willing to'\
|
48
|
+
' disclose that one exists.',
|
49
|
+
APIException)
|
50
|
+
.local_error('500',
|
51
|
+
'Internal Server Error. The server encountered an unexpected'\
|
52
|
+
' condition that prevented it from fulfilling the request.',
|
53
|
+
APIException))
|
54
|
+
.execute
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# shell_smart_pay_api
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
module
|
6
|
+
module ShellSmartPayApi
|
7
7
|
# FuelingController
|
8
8
|
class FuelingController < BaseController
|
9
9
|
# The Digital Payments Service enables 3rd Parties to trigger the refuel
|
@@ -23,14 +23,14 @@ module ShellEv
|
|
23
23
|
# considered public information, and is used to build login URLs, or
|
24
24
|
# included in Javascript source code on a page. The client secret must be
|
25
25
|
# kept confidential.
|
26
|
-
# @return [MppAccesTokenResponse] response from the API call
|
26
|
+
# @return [MppAccesTokenResponse] response from the API call.
|
27
27
|
def mpp_token(grant_type,
|
28
28
|
client_id,
|
29
29
|
client_secret)
|
30
30
|
new_api_call_builder
|
31
31
|
.request(new_request_builder(HttpMethodEnum::POST,
|
32
32
|
'/Fueling/v1/oauth/token',
|
33
|
-
Server::
|
33
|
+
Server::SHELL)
|
34
34
|
.form_param(new_parameter(grant_type, key: 'grant_type'))
|
35
35
|
.form_param(new_parameter(client_id, key: 'client_id'))
|
36
36
|
.form_param(new_parameter(client_secret, key: 'client_secret'))
|
@@ -38,12 +38,13 @@ module ShellEv
|
|
38
38
|
.header_param(new_parameter('application/json', key: 'accept'))
|
39
39
|
.auth(Single.new('oAuthTokenPost')))
|
40
40
|
.response(new_response_handler
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
42
|
+
.deserialize_into(MppAccesTokenResponse.method(:from_hash))
|
43
|
+
.local_error('401',
|
44
|
+
'Unauthorized. The request has not been applied because it'\
|
45
|
+
' lacks valid authentication credentials for the target resource'\
|
46
|
+
'.',
|
47
|
+
MppAccesTokenErrorResponseException))
|
47
48
|
.execute
|
48
49
|
end
|
49
50
|
|
@@ -53,14 +54,14 @@ module ShellEv
|
|
53
54
|
# @param [String] site_country Required parameter: Country ISO code
|
54
55
|
# @param [String] currency Required parameter: Currency ISO code
|
55
56
|
# @param [PrepareFuelingRequest] body Required parameter: Example:
|
56
|
-
# @return [PrepareFuelingResponse] response from the API call
|
57
|
+
# @return [PrepareFuelingResponse] response from the API call.
|
57
58
|
def mpp_prepare_fueling(site_country,
|
58
59
|
currency,
|
59
60
|
body)
|
60
61
|
new_api_call_builder
|
61
62
|
.request(new_request_builder(HttpMethodEnum::POST,
|
62
63
|
'/Fueling/v1/fueling',
|
63
|
-
Server::
|
64
|
+
Server::SHELL)
|
64
65
|
.query_param(new_parameter(site_country, key: 'siteCountry'))
|
65
66
|
.query_param(new_parameter(currency, key: 'currency'))
|
66
67
|
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
@@ -69,57 +70,57 @@ module ShellEv
|
|
69
70
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
70
71
|
.auth(And.new('oAuthTokenPost', 'MppToken')))
|
71
72
|
.response(new_response_handler
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
73
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
74
|
+
.deserialize_into(PrepareFuelingResponse.method(:from_hash))
|
75
|
+
.local_error('400',
|
76
|
+
'Error Occurred. Request did not include bearer token or token'\
|
77
|
+
' provided and is invalid.',
|
78
|
+
APIException)
|
79
|
+
.local_error('401',
|
80
|
+
'Unauthorized',
|
81
|
+
APIException)
|
82
|
+
.local_error('403',
|
83
|
+
'Forbidden. Requestor is not permitted to call the API',
|
84
|
+
APIException)
|
85
|
+
.local_error('404',
|
86
|
+
'Not Found. Request received by the server but requested URL'\
|
87
|
+
' not found',
|
88
|
+
APIException))
|
88
89
|
.execute
|
89
90
|
end
|
90
91
|
|
91
92
|
# Enables a partner user to cancel pump reservation from the App
|
92
93
|
# @param [String] mpp_transaction_id Required parameter: The ID of the
|
93
94
|
# transaction that’s being cancelled
|
94
|
-
# @return [void] response from the API call
|
95
|
+
# @return [void] response from the API call.
|
95
96
|
def mpp_cancel_fueling(mpp_transaction_id)
|
96
97
|
new_api_call_builder
|
97
98
|
.request(new_request_builder(HttpMethodEnum::DELETE,
|
98
99
|
'/Fueling/v1/fueling/{mppTransactionId}',
|
99
|
-
Server::
|
100
|
+
Server::SHELL)
|
100
101
|
.template_param(new_parameter(mpp_transaction_id, key: 'mppTransactionId')
|
101
102
|
.should_encode(true))
|
102
103
|
.auth(And.new('oAuthTokenPost', 'MppToken')))
|
103
104
|
.response(new_response_handler
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
105
|
+
.is_response_void(true)
|
106
|
+
.local_error('400',
|
107
|
+
'Error Occurred. The server cannot or will not process the'\
|
108
|
+
' request due to an apparent client error (e.g., malformed'\
|
109
|
+
' request syntax, invalid request message). Please see below for'\
|
110
|
+
' information regarding structure of Response Body vs. all'\
|
111
|
+
' possible errors that could be returned.',
|
112
|
+
CancelFuelingErrorResponseErrorException)
|
113
|
+
.local_error('401',
|
114
|
+
'Unauthorized. Request did not include bearer token or token'\
|
115
|
+
' provided and is invalid.',
|
116
|
+
CancelFuelingErrorResponseErrorException)
|
117
|
+
.local_error('403',
|
118
|
+
'Forbidden. Requestor is not permitted to call the API.',
|
119
|
+
APIException)
|
120
|
+
.local_error('404',
|
121
|
+
'Not Found. Request received by the server but requested URL'\
|
122
|
+
' not found',
|
123
|
+
APIException))
|
123
124
|
.execute
|
124
125
|
end
|
125
126
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# shell_smart_pay_api
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
module
|
6
|
+
module ShellSmartPayApi
|
7
7
|
# PartnerNotificationController
|
8
8
|
class PartnerNotificationController < BaseController
|
9
9
|
# To access the Partner’s endpoints, for sending callback messages, Shell
|
@@ -23,48 +23,48 @@ module ShellEv
|
|
23
23
|
# considered public information, and is used to build login URLs, or
|
24
24
|
# included in Javascript source code on a page. The client secret must be
|
25
25
|
# kept confidential.
|
26
|
-
# @return [AccessTokenResponse] response from the API call
|
26
|
+
# @return [AccessTokenResponse] response from the API call.
|
27
27
|
def partner_token(grant_type,
|
28
28
|
client_id,
|
29
29
|
client_secret)
|
30
30
|
new_api_call_builder
|
31
31
|
.request(new_request_builder(HttpMethodEnum::POST,
|
32
32
|
'/token',
|
33
|
-
Server::
|
33
|
+
Server::SHELL)
|
34
34
|
.form_param(new_parameter(grant_type, key: 'grant_type'))
|
35
35
|
.form_param(new_parameter(client_id, key: 'client_id'))
|
36
36
|
.form_param(new_parameter(client_secret, key: 'client_secret'))
|
37
37
|
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
38
38
|
.header_param(new_parameter('application/json', key: 'accept')))
|
39
39
|
.response(new_response_handler
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
41
|
+
.deserialize_into(AccessTokenResponse.method(:from_hash))
|
42
|
+
.local_error('401',
|
43
|
+
'Unauthorized',
|
44
|
+
AccessTokenErrorException))
|
45
45
|
.execute
|
46
46
|
end
|
47
47
|
|
48
48
|
# Enables Shell to inform partner of the successful completion of a
|
49
49
|
# transaction. Note this needs to be implemented over HTTPS
|
50
50
|
# @param [FinaliseFuelingRequest] body Optional parameter: Example:
|
51
|
-
# @return [void] response from the API call
|
51
|
+
# @return [void] response from the API call.
|
52
52
|
def finalise_fueling(body: nil)
|
53
53
|
new_api_call_builder
|
54
54
|
.request(new_request_builder(HttpMethodEnum::POST,
|
55
55
|
'/finaliseFueling',
|
56
|
-
Server::
|
56
|
+
Server::SHELL)
|
57
57
|
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
58
58
|
.body_param(new_parameter(body))
|
59
59
|
.body_serializer(proc do |param| param.to_json unless param.nil? end))
|
60
60
|
.response(new_response_handler
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
61
|
+
.is_response_void(true)
|
62
|
+
.local_error('400',
|
63
|
+
'Bad Request',
|
64
|
+
APIException)
|
65
|
+
.local_error('401',
|
66
|
+
'Unauthorized',
|
67
|
+
APIException))
|
68
68
|
.execute
|
69
69
|
end
|
70
70
|
|
@@ -72,23 +72,23 @@ module ShellEv
|
|
72
72
|
# cancelled by Shell as an error/issue occured. Note this needs to be
|
73
73
|
# implemented over HTTPS
|
74
74
|
# @param [CancelFuelingRequest] body Optional parameter: Example:
|
75
|
-
# @return [void] response from the API call
|
75
|
+
# @return [void] response from the API call.
|
76
76
|
def cancel_fueling(body: nil)
|
77
77
|
new_api_call_builder
|
78
78
|
.request(new_request_builder(HttpMethodEnum::POST,
|
79
79
|
'/cancelFueling',
|
80
|
-
Server::
|
80
|
+
Server::SHELL)
|
81
81
|
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
82
82
|
.body_param(new_parameter(body))
|
83
83
|
.body_serializer(proc do |param| param.to_json unless param.nil? end))
|
84
84
|
.response(new_response_handler
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
85
|
+
.is_response_void(true)
|
86
|
+
.local_error('400',
|
87
|
+
'Bad Request',
|
88
|
+
APIException)
|
89
|
+
.local_error('401',
|
90
|
+
'Unauthorized',
|
91
|
+
APIException))
|
92
92
|
.execute
|
93
93
|
end
|
94
94
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# shell_smart_pay_api
|
2
2
|
#
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
-
module
|
6
|
+
module ShellSmartPayApi
|
7
7
|
# ShellAPIPlatformSecurityAuthenticationController
|
8
8
|
class ShellAPIPlatformSecurityAuthenticationController < BaseController
|
9
9
|
# To obtain APIGEE access token
|
@@ -19,25 +19,25 @@ module ShellEv
|
|
19
19
|
# considered public information, and is used to build login URLs, or
|
20
20
|
# included in Javascript source code on a page. The client secret must be
|
21
21
|
# kept confidential.
|
22
|
-
# @return [AccessTokenResponse] response from the API call
|
22
|
+
# @return [AccessTokenResponse] response from the API call.
|
23
23
|
def oauth_token_post(grant_type,
|
24
24
|
client_id,
|
25
25
|
client_secret)
|
26
26
|
new_api_call_builder
|
27
27
|
.request(new_request_builder(HttpMethodEnum::POST,
|
28
28
|
'/oauth/token',
|
29
|
-
Server::
|
29
|
+
Server::SHELL)
|
30
30
|
.form_param(new_parameter(grant_type, key: 'grant_type'))
|
31
31
|
.form_param(new_parameter(client_id, key: 'client_id'))
|
32
32
|
.form_param(new_parameter(client_secret, key: 'client_secret'))
|
33
33
|
.header_param(new_parameter('application/x-www-form-urlencoded', key: 'content-type'))
|
34
34
|
.header_param(new_parameter('application/json', key: 'accept')))
|
35
35
|
.response(new_response_handler
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
37
|
+
.deserialize_into(AccessTokenResponse.method(:from_hash))
|
38
|
+
.local_error('401',
|
39
|
+
'Unauthorized',
|
40
|
+
AccessTokenErrorException))
|
41
41
|
.execute
|
42
42
|
end
|
43
43
|
end
|