-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for adjustment type and VND currency #83
Conversation
b62008b
to
a42f01b
Compare
|
||
@dataclass | ||
class CreateAdjustment(Operation): | ||
action: Action | ||
items: list[CreateAdjustmentItem] | ||
items: list[CreateAdjustmentItem] | None | Undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items
cannot be set to Undefined()
by default without moving the argument, which would be a breaking change.
CreateAdjustment.full()
and CreateAdjustment.partial()
have been introduced to make it easier to create this operation, e.g.
CreateAdjustment.partial(
Action.Refund,
[CreateAdjustmentItem("txnitm_01h8bxryv3065dyh6103p3yg28", AdjustmentType.Partial, "100")],
"error",
"txn_01h8bxpvx398a7zbawb77y0kp5",
)
CreateAdjustment.full(
Action.Refund,
"error",
"txn_01h8bxpvx398a7zbawb77y0kp5",
)
The constructor can still be used, but items must always be provided, e.g.
CreateAdjustment(
Action.Refund,
None,
"error",
"txn_01h8bxpvx398a7zbawb77y0kp5",
AdjustmentActionType.Full,
)
CreateAdjustment(
Action.Refund,
Undefined(),
"error",
"txn_01h8bxpvx398a7zbawb77y0kp5",
AdjustmentActionType.Full,
)
a42f01b
to
e0999fc
Compare
Added
VND
) as a supported currency for payments related changelog