Skip to content

Persist card network

Mark Chao requested to merge 333177-add-credit-card-network into master

What does this MR do and why?

This MR creates a Rails enum column to store the received credit card network (passed from https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/3953).

The groupcompliance team and the security team have confirmed that this is compliant with PCI standard to store credit card network name.

Small integer column is chosen because there are only limited number of networks.

How to set up and validate locally

  1. Go to your Zuora sandbox's hosted page (similar to https://apisandbox.zuora.com/apps/HostedPageLite.do?method=preview&id=2c92c0f8791c3b2301791ee64f6c4b89)
  2. In CustomersDot, check out send-credit-card-type branch
  3. In CustomersDot, update secrets.yml zuora_cc_validation_payment_page_id to your new page id.
  4. In Gitlab, make sure Gitlab::SubscriptionPortal.subscriptons_url matches the hosted domain in the zuora page you created (which will probably be ngrok).
  5. Update https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/projects/settings/components/shared_runners_toggle.vue#L50-57 to always return true
  6. Restart gitlab
  7. Create a new user, activate it from Rails console
  8. Log in, create new project
  9. Go to its CI/CD settings page (e.g. http://localhost:3000/foo1/bar1/-/settings/ci_cd#js-runners-settings)
  10. Expand the runner pane, and click on the verification button
  11. Enter credit card details
  12. Verify successfully created Users::CreditCardValidation in gitlab instance, and the card network is persisted correctly.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #342682 (and its parent #333177)

Edited by Mark Chao

Merge request reports