-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Card: Remove try/catch from Approve Order Flow (#302)
* Rename ConfirmPaymentSourceResponse to ConfirmPaymentSourceResult. * Remove throws from CardClient.approveOrder flow. * Make if statement truthy. * Clean up detekt errors. * Remove coroutines exception handler from CardClient.approveOrder flow.
- Loading branch information
1 parent
afda478
commit b5c9f73
Showing
7 changed files
with
78 additions
and
122 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
13 changes: 0 additions & 13 deletions
13
...ayments/src/main/java/com/paypal/android/cardpayments/api/ConfirmPaymentSourceResponse.kt
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
CardPayments/src/main/java/com/paypal/android/cardpayments/api/ConfirmPaymentSourceResult.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,19 @@ | ||
package com.paypal.android.cardpayments.api | ||
|
||
import com.paypal.android.cardpayments.model.PaymentSource | ||
import com.paypal.android.cardpayments.model.PurchaseUnit | ||
import com.paypal.android.corepayments.OrderStatus | ||
import com.paypal.android.corepayments.PayPalSDKError | ||
|
||
internal sealed class ConfirmPaymentSourceResult { | ||
|
||
data class Success( | ||
val orderId: String, | ||
val status: OrderStatus? = null, | ||
val payerActionHref: String? = null, | ||
val paymentSource: PaymentSource? = null, | ||
val purchaseUnits: List<PurchaseUnit>? = null | ||
) : ConfirmPaymentSourceResult() | ||
|
||
data class Failure(val error: PayPalSDKError) : ConfirmPaymentSourceResult() | ||
} |
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