Skip to content

Commit

Permalink
Merge pull request #107 from flickmatch/Astitva-Pay
Browse files Browse the repository at this point in the history
Created the controller class and returned harcoded value
  • Loading branch information
hvs-flick authored Nov 9, 2023
2 parents 1af8ddc + 7df3213 commit f752814
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
3 changes: 2 additions & 1 deletion platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ dependencies {
implementation group: 'io.github.boostchicken', name: 'spring-data-dynamodb', version: '5.2.5'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-graphql'
testImplementation 'junit:junit:4.13.2'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
testImplementation 'junit:junit:4.13.2'
testImplementation 'junit:junit:4.13.2'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.flickmatch.platform.graphql.controller;

import com.flickmatch.platform.graphql.input.InitiatePaymentInput;
import com.flickmatch.platform.graphql.type.InitiatePaymentOutput;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PaymentController {

@PostMapping
public InitiatePaymentOutput initiatePayment(@RequestBody InitiatePaymentInput input) {
String paymentLink = "https://example.com/payment/link";
InitiatePaymentOutput output = new InitiatePaymentOutput(paymentLink);
output.setPaymentLink(paymentLink);
return output;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.flickmatch.platform.graphql.input;

import lombok.Builder;
import lombok.Getter;

@Builder
@Getter
public class InitiatePaymentInput {
String eventId;
String cityId;
PlayerInput player;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.flickmatch.platform.graphql.type;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

@Builder
@Setter
@Getter
public class InitiatePaymentOutput {
private String paymentLink;
public InitiatePaymentOutput(String paymentLink) {
this.paymentLink = paymentLink;
}
}
11 changes: 11 additions & 0 deletions platform/src/main/resources/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Mutation {
createEvent(input: CreateEventInput!): MutationResult!
joinEvent(input: JoinEventInput!): MutationResult!
updatePlayerList(input: UpdatePlayerListInput!): MutationResult!
initiatePayment(input: InitiatePaymentInput!): InitiatePaymentOutput!
"""
This is not implemented yet, will be required for P1
"""
Expand Down Expand Up @@ -50,6 +51,16 @@ input JoinEventInput {
player: PlayerInput!
}

input InitiatePaymentInput {
eventId: ID!
cityId: ID!
player: PlayerInput!
}

type InitiatePaymentOutput {
paymentLink: String!
}

input CreateSportsVenueInput {
cityId: ID!
displayName: String!
Expand Down

0 comments on commit f752814

Please sign in to comment.