Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PANC-71] Create mock Airtel Api. #3

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sanchit-0
Copy link
Contributor

@sanchit-0 sanchit-0 commented Jul 16, 2024

Description

PANC-71 Write Mock APIs for Airtel money.

This PR creates Mock Apis for following Airtel Apis:

The API specs can be found here.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Followed the PR title naming convention mentioned above.

  • Design related bullet points or design document link related to this PR added in the description above.

  • Updated corresponding Postman Collection or Api documentation for the changes in this PR.

  • Created/updated unit or integration tests for verifying the changes made.

  • Added required Swagger annotation and update API documentation with details of any API changes if applicable

  • Followed the naming conventions as given in https://docs.google.com/document/d/1Q4vaMSzrTxxh9TS0RILuNkSkYCxotuYk1Xe0CMIkkCU/edit?usp=sharing

if (transactionId.equals(transactionIdSuccessful)) {
message = TransferStatus.SUCCESSFUL.name();
status = TransactionStatus.TS.name();
code = HttpStatus.OK.toString();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code now has the value 200 Ok instead of 200 is that fine? Otherwise I think we have to create a seperate enum for response codes.

@sanchit-0 sanchit-0 force-pushed the mock-airtel-api branch 2 times, most recently from abb14b6 to 75432d3 Compare July 22, 2024 11:15
@@ -0,0 +1,5 @@
package org.mifos.connector.airtel.mockairtel.utils;

public enum TransactionStatus {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this enum is required? You can use TransferStatus enum here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return airtelMockController.getTransactionStatus(transactionId);
}

@PostMapping("/merchant/v2/payments/")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this extra '/' from the endpoint

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@ankita10r ankita10r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
@@ -41,7 +45,7 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.mifos:ph-ee-connector-common:1.9.1-SNAPSHOT'
implementation 'org.mifos:ph-ee-connector-common:0.0.0'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, update this to the released version after the jfrog issue is fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 0.0.0 as this PR has not been merged and new version is not released.

The response codes in the `application.yml` file have been added from the Airtel documentation.

Similarly, the responses returned by the API are based on the Airtel documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants