Problem/Motivation

InvalidArgumentException: Invalid credit card type "master_card" when performing checkout with MasterCard

Steps to reproduce

  • Go to the checkout page and select HyperPay as the payment gateway.
  • Enter MasterCard details and proceed with the payment.
  • The payment fails with the above error message.

Proposed resolution

Ensure that when a user pays with a MasterCard, the card type is correctly set as "mastercard" instead of "master" as drupal commerce expects it that way.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

manar olimat created an issue. See original summary.

manar olimat’s picture

This patch checks if the payment method is ' master' then change it to 'mastercard'

manar olimat’s picture

Title: nvalidArgumentException: Invalid credit card type "master" when using mastercard » InvalidArgumentException: Invalid credit card type "master" when using mastercard
Issue summary: View changes
manar olimat’s picture

Status: Active » Needs review
anas_maw’s picture

Status: Needs review » Reviewed & tested by the community

  • eadc3459 committed on 2.0.x
    [#3510623] fix: InvalidArgumentException: Invalid credit card type "...
anas_maw’s picture

Assigned: manar olimat » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.