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(payments): add paynow payment method #6900

Merged
merged 4 commits into from
Nov 26, 2023
Merged

Conversation

KenLSM
Copy link
Contributor

@KenLSM KenLSM commented Nov 15, 2023

Problem

Admins want to only support certain forms to only provide payment through paynow (and disallowing other payment methods).

Closes FRM-1515

Solution

Added a payment_methods: string[] that can contain allowed payment methods

  • Currently, only Paynow: 'Paynow' is supported

Backwards compatibility is supported through marking the new field as optional, and populated with [] when form.payments_channel is updated (during remove or add payment channel)

Breaking Changes

  • No - this PR is backwards compatible

Features:

  • Supports Paynow only through backend configuration by adding form.payments_channel.payment_methods: ["Paynow"]

Before & After Screenshots

BEFORE:

Screenshot 2023-11-15 at 11 32 54 PM

AFTER:

Screenshot 2023-11-15 at 11 32 17 PM

Tests

Regression

  • Find an existing payment form
  • Make a payment
  • Ensure that both payment methods "Cards", and "Paynow" are available to be selected

New features

Newly created forms should have both "Cards" and "Paynow" payment methods
  • Create a new payment form
  • Make a payment
  • Ensure that both payment methods "Cards", and "Paynow" are available to be selected
Forms with enabled toggle should only allow "Paynow" payment method
  • Create a new payment form
  • Upsert form.payments_channel.payment_methods: ["Paynow"] to the form on DB
  "payments_channel": {
    "channel": "Stripe",
    "target_account_id": "acct_****",
    "publishable_key": "pk_test_****",
    "payment_methods": [
      "Paynow"
    ]
  },
  • Make a payment
  • Ensure that only payment method "Paynow" is available to be selected

@KenLSM KenLSM requested a review from wanlingt November 15, 2023 15:44
Copy link

linear bot commented Nov 15, 2023

FRM-1515 Backend restrict payment method to PayNow only

Description

Problem

Agencies do not want to offer cards as cards have higher fees, longer payout time and are subject to disputes.

Solution

Disable cards from backend when agencies request

We are not expecting multiple forms to have this toggled on, thus, db update will be sufficient.

@KenLSM KenLSM requested a review from justynoh November 16, 2023 15:11
Copy link
Contributor

@wanlingt wanlingt left a comment

Choose a reason for hiding this comment

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

lgtm! just one comment about Unset, I don't know what it's for

shared/types/payment.ts Outdated Show resolved Hide resolved
@KenLSM KenLSM enabled auto-merge (squash) November 26, 2023 17:35
@KenLSM KenLSM merged commit ed6e9e1 into develop Nov 26, 2023
20 of 22 checks passed
@KenLSM KenLSM deleted the feat/payment-paynow-only branch November 26, 2023 17:56
@KenLSM KenLSM mentioned this pull request Nov 28, 2023
26 tasks
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

2 participants