subscribepro / subscribepro-magento2-ext

Subscribe Pro Magento 2 Integration Extension
MIT License
24 stars 22 forks source link

Don't display subscribe_pro methods in instant purchase when method not allowed for one-time purchase and not creating a subscription #255

Open chrismshea opened 8 months ago

chrismshea commented 8 months ago

PR: #269

That's a mouthful, but: In Magento 2 the Subscribe Pro payment method should be disabled for one time purchases.

SP_Method_One-Time-No

In Magento 2 Instant Purchase button on Product Detail Page is enabled by default.

m2-frontend-instant-purchase m2_frontend_instant_purchase

So, when one time purchase is disabled should we only allow the Instant Purchase button to display when customer is subscribing or if they have a saved card that is not subscribe_pro.

eugene-shab commented 8 months ago

@chrismshea Did I understand you correctly, if the config one-time purchase is set as false

If we have saved the SP payment method:

If we have saved non-SP payment method:

chrismshea commented 8 months ago

I think we need one more category: If you have a saved sp and non sp method.

I'm not sure how to change what profile is used for instant purchase and I have not seen a selector when the modal pops up.

eugene-shab commented 8 months ago

@chrismshea @garthbrantley I added functionality for processing Instant Purchase buttons and a modal popup when the config Enabled for Non-Subscription Transactions is disabled.

Magento on the default behavior for the Instant Purchases button calls the last available Payment Method Token from the vault_payment_token table.

I have doubts about some cases:

  1. If the SP payment method is enabled, what should the behavior be on a Non-Subscription product? At the moment the SP method token is substituted in the Instant Purchase modal.
  2. If the SP payment method is disabled, what behavior should the Subscription product have? Currently if selected:
    • One Time Delivery Instant Purchase button is shown (Non-SP payment method enabled - e.x Braintree)
    • Regular Delivery Instant Purchase button is not shown
chrismshea commented 7 months ago

Instant Purchase Requires: