As a customer
I need an action to default an existing payment method So that I know which payment method is going to be used by default for any of my given transactions
Details and Assumptions
Will need to add a new boolean field is_default
Need to add test that covers this action and checks if the PaymentMethod is default, and the others are not
The REST URL to block the payment method will be PUT /payment-method/:payment-method-id/set-default
Acceptance Criteria
Given an existing payment method that is not a default payment method and there are no other payment methods
When I send a `PUT /payment-method/12/set-default` request
Then the payment method field `is_default` should be `True` and I should receive a JSON response that contains the `PaymentMethod` information with it: `{id: 12, name: ... is_default: True}`
Given two existing payment methods, id = 1 and id = 2, where payment method with id = 2 is set to be default
When I send a PUT/payment-method/1/set-default request
Then the payment method field is_default for id = 1 should be set to True and I should receive a JSON response that contains the PaymentMethod information with it: {id: 1, name: ..., is_default: True}
As a customer I need an action to default an existing payment method
So that I know which payment method is going to be used by default for any of my given transactions
Details and Assumptions
is_default
PaymentMethod
is default, and the others are notThe REST URL to block the payment method will be
PUT /payment-method/:payment-method-id/set-default
Acceptance Criteria
Given two existing payment methods, id = 1 and id = 2, where payment method with id = 2 is set to be default When I send a
PUT/payment-method/1/set-default
request Then the payment method fieldis_default
for id = 1 should be set toTrue
and I should receive a JSON response that contains thePaymentMethod
information with it:{id: 1, name: ..., is_default: True}