Skip to content

Commit

Permalink
Pull request #29: added donate feature toggle changes
Browse files Browse the repository at this point in the history
Merge in PPCT/carbon-tracker-reference-app from feature/S3035231-DonateFeature_toggle_update to master

Squashed commit of the following:

commit 8922e467cf97a1c22bb8b678af28df9b90ad8ae8
Author: Srivastava, Ayushee <[email protected]>
Date:   Mon Jan 23 15:49:26 2023 +0530

    S3035231:feat added donate feature toggle changes

commit c64d958e83f223c12762eabb394ce654fec48102
Author: Srivastava, Ayushee <[email protected]>
Date:   Thu Jan 19 16:24:53 2023 +0530

    S3035231:feat added donate feature toggle changes
  • Loading branch information
Srivastava, Ayushee authored and Srivastava, Ayushee committed Apr 13, 2023
1 parent 88b878b commit c069a8a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ Use this endpoint to display the current months' carbon score, to provide a snap
3. **Enroll User** <br/>
endpoint "/issuers/users" <br/>
Use this endpoint to enrol their customers onto Carbon Calculator Experience platform.
Donate feature toggle, which allows the issuer to disable the donate feature during onboarding.
If the issuer has opted for the Donation feature then the fields - *name, billing address, email, locale, cardholder name, card number, card base currency and card expiry date* fields are **mandatory** in the payload.

4. **Get Issuer** <br/>
endpoint "/issuers" <br/>
Expand All @@ -118,6 +120,7 @@ Use this endpoint to delete user registered to Carbon Calculator Experience plat
6. **Update Issuer** <br/>
endpoint "/issuers"<br/>
Use this endpoint to update issuer details onboarded to Carbon Calculator Experience Platform.
This endpoint is not supported when the Donate feature for your bank is disabled.

More details can be found [here](https://stage.developer.mastercard.com/drafts/priceless-planet-carbon-tracker/staging/documentation/use-cases/).

Expand Down
36 changes: 32 additions & 4 deletions src/main/resources/carbon-tracker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ paths:
Used to enroll users for the Carbon Calculator Experience API so that
they can track the carbon usage for their transactions and and provides
them with an option to donate towards tree plantations.
**Note-**
If the issuer has opted for the Donation feature then the fields - *name, billing address, email, locale, cardholder name, card number, card base currency and card expiry date* fields are **mandatory** in the payload.
operationId: userRegistration
x-mastercard-api-encrypted: true
requestBody:
Expand Down Expand Up @@ -123,7 +127,7 @@ paths:
"400":
$ref: '#/components/responses/UserEnrolmentBadRequestError'
"401":
$ref: '#/components/responses/UserEnrolmentUnauthorisedError'
$ref: '#/components/responses/UpdateUserUnauthorisedError'
"404":
$ref: '#/components/responses/IssuerNotFoundError'
"415":
Expand Down Expand Up @@ -336,10 +340,7 @@ components:
Experience API.
required:
- cardNumber
- billingAddress
- email
- locale
- name
- expiryInfo
- cardBaseCurrency
- cardholderName
Expand Down Expand Up @@ -963,6 +964,21 @@ components:
$ref: '#/components/examples/IssuerSuspendedError'
IssuerTerminatedError:
$ref: '#/components/examples/IssuerTerminatedError'
UpdateUserUnauthorisedError:
description: This response code is returned for unauthorized Issuer and User.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorWrapper'
examples:
IssuerInactiveError:
$ref: '#/components/examples/IssuerInactiveError'
IssuerSuspendedError:
$ref: '#/components/examples/IssuerSuspendedError'
IssuerTerminatedError:
$ref: '#/components/examples/IssuerTerminatedError'
UpdateUserNotAccessible:
$ref: '#/components/examples/UpdateUserNotAccessible'
AggregateCarbonScoreNotFoundError:
description: This response code is returned when a user or Issuer is not present.
content:
Expand Down Expand Up @@ -1007,6 +1023,7 @@ components:
examples:
InvalidUserIdError:
$ref: '#/components/examples/InvalidUserIdError'

AggregateCarbonScoreBadRequestError:
description: >-
This response code is returned when a request is invalid or data in the
Expand Down Expand Up @@ -1138,6 +1155,17 @@ components:
request.
Recoverable: false
Details: 'Email must be in the format: [email protected]'
UpdateUserNotAccessible:
value:
Errors:
Error:
- Source: CARBON CALCULATOR EXPERIENCE
ReasonCode: UPDATE_USER_NOT_ACCESSIBLE
Description: >-
You do not have permission to access this API. The Donate feature for your bank is disabled.
Recoverable: false
Details: >-
You do not have permission to access this API. The Donate feature for your bank is disabled.
IssuerEmptyRequestBodyError:
value:
Errors:
Expand Down

0 comments on commit c069a8a

Please sign in to comment.