Skip to content

Commit

Permalink
Merge pull request #286 from Adyen/exposeSessionResult
Browse files Browse the repository at this point in the history
Expose session result
  • Loading branch information
Robert-SD authored Dec 20, 2024
2 parents e6716d4 + f600811 commit 0a17f28
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Added support for partial payments.
* Improved dynamic viewport of card component.
* Added sessionResult to the PaymentSessionFinished payment result.
* Added support of iDEAL to the Instant Component.
* Added the missing loading bottom sheet for the advanced flow google pay component.
* Removed alert in case the deletion of stored payment method failed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ComponentSessionFlowHandler: AdyenSessionDelegate {
let paymentResult = PaymentResultModelDTO(
sessionId: session.sessionContext.identifier,
sessionData: session.sessionContext.data,
sessionResult: result.encodedResult,
resultCode: result.resultCode.rawValue
)
let componentCommunicationModel = ComponentCommunicationModel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class DropInSessionsDelegate: AdyenSessionDelegate {
let paymentResult = PaymentResultModelDTO(
sessionId: session.sessionContext.identifier,
sessionData: session.sessionContext.data,
sessionResult: result.encodedResult,
resultCode: result.resultCode.rawValue
)
let platformCommunicationModel = PlatformCommunicationModel(
Expand Down
2 changes: 2 additions & 0 deletions lib/src/common/model/payment_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ class PaymentAdvancedFinished extends PaymentResult {
class PaymentSessionFinished extends PaymentResult {
final String sessionId;
final String sessionData;
final String sessionResult;
final ResultCode resultCode;
final OrderResponse? order;

PaymentSessionFinished({
required this.sessionId,
required this.sessionData,
required this.sessionResult,
required this.resultCode,
this.order,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ApplePaySessionComponent extends BaseApplePayComponent {
onPaymentResult(PaymentSessionFinished(
sessionId: paymentResultDTO?.result?.sessionId ?? "",
sessionData: paymentResultDTO?.result?.sessionData ?? "",
sessionResult: paymentResultDTO?.result?.sessionResult ?? "",
resultCode: resultCode,
));
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/card/card_session_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CardSessionComponent extends BaseCardComponent {
onPaymentResult(PaymentSessionFinished(
sessionId: paymentResultDTO?.result?.sessionId ?? "",
sessionData: paymentResultDTO?.result?.sessionData ?? "",
sessionResult: paymentResultDTO?.result?.sessionResult ?? "",
resultCode: resultCode,
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GooglePaySessionComponent extends BaseGooglePayComponent {
onPaymentResult(PaymentSessionFinished(
sessionId: paymentResultDTO.result?.sessionId ?? "",
sessionData: paymentResultDTO.result?.sessionData ?? "",
sessionResult: paymentResultDTO.result?.sessionResult ?? "",
resultCode: resultCode,
));
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/components/instant/instant_session_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class InstantSessionComponent extends BaseInstantComponent {
onPaymentResult(PaymentSessionFinished(
sessionId: paymentResultDTO.result?.sessionId ?? "",
sessionData: paymentResultDTO.result?.sessionData ?? "",
sessionResult: paymentResultDTO.result?.sessionResult ?? "",
resultCode: resultCode,
));
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/drop_in/drop_in.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class DropIn {
return PaymentSessionFinished(
sessionId: paymentResultDTO.result?.sessionId ?? "",
sessionData: paymentResultDTO.result?.sessionData ?? "",
sessionResult: paymentResultDTO.result?.sessionResult ?? "",
resultCode:
paymentResultDTO.result?.toResultCode() ?? ResultCode.unknown,
order: paymentResultDTO.result?.order?.fromDTO(),
Expand Down

0 comments on commit 0a17f28

Please sign in to comment.