Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Srivastava, Ayushee authored and Srivastava, Ayushee committed Apr 13, 2023
2 parents fdbcf50 + c069a8a commit 84188e7
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 84188e7

Please sign in to comment.