PayPal Integration: As a shop owner I want to be able to accept Paypal payments for my product. #30

Open
opened 2024-10-27 17:15:09 -04:00 by russellballestrini · 1 comment
russellballestrini commented 2024-10-27 17:15:09 -04:00 (Migrated from git2.unturf.com)

Important: This was AI assisted. I value your judgement if there is a better way!

Title: Integrate PayPal Payment Option in make_post_sell

Description:

Objective: Enable customers to pay with PayPal in addition to the current card-based payment method.

This issue will involve:

  1. Adding fields to store PayPal API credentials in the shop settings template (shop_settings.j2).
  2. Extending the shop model to hold PayPal secrets.
  3. Modifying the cart checkout page to allow users to select their payment method.
  4. Applying database migrations to accommodate these changes.

Tasks:

  1. Add Input Fields in Shop Settings Template

    • File: make_post_sell/templates/shop_settings.j2
    • Description: Add input fields for PayPal API credentials (Client ID and Secret) in the shop settings template.
    • Considerations: The input fields should mimic the structure of Stripe fields for consistency and ease of maintenance.
  2. Extend Shop Model for PayPal Fields

    • File: make_post_sell/models/shop.py
    • Details: Add fields for PayPal Client ID and Secret to the Shop model, similar to existing fields for Stripe.
    • Considerations:
      • Ensure fields are appropriately set up to handle sensitive information securely.
      • Confirm the Shop model includes methods for securely accessing PayPal credentials.
  3. Database Migration for New Fields

    • Action: Create a migration script to add the PayPal credential fields to the database's shop table.
    • Guidance: Follow the migration steps outlined in the project's README.
    • Important: Ensure migrations are compatible with existing data and include rollback support.
  4. (Optional) Update User Object for PayPal Account Link

    • Details: Determine if we need a new user attribute or table for associating users with PayPal accounts.
    • Guidance: While unlikely, a new table might be considered if there’s potential for multi-account support.
  5. Modify Cart Checkout for Payment Choice

    • File: make_post_sell/templates/cart_checkout.j2 (or relevant files handling payment choices)
    • Action: Update the checkout process to allow users to select PayPal or card.
    • Details: Based on user choice, ensure the appropriate payment method is used upon checkout confirmation.
    • Considerations: Implement validation to handle cases where both payment types are available, and one is chosen.
  6. Testing is Optional

  7. Deploy on merge

Important, we deploy on merge so we should have any database migrations ready on merge.

References

**Important: This was AI assisted. I value your judgement if there is a better way!** ### Title: **Integrate PayPal Payment Option in make_post_sell** ### Description: **Objective**: Enable customers to pay with PayPal in addition to the current card-based payment method. This issue will involve: 1. Adding fields to store PayPal API credentials in the shop settings template (`shop_settings.j2`). 2. Extending the shop model to hold PayPal secrets. 3. Modifying the cart checkout page to allow users to select their payment method. 4. Applying database migrations to accommodate these changes. ### Tasks: 1. **Add Input Fields in Shop Settings Template** - **File**: `make_post_sell/templates/shop_settings.j2` - **Description**: Add input fields for PayPal API credentials (Client ID and Secret) in the shop settings template. - **Considerations**: The input fields should mimic the structure of Stripe fields for consistency and ease of maintenance. 2. **Extend Shop Model for PayPal Fields** - **File**: `make_post_sell/models/shop.py` - **Details**: Add fields for PayPal Client ID and Secret to the `Shop` model, similar to existing fields for Stripe. - **Considerations**: - Ensure fields are appropriately set up to handle sensitive information securely. - Confirm the `Shop` model includes methods for securely accessing PayPal credentials. 3. **Database Migration for New Fields** - **Action**: Create a migration script to add the PayPal credential fields to the database's `shop` table. - **Guidance**: Follow the migration steps outlined in the project's README. - **Important**: Ensure migrations are compatible with existing data and include rollback support. 4. **(Optional) Update User Object for PayPal Account Link** - **Details**: Determine if we need a new user attribute or table for associating users with PayPal accounts. - **Guidance**: While unlikely, a new table might be considered if there’s potential for multi-account support. 5. **Modify Cart Checkout for Payment Choice** - **File**: `make_post_sell/templates/cart_checkout.j2` (or relevant files handling payment choices) - **Action**: Update the checkout process to allow users to select PayPal or card. - **Details**: Based on user choice, ensure the appropriate payment method is used upon checkout confirmation. - **Considerations**: Implement validation to handle cases where both payment types are available, and one is chosen. 6. **Testing is Optional** - Testing is optional with the caveat that the code has to work / aka pass QA testing. - It would be nice if we added a unit test and/or integration tests to validate: - Proper storage and retrieval of PayPal credentials. - Checkout page functionality for payment selection. - We used to have a pretty cool stripe functional test that I removed to get tests working. - Successful functional testing thought payment processing through both PayPal and card options. https://git.unturf.com/engineering/make-post-sell/make_post_sell/-/blob/master/make_post_sell/tests/test_functional.py?ref_type=heads#L480-524 7. **Deploy on merge** Important, we deploy on merge so we should have any database migrations ready on merge. ### References - **Shop Settings Template**: [shop_settings.j2](https://git.unturf.com/engineering/make-post-sell/make_post_sell/-/blob/master/make_post_sell/templates/shop_settings.j2) - **Shop Model**: [shop.py#L71-76](https://git.unturf.com/engineering/make-post-sell/make_post_sell/-/blob/master/make_post_sell/models/shop.py?ref_type=heads#L71-76)
russellballestrini commented 2024-10-27 17:23:27 -04:00 (Migrated from git2.unturf.com)

changed the description

changed the description
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: engineering/make_post_sell#30
No description provided.