Skip to content

Commit

Permalink
update the state in the main traid
Browse files Browse the repository at this point in the history
  • Loading branch information
GMALKHA committed Dec 4, 2024
1 parent 3409509 commit 6b00a15
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class PayPalWebViewModel: ObservableObject {

func captureOrder(orderID: String, selectedMerchantIntegration: MerchantIntegration) async {
do {
self.state.capturedOrderResponse = .loading
DispatchQueue.main.async {
self.state.capturedOrderResponse = .loading
}
let payPalClientMetadataID = payPalDataCollector?.collectDeviceData()
let order = try await DemoMerchantAPI.sharedService.captureOrder(
orderID: orderID,
Expand Down Expand Up @@ -162,8 +164,9 @@ class PayPalWebViewModel: ObservableObject {

func completeTransaction() async throws {
do {
self.state.authorizedOrderResponse = .loading

DispatchQueue.main.async {
self.state.authorizedOrderResponse = .loading
}
let payPalClientMetadataID = payPalDataCollector?.collectDeviceData()
if let orderID {
let order = try await DemoMerchantAPI.sharedService.completeOrder(
Expand Down

0 comments on commit 6b00a15

Please sign in to comment.