refactor(api_models): follow naming convention for wallets & paylater payment method data enums #1338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Payment method data enums should follow naming conventions, like if it is Redirect flow then name should be "{Payment_Method_Name}Redirect"
Updated api contract
AliPay Redirect:
"payment_method_data": { "wallet": { "ali_pay_redirect": {} } }
WechatPay Redirect:
"payment_method_data": { "wallet": { "we_chat_pay_redirect": {} } }
MBWay Redirect:
"payment_method_data": { "wallet": { "mb_way_redirect": { "telephone_number":"+351213822199" } } }
Walley Redirect:
"payment_method_data": { "pay_later": { "walley_redirect": {} } }
PayBright Redirect:
"payment_method_data": { "pay_later": { "pay_bright_redirect": {} } }
Additional Changes
Motivation and Context
How did you test it?
Postman:
![Screen Shot 2023-06-02 at 1 12 58 PM](https://private-user-images.githubusercontent.com/20727986/242820254-64243719-b2fe-4bca-9b80-8bb072e59fdd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTI2NTMsIm5iZiI6MTcyMzk5MjM1MywicGF0aCI6Ii8yMDcyNzk4Ni8yNDI4MjAyNTQtNjQyNDM3MTktYjJmZS00YmNhLTliODAtOGJiMDcyZTU5ZmRkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJjMDE1NzMyNmU2YTc4YTlkM2UyNjkyMWE0Zjg4YTEyZjlmYTc4ZWU0YjM1M2Y5ZDhhNDJhMWJiNjcxODc1MmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.fh7_9dfRGel5CeFqzigWK_BD7O1QgOjkb6mPZHYksaE)
![Screen Shot 2023-06-02 at 1 11 09 PM](https://private-user-images.githubusercontent.com/20727986/242820279-3b6e840c-244a-40c3-b5bf-959e9b8baccb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTI2NTMsIm5iZiI6MTcyMzk5MjM1MywicGF0aCI6Ii8yMDcyNzk4Ni8yNDI4MjAyNzktM2I2ZTg0MGMtMjQ0YS00MGMzLWI1YmYtOTU5ZTliOGJhY2NiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdkZTcyOWM0NGJlNGNkZTU2MzY0MzU2NmI2M2FhNDg0NWMwOWYzMmRmMWJjMzYzOWNlZDc4OWMyMTNjMjI4OTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.BPrGfWUcKV02NjDavn3OzUoxrTbU67uF_34L7Rikx-k)
![Screen Shot 2023-06-02 at 1 11 44 PM](https://private-user-images.githubusercontent.com/20727986/242820287-be18e9e6-b88e-460d-af2d-d50a584ad600.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTI2NTMsIm5iZiI6MTcyMzk5MjM1MywicGF0aCI6Ii8yMDcyNzk4Ni8yNDI4MjAyODctYmUxOGU5ZTYtYjg4ZS00NjBkLWFmMmQtZDUwYTU4NGFkNjAwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1OWI2MzExM2RmZDQ0ZDI0YzZlNzMzMmI2ZmY0YmEzOGUwOWJjMjMyMDkxZjY1NTU2YjgzZWYwNjNkNTJmYTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lAlUSpa9sA7HCcBI1VOeX-jsZpng7tQSJI9ytSIUmj0)
![Screen Shot 2023-06-02 at 1 15 32 PM](https://private-user-images.githubusercontent.com/20727986/242820943-95084094-56c6-476c-b302-b05099ec9fad.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTI2NTMsIm5iZiI6MTcyMzk5MjM1MywicGF0aCI6Ii8yMDcyNzk4Ni8yNDI4MjA5NDMtOTUwODQwOTQtNTZjNi00NzZjLWIzMDItYjA1MDk5ZWM5ZmFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdkMTEzZGY4MWMwMDk5NjczMjRmOGI0ZGQwZDMxYzU0M2EyN2ViN2ViMjEwMTQ5MGE3ZWM2YTk1MDNjNzFhMTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zbWT1FXDVPZuJZXy650KDGDWE7tnQTY1Zin1HtLfha4)
![Screen Shot 2023-06-02 at 1 16 10 PM](https://private-user-images.githubusercontent.com/20727986/242820957-6a764921-75bd-4598-b381-05cfbe6bf2b0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTI2NTMsIm5iZiI6MTcyMzk5MjM1MywicGF0aCI6Ii8yMDcyNzk4Ni8yNDI4MjA5NTctNmE3NjQ5MjEtNzViZC00NTk4LWIzODEtMDVjZmJlNmJmMmIwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJlYjVjYTEyNGViYzM4OTBiNDA2YzdkODUzZDRjNDQyMmVlMTU1M2Y3NzBhMzY1OWJlZGNiN2NmZGQ0ZmNlMzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1qVDDOXZB9-3J8LsD1-7UBBG0ZDH0QULAwR2BSqPc1c)
Checklist
cargo +nightly fmt --all
cargo clippy