Repository navigation
feature/INT-1724 - CashApp payment method integration #686
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
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
27 changes: 27 additions & 0 deletions
27
.../com/checkout/handlepaymentsandpayouts/setups/entities/customer/CustomerDeviceClient.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,27 @@ | ||
| package com.checkout.handlepaymentsandpayouts.setups.entities.customer; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
|
|
||
| /** | ||
| * The type of client the customer uses to initiate the payment. | ||
| */ | ||
| public enum CustomerDeviceClient { | ||
|
|
||
| /** | ||
| * A web browser on a desktop device. | ||
| */ | ||
| @SerializedName("web") | ||
| WEB, | ||
|
|
||
| /** | ||
| * A web browser on a mobile device. | ||
| */ | ||
| @SerializedName("mobile_web") | ||
| MOBILE_WEB, | ||
|
|
||
| /** | ||
| * A native mobile application. | ||
| */ | ||
| @SerializedName("app") | ||
| APP | ||
| } |
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
53 changes: 53 additions & 0 deletions
53
...com/checkout/handlepaymentsandpayouts/setups/entities/paymentMethods/cashapp/CashApp.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,53 @@ | ||
| package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.cashapp; | ||
|
|
||
| import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodBase; | ||
| import com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.common.PaymentMethodInitialization; | ||
| import lombok.Data; | ||
| import lombok.EqualsAndHashCode; | ||
|
|
||
| /** | ||
| * Cash App Pay payment method configuration. The customer must be sent to the redirect URL | ||
| * returned in the action to authorize the payment with Cash App. The payment setup customer | ||
| * device client is required for this method. | ||
| */ | ||
| @Data | ||
| @EqualsAndHashCode(callSuper = true) | ||
| public final class CashApp extends PaymentMethodBase { | ||
|
|
||
| /** | ||
| * The initialization state of the payment method. Defaults to disabled. | ||
| * [Optional] | ||
| */ | ||
| private PaymentMethodInitialization initialization = PaymentMethodInitialization.DISABLED; | ||
|
|
||
| /** | ||
| * Indicates whether the customer consents to share their Cash App customer profile with | ||
| * Checkout.com. When enabled, the customer profile is returned once, after the customer | ||
| * authorizes the payment. | ||
| * [Optional] | ||
| */ | ||
| private Boolean customerProfileSharing; | ||
|
|
||
| /** | ||
| * The customer's Cash App profile that they consented to share. Included in the response when | ||
| * customer_profile_sharing is enabled. Cash App releases this profile only once: it is present | ||
| * in the first successful response when you get the payment setup after the customer | ||
| * authorizes the payment, and every subsequent response omits it, so store it on first read. | ||
| * [Optional] readOnly | ||
| */ | ||
| private CashAppCustomerProfile customerProfile; | ||
|
|
||
| /** | ||
| * A reference for the Cash App Pay transaction, returned by the provider. | ||
| * [Optional] readOnly | ||
| * max 80 characters | ||
| */ | ||
| private String reference; | ||
|
|
||
| /** | ||
| * The next available action for the payment method. When its type is redirect, send the | ||
| * customer to its redirect URL to authorize the payment with Cash App. | ||
| * [Optional] readOnly | ||
| */ | ||
| private CashAppAction action; | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
...eckout/handlepaymentsandpayouts/setups/entities/paymentMethods/cashapp/CashAppAction.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,30 @@ | ||
| package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.cashapp; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| /** | ||
| * The next available action for the Cash App payment method. | ||
| */ | ||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public final class CashAppAction { | ||
|
|
||
| /** | ||
| * The type of action. | ||
| * [Optional] readOnly | ||
| * Enum: "redirect" | ||
| */ | ||
| private CashAppActionType type; | ||
|
|
||
| /** | ||
| * The URL to redirect the customer to so they can authorize the payment with Cash App. | ||
| * [Optional] readOnly | ||
| * Format: uri | ||
| */ | ||
| private String redirectUrl; | ||
| } |
15 changes: 15 additions & 0 deletions
15
...ut/handlepaymentsandpayouts/setups/entities/paymentMethods/cashapp/CashAppActionType.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,15 @@ | ||
| package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.cashapp; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
|
|
||
| /** | ||
| * The type of next action for the Cash App payment method. | ||
| */ | ||
| public enum CashAppActionType { | ||
|
|
||
| /** | ||
| * Redirect the customer to Cash App to authorize the payment. | ||
| */ | ||
| @SerializedName("redirect") | ||
| REDIRECT | ||
| } |
74 changes: 74 additions & 0 deletions
74
...ckout/handlepaymentsandpayouts/setups/entities/paymentMethods/cashapp/CashAppAddress.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,74 @@ | ||
| package com.checkout.handlepaymentsandpayouts.setups.entities.paymentMethods.cashapp; | ||
|
|
||
| import com.checkout.common.CountryCode; | ||
| import com.google.gson.annotations.SerializedName; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| /** | ||
| * The customer's address from their Cash App profile. The keys follow Cash App's naming | ||
| * (address_line_1, locality, administrative_district_level_1), not the Checkout.com address, so | ||
| * the line and district fields carry an explicit serialized name: the naming policy alone would | ||
| * produce address_line1. | ||
| */ | ||
| @Data | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public final class CashAppAddress { | ||
|
|
||
| /** | ||
| * The first line of the address. | ||
| * [Optional] readOnly | ||
| */ | ||
| @SerializedName("address_line_1") | ||
| private String addressLine1; | ||
|
|
||
| /** | ||
| * The second line of the address. | ||
| * [Optional] readOnly | ||
| */ | ||
| @SerializedName("address_line_2") | ||
| private String addressLine2; | ||
|
|
||
| /** | ||
| * The third line of the address. | ||
| * [Optional] readOnly | ||
| */ | ||
| @SerializedName("address_line_3") | ||
| private String addressLine3; | ||
|
|
||
| /** | ||
| * The address locality, such as the city or town. | ||
| * [Optional] readOnly | ||
| */ | ||
| private String locality; | ||
|
|
||
| /** | ||
| * The address sublocality, such as the district or neighborhood. | ||
| * [Optional] readOnly | ||
| */ | ||
| private String sublocality; | ||
|
|
||
| /** | ||
| * The address's top-level administrative district, such as the state or province. | ||
| * [Optional] readOnly | ||
| */ | ||
| @SerializedName("administrative_district_level_1") | ||
| private String administrativeDistrictLevel1; | ||
|
|
||
| /** | ||
| * The postal or zip code. | ||
| * [Optional] readOnly | ||
| */ | ||
| private String postalCode; | ||
|
|
||
| /** | ||
| * The address country, in ISO 3166-1 alpha-2 format. | ||
| * [Optional] readOnly | ||
| * max 2 characters | ||
| */ | ||
| private CountryCode country; | ||
| } |
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.