-
Notifications
You must be signed in to change notification settings - Fork 33
Feature/1603 - Flow review #553
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 38 additions & 26 deletions
64
src/main/java/com/checkout/handlepaymentsandpayouts/flow/FlowClient.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,48 @@ | ||
| package com.checkout.handlepaymentsandpayouts.flow; | ||
|
|
||
| import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.requests.PaymentSessionRequest; | ||
| import com.checkout.handlepaymentsandpayouts.flow.paymentsessions.responses.PaymentSessionResponse; | ||
| import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.requests.PaymentSessionWithPaymentRequest; | ||
| import com.checkout.handlepaymentsandpayouts.flow.paymentsessionscomplete.responses.PaymentSessionWithPaymentResponse; | ||
| import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.requests.SubmitPaymentSessionRequest; | ||
| import com.checkout.handlepaymentsandpayouts.flow.paymentsessionssubmit.responses.SubmitPaymentSessionResponse; | ||
| import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCreateRequest; | ||
| import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionSubmitRequest; | ||
| import com.checkout.handlepaymentsandpayouts.flow.requests.PaymentSessionCompleteRequest; | ||
| import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSessionResponse; | ||
| import com.checkout.handlepaymentsandpayouts.flow.responses.PaymentSubmissionResponse; | ||
|
|
||
| import java.util.concurrent.CompletableFuture; | ||
|
|
||
| /** | ||
| * Flow - Create payment sessions and submit payment attempts | ||
| */ | ||
| public interface FlowClient { | ||
|
|
||
| CompletableFuture<PaymentSessionResponse> requestPaymentSession(PaymentSessionRequest paymentSessionRequest); | ||
|
|
||
| CompletableFuture<SubmitPaymentSessionResponse> submitPaymentSessions( | ||
| String paymentId, | ||
| SubmitPaymentSessionRequest submitPaymentSessionRequest | ||
| ); | ||
|
|
||
| CompletableFuture<PaymentSessionWithPaymentResponse> requestPaymentSessionWithPayment( | ||
| PaymentSessionWithPaymentRequest paymentSessionRequest | ||
| ); | ||
| /** | ||
| * Request a Payment Session | ||
| * Creates a payment session. | ||
| * The values you provide in the request will be used to determine the payment methods available to Flow. | ||
| * Some payment methods may require you to provide specific values for certain fields. | ||
| * You must supply the unmodified response body when you initialize Flow. | ||
| */ | ||
| CompletableFuture<PaymentSessionResponse> requestPaymentSession(PaymentSessionCreateRequest request); | ||
|
|
||
| /** | ||
| * Submit a Payment Session | ||
| * Submit a payment attempt for a payment session. | ||
| * This request works with the Flow handleSubmit callback, where you can perform a customized payment submission. | ||
| * You must send the unmodified response body as the response of the handleSubmit callback. | ||
| */ | ||
| CompletableFuture<PaymentSubmissionResponse> submitPaymentSession(String sessionId, PaymentSessionSubmitRequest request); | ||
|
|
||
| /** | ||
| * Request a Payment Session with Payment | ||
| * Create a payment session and submit a payment attempt for it. | ||
| * The values you provide in the request will be used to determine the payment methods available to Flow. | ||
| * This request works with the advanced Flow integration, where you do not need to create a payment session for initializing Flow. | ||
| * You must send the unmodified response body as the response of the handleSubmit callback. | ||
| */ | ||
| CompletableFuture<PaymentSubmissionResponse> requestPaymentSessionWithPayment(PaymentSessionCompleteRequest request); | ||
|
|
||
| // Synchronous methods | ||
| PaymentSessionResponse requestPaymentSessionSync(PaymentSessionRequest paymentSessionRequest); | ||
|
|
||
| SubmitPaymentSessionResponse submitPaymentSessionsSync( | ||
| String paymentId, | ||
| SubmitPaymentSessionRequest submitPaymentSessionRequest | ||
| ); | ||
|
|
||
| PaymentSessionWithPaymentResponse requestPaymentSessionWithPaymentSync( | ||
| PaymentSessionWithPaymentRequest paymentSessionRequest | ||
| ); | ||
| PaymentSessionResponse requestPaymentSessionSync(PaymentSessionCreateRequest request); | ||
|
|
||
| PaymentSubmissionResponse submitPaymentSessionSync(String sessionId, PaymentSessionSubmitRequest request); | ||
|
|
||
| PaymentSubmissionResponse requestPaymentSessionWithPaymentSync(PaymentSessionCompleteRequest request); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/ApplePayConfiguration.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package com.checkout.handlepaymentsandpayouts.flow.entities; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| /** | ||
| * Configuration options specific to Apple Pay payments. | ||
| */ | ||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public class ApplePayConfiguration extends PaymentMethodConfigurationBase { | ||
|
|
||
| /** | ||
| * The type of the Apple Pay payment total line item. Default: "final" | ||
| */ | ||
| @Builder.Default | ||
| private TotalType totalType = TotalType.FINAL; | ||
| } | ||
13 changes: 13 additions & 0 deletions
13
src/main/java/com/checkout/handlepaymentsandpayouts/flow/entities/CardConfiguration.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.checkout.handlepaymentsandpayouts.flow.entities; | ||
|
|
||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| /** | ||
| * Configuration options specific to card payments | ||
| */ | ||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
|
||
| public class CardConfiguration extends PaymentMethodConfigurationBase { | ||
| // Empty class - inherits all properties from base | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.