Skip to content
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

Alternative Payment Methods as separate payment gateways (3258, 3259) #2163

Open
wants to merge 16 commits into
base: trunk
Choose a base branch
from

Conversation

pedrosilva-pt
Copy link
Collaborator

@pedrosilva-pt pedrosilva-pt commented Apr 16, 2024

This PR includes a setting for selecting separated Alternative Payment Methods and ensures it can process orders. Also ensures WC checkout form is validated before starting the payment process.

Introduces WC payment gateway StandardButtonGateway.php for handling all separated APMs. It also includes APMs in validation logic and payment process.

Acceptance Criteria

Setting for selecting separated Alternative Payment Methods

  • Possible selections: all available APMs from the Disable Alternative Payment Methods setting.

A merchant wants to show the iDEAL button inside of the regular PayPal gateway, as per default. So, it wasn’t selected in the Disable Alternative Payment Methods setting. However, the merchant wants all other payment buttons not to appear. Except for Venmo, this should be a separate payment gateway on the Checkout page, independently of the PayPal gateway.

Captura de pantalla 2024-06-14 a las 11 38 07
New Venmo payment gateway tab.

Captura de pantalla 2024-06-14 a las 11 29 32
When customer selects United States, Venmo payment gateway is shown.

Captura de pantalla 2024-06-14 a las 11 29 54
When customer selects Netherlands, iDeal payment gateway is shown in PayPal buttons.

SEPA payment gateway process payment

  • As admin ensure PayPal Vaulting is NOT enabled
  • Go to Payments / PayPal and add “SEPA-Lastschrift“ in “Separate gateways for selected Alternative Payment Methods“
  • Add product to cart and go to checkout page
  • Select “Germany” in “Country / Region”
  • Select “SEPA-Lastschrift“ payment and click “Sepa“ button
  • As we do not have a valid OTP code, use “Have a PayPal account? Log In“ at the bottom of the modal
  • Login as PayPal user and complete purchase
    • Payment is processed correctly
    • Payment method is “SEPA-Lastschrift“

Ensure WC checkout form validation before starting the payment process

  • Same steps as before but removing one checkout form fill (ex. First name) before clicking “Sepa“ button
  • Click “Sepa“ button
    • Error should be displayed in the screen and PayPal modal should be closed automatically

@InpsydeNiklas InpsydeNiklas added this to the 2.7.1 milestone Apr 26, 2024
@InpsydeNiklas InpsydeNiklas modified the milestones: 2.7.1, 2.8.0 May 9, 2024
@InpsydeNiklas InpsydeNiklas modified the milestones: 2.8.0, 2.8.1 Jun 10, 2024
@Dinamiko Dinamiko changed the title Optionally present Alternative Payment Methods as separate payment gateway (153) Alternative Payment Methods as separate payment gateways (3258, 3259) Jun 14, 2024
Copy link
Collaborator

@danieldudzic danieldudzic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

@InpsydeNiklas InpsydeNiklas removed this from the 2.8.1 milestone Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants