-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Shopify] Dispute processing in Shopify (Payments module) (#25753)
When there is a dispute related to a payment transaction, there is no clear way to see the status of the dispute and the finalized date within BC. The committed code enables this. I have added an Enum that represents the dispute statuses from Shopify, and mapped them accordingly. UpdateDisputeStatus() function in ShpfyPayments.Codeunit.al gets the list of disputes from the Shopify API, and updates the data in BC. Considering that dispute processing is an async task and might happen at any point in time, I pull the data from Shopify via the report "Shpfy Sync Disputes", that can be scheduled via Job queue. On another note, with the updates to the Disputes, values from "Shpfy Payment Transcation Type" would be very valued for extensibility purposes, so I removed the Internal access. Fixes #26262 Fixes [AB#498566](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/498566) --------- Co-authored-by: danilovetatek <[email protected]> Co-authored-by: Jesper Schulz-Wedde <[email protected]>
- Loading branch information
1 parent
3ba9bae
commit eaeff6c
Showing
12 changed files
with
530 additions
and
0 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
64 changes: 64 additions & 0 deletions
64
Apps/W1/Shopify/app/src/Payments/Enums/ShpfyDisputeReason.Enum.al
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,64 @@ | ||
namespace Microsoft.Integration.Shopify; | ||
|
||
enum 30153 "Shpfy Dispute Reason" | ||
{ | ||
Caption = 'Shopify Dispute Reason'; | ||
Extensible = false; | ||
|
||
value(0; Unknown) | ||
{ | ||
Caption = 'Unknown'; | ||
} | ||
value(1; "Bank Not Process") | ||
{ | ||
Caption = 'Bank Not Process'; | ||
} | ||
value(2; "Credit Not Processed") | ||
{ | ||
Caption = 'Credit Not Processed'; | ||
} | ||
value(3; "Customer Initiated") | ||
{ | ||
Caption = 'Customer Initiated'; | ||
} | ||
value(4; "Debit Not Authorized") | ||
{ | ||
Caption = 'Debit Not Authorized'; | ||
} | ||
value(5; Duplicate) | ||
{ | ||
Caption = 'Duplicate'; | ||
} | ||
value(6; Fraudulent) | ||
{ | ||
Caption = 'Fraudulent'; | ||
} | ||
value(7; General) | ||
{ | ||
Caption = 'General'; | ||
} | ||
value(8; "Incorrect Account Details") | ||
{ | ||
Caption = 'Incorrect Account Details'; | ||
} | ||
value(9; "Insufficient Funds") | ||
{ | ||
Caption = 'Insufficient Funds'; | ||
} | ||
value(10; "Product Not Received") | ||
{ | ||
Caption = 'Product Not Received'; | ||
} | ||
value(11; "Product Unacceptable") | ||
{ | ||
Caption = 'Product Unacceptable'; | ||
} | ||
value(12; "Subscription Canceled") | ||
{ | ||
Caption = 'Subscription Canceled'; | ||
} | ||
value(13; Unrecognized) | ||
{ | ||
Caption = 'Unrecognized'; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
Apps/W1/Shopify/app/src/Payments/Enums/ShpfyDisputeStatus.Enum.al
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,37 @@ | ||
namespace Microsoft.Integration.Shopify; | ||
|
||
enum 30154 "Shpfy Dispute Status" | ||
{ | ||
|
||
Caption = 'Shopify Dispute Status'; | ||
Extensible = false; | ||
|
||
value(0; Unknown) | ||
{ | ||
Caption = ' '; | ||
} | ||
value(1; "Needs Response") | ||
{ | ||
Caption = 'Needs Response'; | ||
} | ||
value(2; "Under Review") | ||
{ | ||
Caption = 'Under Review'; | ||
} | ||
value(3; "Charge Refunded") | ||
{ | ||
Caption = 'Charge Refunded'; | ||
} | ||
value(4; "Accepted") | ||
{ | ||
Caption = 'Accepted'; | ||
} | ||
value(5; "Won") | ||
{ | ||
Caption = 'Won'; | ||
} | ||
value(6; "Lost") | ||
{ | ||
Caption = 'Lost'; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Apps/W1/Shopify/app/src/Payments/Enums/ShpfyDisputeType.Enum.al
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,20 @@ | ||
namespace Microsoft.Integration.Shopify; | ||
|
||
enum 30155 "Shpfy Dispute Type" | ||
{ | ||
Caption = 'Shopify Dispute Type'; | ||
Extensible = false; | ||
|
||
value(0; Unknown) | ||
{ | ||
Caption = ' '; | ||
} | ||
value(1; Inquiry) | ||
{ | ||
Caption = 'Inquiry'; | ||
} | ||
value(2; Chargeback) | ||
{ | ||
Caption = 'Chargeback'; | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
Apps/W1/Shopify/app/src/Payments/Pages/ShpfyDisputes.Page.al
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,76 @@ | ||
namespace Microsoft.Integration.Shopify; | ||
|
||
page 30161 "Shpfy Disputes" | ||
{ | ||
Editable = false; | ||
PageType = List; | ||
UsageCategory = None; | ||
SourceTable = "Shpfy Dispute"; | ||
Caption = 'Disputes'; | ||
|
||
layout | ||
{ | ||
area(Content) | ||
{ | ||
repeater(control01) | ||
{ | ||
|
||
field(Id; Rec.Id) | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Id field.'; | ||
} | ||
field("Source Order Id"; Rec."Source Order Id") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Source Order Id field.'; | ||
} | ||
field("Type"; Rec."Type") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Type field.'; | ||
} | ||
field(Currency; Rec.Currency) | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Currency field.'; | ||
} | ||
field(Amount; Rec.Amount) | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Amount field.'; | ||
} | ||
field(Reason; Rec.Reason) | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Shpfy Dispute Reason field.'; | ||
} | ||
field("Network Reason Code"; Rec."Network Reason Code") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Network Reason Code field.'; | ||
} | ||
field(Status; Rec.Status) | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Status field.'; | ||
} | ||
field("Evidence Due By"; Rec."Evidence Due By") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Evidence Due By field.'; | ||
} | ||
field("Evidence Sent On"; Rec."Evidence Sent On") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Evidence Sent On field.'; | ||
} | ||
field("Finalized On"; Rec."Finalized On") | ||
{ | ||
ApplicationArea = All; | ||
ToolTip = 'Specifies the value of the Finalized On field.'; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.