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

feat: add EFT as a payment method #910

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Anurag-05-prog
Copy link

@Anurag-05-prog Anurag-05-prog commented Feb 19, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

EFT is a bank redirect payment method. This PR involves adding EFT as a payment method in the Hyperswitch SDK.

EFT accepts ZAR as currency.

Implementation Summary

  • Added EFT as a payment method in PaymentDetails.res, defining its type, icon, and display name.
  • Updated PaymentMethodsRecord.res to include EFT in paymentMethodsFields.
  • Modified PaymentModeType.res to add EFT as a payment type, map "eft" to EFT, and include it in defaultOrder for proper display sequencing.
  • Defined appropriate display and default terms for EFT in PaymentType.res.
  • Generated a JSON structure for EFT in PaymentBody.res, temporarily setting the provider name as ozow.
  • Added EFT as a bank payment method type in PaymentUtils.res.

How did you test it?

  1. Set up the Hyperswitch Backend locally using this documentation.
  2. Used the cURL commands provided in this PR in Postman to:
    • Set up a merchant account
    • Generate Hyperswitch API keys
    • Create a Paystack connector
  3. Setup Hyperswitch SDK locally using this documentation
    • Gave this paymentData in server.js file to imitate Payments - Create call:
      const paymentData = {
        "amount": 6540,
        "currency": "ZAR",
        "confirm": false,
        "amount_to_capture": 6540,
        "customer_id": "StripbmnxeCustomer",
        "email": "[email protected]",
        "description": "Its my first payment request",
        "return_url": "https://google.com",
        "payment_method": "bank_redirect",
        "payment_method_type": "eft",
        "payment_method_data": {
          "bank_redirect": {
            "eft": {
              "provider": "ozow"
            }
          }
        }
      };
  4. Ran the application on localhost, initiated a payment intent, and manually tested EFT by clicking the Pay Now button.

Screen recoding of the test:
https://github.com/user-attachments/assets/4668f766-50f4-4700-86ac-9e5779a68794

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

Copy link

semanticdiff-com bot commented Feb 19, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  public/icons/orca.svg  0% smaller
  src/PaymentDetails.res Unsupported file format
  src/Payments/PaymentMethodsRecord.res Unsupported file format
  src/Types/PaymentModeType.res Unsupported file format
  src/Types/PaymentType.res Unsupported file format
  src/Utilities/PaymentBody.res Unsupported file format
  src/Utilities/PaymentUtils.res Unsupported file format

Copy link
Collaborator

@PritishBudhiraja PritishBudhiraja left a comment

Choose a reason for hiding this comment

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

Please add videos and a description for the following payment method. Has the Backend PR been merged for this payment method?

@@ -901,6 +901,30 @@ let pazeBody = (~completeResponse) => {
]
}

let eftBody = (~name) => [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check how pazeBody is made please make it in a similar manner for better readability.

@@ -562,6 +562,13 @@ let paymentMethodsFields = [
displayName: "UPI Collect",
miniIcon: None,
},
{
paymentMethodName: "eft",
icon: Some(icon("eft", ~size=19)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is eft icon present?

Copy link
Author

Choose a reason for hiding this comment

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

No, it's not present yet.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please add Icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants