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(business_profile): feature add a config to use billing as payment_method_billing #4557

Conversation

Narayanbhat166
Copy link
Member

@Narayanbhat166 Narayanbhat166 commented May 6, 2024

Type of Change

  • New feature

Description

This PR adds support for a config which controls whether to use the billing as payment_method_billing. Based on this config the address is unified and accessed at the connector module. This also affects the payment method list to either populate or not populate the billing fields.

Additional Changes

  • This PR modifies the API contract
    A new field called use_billing_as_payment_method_billing is added to business profile create and update.

  • This PR modifies the database schema
    A new field called use_billing_as_payment_method_billing is added to business profile table.

Motivation and Context

Impact

  • Passing billing address to connectors.
  • Automatic filling of billing details in payment method list.

How did you test it?

  • Create a payment with default config, by passing billing details in payment.
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_3Ehos25h2Ro9Y6jh7wz3RTQHm4Hfk7xenFpl56S1BPZG3YsTzK8j1YHD9XhBdI46' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "confirm": true,
    "customer": {
        "id": "cus_abc",
        "email": "example@juspay.in"
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "Narayan",
            "last_name": "Bhat"
        }
    }
}'
  • The SDK will not collect any billing data ( for cybersource connector )
image
  • Disable the config for the business profile
curl --location 'http://localhost:8080/account/merchant_1714987557/business_profile/pro_nEF5mTQDHBMNbJejr85j' \
--header 'Content-Type: application/json' \
--header 'api-key: test_admin' \
--data '{
  "use_billing_as_payment_method_billing": false
}'
  • Now the SDK should collect all billing details from customer
image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code

@Narayanbhat166 Narayanbhat166 added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels May 6, 2024
@Narayanbhat166 Narayanbhat166 added this to the May 2024 Release milestone May 6, 2024
@Narayanbhat166 Narayanbhat166 self-assigned this May 6, 2024
@Narayanbhat166 Narayanbhat166 requested review from a team as code owners May 6, 2024 09:41
hrithikesh026
hrithikesh026 previously approved these changes May 6, 2024
ThisIsMani
ThisIsMani previously approved these changes May 7, 2024
Copy link
Contributor

@ThisIsMani ThisIsMani left a comment

Choose a reason for hiding this comment

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

Dashboard specific changes looks fine.

Aprabhat19
Aprabhat19 previously approved these changes May 7, 2024
Copy link
Contributor

@Aprabhat19 Aprabhat19 left a comment

Choose a reason for hiding this comment

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

Routing specific changes looks good

@Narayanbhat166 Narayanbhat166 changed the title feat(billing): feature add a config to use billing as payment_method_billing feat(business_profile): feature add a config to use billing as payment_method_billing May 7, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue May 8, 2024
Merged via the queue into main with commit 3e1c7eb May 8, 2024
12 of 15 checks passed
@likhinbopanna likhinbopanna deleted the 4833-feature-add-a-config-to-use-billing-as-payment_method_billing branch May 8, 2024 06:17
@Narayanbhat166 Narayanbhat166 added the M-database-changes Metadata: This PR involves database schema changes label May 9, 2024
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement M-database-changes Metadata: This PR involves database schema changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants