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

Razorpay multiple #248

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.flickmatch.platform.dynamodb.model;

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import lombok.ToString;

@DynamoDBTable(tableName = "MonthlyPass")
@ToString
public class MonthlyPass {
private String passId;
private Integer price;
private String location;
private PassType passType;
private Integer durationInDays;
private Integer numberOfGames;
private String validityPeriod;

public enum PassType {
DAY_PASS,
GAME_PASS;
}

@DynamoDBHashKey(attributeName="passId")
@DynamoDBAutoGeneratedKey()
public String getPassId() {
return passId;
}

public void setPassId(String passId) {
this.passId = passId;
}

@DynamoDBHashKey(attributeName="price")
public Integer getPrice() {
return price;
}

public void setPrice(Integer price) {
this.price = price;
}

@DynamoDBHashKey(attributeName="location")
public String getLocation() {
return location;
}

public void setLocation(String location) {
this.location = location;
}

@DynamoDBHashKey(attributeName="passType")
public PassType getPassType() {
return passType;
}

public void setPassType(PassType passType) {
this.passType = passType;
}

@DynamoDBHashKey(attributeName="durationInDays")
public Integer getDurationInDays() {
return durationInDays;
}

public void setDurationInDays(Integer durationInDays) {
this.durationInDays = durationInDays;
}

@DynamoDBHashKey(attributeName="numberOfGames")
public Integer getNumberOfGames() {
return numberOfGames;
}

public void setNumberOfGames(Integer numberOfGames) {
this.numberOfGames = numberOfGames;
}

@DynamoDBHashKey(attributeName="validityPeriod")
public String getValidityPeriod() {
return validityPeriod;
}

public void setValidityPeriod(String validityPeriod) {
this.validityPeriod = validityPeriod;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package com.flickmatch.platform.dynamodb.model;

import com.amazonaws.services.dynamodbv2.datamodeling.*;
import lombok.ToString;

import java.time.LocalDate;

@DynamoDBTable(tableName = "Subscription")
@ToString
public class Subscription {
private String subscriptionId;
private String userId;
private String passId;
private LocalDate startDate;
private LocalDate endDate;
private Integer gamesUsed;
private String status;
private String passType;

@DynamoDBAttribute(attributeName = "passType")
public String getPassType() {
return passType;
}

public void setPassType(String passType) {
this.passType = passType;
}

@DynamoDBHashKey(attributeName="subscriptionId")
@DynamoDBAutoGeneratedKey
public String getSubscriptionId() {
return subscriptionId;
}

public void setSubscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
}

@DynamoDBIndexHashKey(attributeName="userId", globalSecondaryIndexName="UserIdIndex")
public String getUserId() {
return userId;
}

public void setUserId(String userId) {
this.userId = userId;
}

@DynamoDBIndexHashKey(attributeName="passId", globalSecondaryIndexName="PassIdIndex")
public String getPassId() {
return passId;
}

public void setPassId(String passId) {
this.passId = passId;
}

@DynamoDBHashKey(attributeName="startDate")
public LocalDate getStartDate() {
return startDate;
}

public void setStartDate(LocalDate startDate) {
this.startDate = startDate;
}

@DynamoDBHashKey(attributeName="endDate")
public LocalDate getEndDate() {
return endDate;
}

public void setEndDate(LocalDate endDate) {
this.endDate = endDate;
}

@DynamoDBHashKey(attributeName="gamesUsed")
public Integer getGamesUsed() {
return gamesUsed;
}

public void setGamesUsed(Integer gamesUsed) {
this.gamesUsed = gamesUsed;
}

@DynamoDBHashKey(attributeName="status")
public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,45 @@ public class User {
private String phoneNumber;
private String userId;

boolean isSubscribed;
private String subscriptionValidFrom;
private String subscriptionValidTo;
private String subscriptionPassId;

public boolean isSubscribed() {
return isSubscribed;
}

public void setSubscribed(boolean subscribed) {
isSubscribed = subscribed;
}

@DynamoDBAttribute(attributeName="subscriptionValidFrom")
public String getSubscriptionValidFrom() {
return subscriptionValidFrom;
}

public void setSubscriptionValidFrom(String subscriptionValidFrom) {
this.subscriptionValidFrom = subscriptionValidFrom;
}

@DynamoDBAttribute(attributeName="subscriptionValidTo")
public String getSubscriptionValidTo() {
return subscriptionValidTo;
}

public void setSubscriptionValidTo(String subscriptionValidTo) {
this.subscriptionValidTo = subscriptionValidTo;
}

@DynamoDBAttribute(attributeName="subscriptionPassId")
public String getSubscriptionPassId() {
return subscriptionPassId;
}

public void setSubscriptionPassId(String subscriptionPassId) {
this.subscriptionPassId = subscriptionPassId;
}

@DynamoDBHashKey(attributeName="userId")
@DynamoDBAutoGeneratedKey()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
@Value("${razorpay.key.secret}")
private String secret;


// @Autowired
// WhatsAppProxy whatsAppProxy;

Expand All @@ -63,9 +64,14 @@

boolean status = Utils.verifyPaymentSignature(options, secret);
if(status) {
eventBuilder.joinEventRazorPayment(paymentRequest);
paymentRequestBuilder.updatePaymentRequestStatus(paymentRequest, true);
log.info("Player joined event successfully.");
if(PAID_STATUS.equals(paymentRequest.getStatus())) {
log.info("Payment already processed for orderId : "+orderId+ " ignoring duplicate payments.");

Check failure

Code scanning / CodeQL

Log Injection High

This log entry depends on a
user-provided value
.
}
else {
eventBuilder.joinEventRazorPayment(paymentRequest);
paymentRequestBuilder.updatePaymentRequestStatus(paymentRequest, true);
log.info("Player joined event successfully.");
}
}

else {
Expand Down
Loading