-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local Payment Single Result Object (#851)
* Add LocalPaymentResult * Fix unit tests * Rename existing PaymentAuthRequest to params * Rename internal callbacks * Create PaymentAuthRequest callback * Fix unit tests * Update migration guide and CHANGELOG * Refactor demo app * Fix demo app * Fix demo app * Refactor callbacks to kotlin * Fix lint * Update v5_MIGRATION_GUIDE.md --------- Co-authored-by: Tim Chow <[email protected]> Co-authored-by: sshropshire <[email protected]>
- Loading branch information
1 parent
b37f817
commit 0deb12d
Showing
22 changed files
with
353 additions
and
235 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
12 changes: 12 additions & 0 deletions
12
LocalPayment/src/main/java/com/braintreepayments/api/LocalPaymentAuthCallback.kt
This file contains 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,12 @@ | ||
package com.braintreepayments.api | ||
|
||
/** | ||
* Callback for receiving result of | ||
* [LocalPaymentClient.createPaymentAuthRequest]. | ||
*/ | ||
fun interface LocalPaymentAuthCallback { | ||
/** | ||
* @param paymentAuthRequest a request used to launch the PayPal web authentication flow | ||
*/ | ||
fun onLocalPaymentAuthRequest(paymentAuthRequest: LocalPaymentAuthRequest) | ||
} |
18 changes: 18 additions & 0 deletions
18
LocalPayment/src/main/java/com/braintreepayments/api/LocalPaymentAuthRequest.kt
This file contains 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,18 @@ | ||
package com.braintreepayments.api | ||
|
||
/** | ||
* A request used to launch the continuation of the local payment flow. | ||
*/ | ||
sealed class LocalPaymentAuthRequest { | ||
|
||
/** | ||
* The request was successfully created and is ready to be launched by [LocalPaymentLauncher] | ||
*/ | ||
class ReadyToLaunch(val requestParams: LocalPaymentAuthRequestParams) : | ||
LocalPaymentAuthRequest() | ||
|
||
/** | ||
* There was an [error] creating the request | ||
*/ | ||
class Failure(val error: Exception) : LocalPaymentAuthRequest() | ||
} |
16 changes: 0 additions & 16 deletions
16
LocalPayment/src/main/java/com/braintreepayments/api/LocalPaymentAuthRequestCallback.java
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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
16 changes: 16 additions & 0 deletions
16
...ment/src/main/java/com/braintreepayments/api/LocalPaymentInternalAuthRequestCallback.java
This file contains 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,16 @@ | ||
package com.braintreepayments.api; | ||
|
||
import androidx.annotation.Nullable; | ||
|
||
/** | ||
* Callback for receiving result of | ||
* {@link LocalPaymentClient#createPaymentAuthRequest(LocalPaymentRequest, LocalPaymentAuthCallback)}. | ||
*/ | ||
public interface LocalPaymentInternalAuthRequestCallback { | ||
|
||
/** | ||
* @param localPaymentAuthRequestParams {@link LocalPaymentAuthRequestParams} | ||
* @param error an exception that occurred while initiating a Local Payment | ||
*/ | ||
void onResult(@Nullable LocalPaymentAuthRequestParams localPaymentAuthRequestParams, @Nullable Exception error); | ||
} |
9 changes: 9 additions & 0 deletions
9
...Payment/src/main/java/com/braintreepayments/api/LocalPaymentInternalTokenizeCallback.java
This file contains 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,9 @@ | ||
package com.braintreepayments.api; | ||
|
||
|
||
import androidx.annotation.Nullable; | ||
|
||
interface LocalPaymentInternalTokenizeCallback { | ||
|
||
void onResult(@Nullable LocalPaymentNonce localPaymentNonce, @Nullable Exception error); | ||
} |
Oops, something went wrong.