Updating Payment Methods via Form
Learn how to build custom forms for updating payment method details with secure input fields
The Payment Method Form SDK allows you to update non-sensitive payment method details through secure, PCI-compliant forms. While card numbers and account numbers cannot be changed, you can update billing addresses, revalidate security codes (CVV/ZIP), and modify account holder information. This enables customers to keep their payment methods current without re-entering complete payment details.
For updating billing addresses, account defaults, and other fields via API, see Update Payment Methods API. For creating new payment methods, see Payment Method Form.
Prerequisites
Before building forms to update payment methods, it's helpful to learn about the following topics.
Learn about payment methods
Understand what payment method fields can and cannot be updated.
Payment method verification
Learn about CVV and ZIP code validation for payment security.
When to Use Update Forms
Use update forms when you need to modify non-sensitive payment method details through a customer-facing interface. Update forms are ideal for self-service account management where customers can maintain their own payment information without contacting support.
Common use cases
- Billing Address Updates: Customer moves or needs to correct their billing address
- CVV Revalidation: Verify card ownership for high-value transactions or subscription renewals
- ZIP Code Verification: Revalidate postal code for Address Verification System (AVS) checks
- Account Holder Corrections: Fix typos or update names after marriage or legal name changes
- Expired Card Updates: Update expiration dates without changing the card number
Immutable Fields: Card numbers, account numbers, and routing numbers cannot be changed. For security updates, CVV and ZIP can be collected for revalidation. To change card numbers or account numbers, create a new payment method.
Creating an Update Intent
Before displaying any update form, create an intent on your server that links to the existing payment method.
The intent:
- Links to the existing payment method via the
idfield - Returns a
tokenused to initialize the form - Allows updating non-sensitive fields (billing address, account holder, etc.)
- Supports optional CVV/ZIP revalidation
Pass the payment_method_id from your database or session to create the intent, then use the
returned token to initialize the update form on the frontend.
Updating Billing Address
Allow customers to update their billing address for AVS verification and accurate billing.
This example:
- Display: Shows form with existing address values that customer can modify
- Submission: Updates billing address on the existing payment method
- Validation: Verifies address format and updates the stored data
The form pre-fills with the current billing address, allowing customers to modify only the fields that changed.
Pre-filling Data: Always pre-fill the form with existing data so customers only need to change what's incorrect. This improves user experience and reduces form abandonment.
Revalidating CVV for Security
Require CVV revalidation for high-value transactions or subscription renewals without storing the CVV.
This example:
- Display: Shows secure CVV input field
- Validation: Verifies CVV matches the card on file
- Security: CVV is validated but never stored permanently
Use CVV revalidation to:
- Verify card ownership before high-value purchases
- Confirm payment method is still valid
- Prevent fraud on stored payment methods
- Meet compliance requirements for recurring billing
CVV Storage: CVV codes are never stored permanently. Revalidation verifies the CVV matches the card on file, then discards the value. This maintains PCI compliance while providing security verification.
Revalidating ZIP Code
Verify billing ZIP code for Address Verification System (AVS) checks.
This example:
- Display: Shows ZIP code input field
- Validation: Verifies ZIP matches billing address on file
- Update: Updates stored postal code if validation succeeds
ZIP code revalidation:
- Reduces fraud by confirming cardholder identity
- Improves AVS match rates for better authorization
- Ensures accurate billing address information
- Required for some high-risk transaction types
Updating Account Holder Name
Allow customers to update the name associated with their payment method.
This example:
- Display: Shows account holder input with current name
- Submission: Updates account holder name on payment method
Use cases:
- Correct typos in customer names
- Change business name for business cards
Combined Update Form
Create a comprehensive form that allows updating multiple fields simultaneously.
This example combines:
- Billing address updates
- Account holder name changes
- Optional CVV revalidation
- ZIP code verification
Combined forms provide better user experience by allowing customers to update all necessary information in one place.
Handling Update Events
Listen for form events to handle successful updates, validation errors, and user interactions.
Success Events
form.on('success', (evt) => {
console.log('Payment method updated:', evt.payment_method_id)
alert('Payment method updated/revalidated successfully!')
window.location.href = '/account/payment-methods'
})Validation Events
form.on('error', (evt) => {
console.error('Update failed:', evt.message, evt.error_description)
alert('Update failed: ' + evt.message)
})
form.on('invalid', (evt) => {
console.log('Invalid:', evt.message)
})Styling Secure Input Fields
You can style secure input fields to match your form's design. While secure inputs are rendered in isolated iframes for PCI compliance, the SDK provides ways to apply custom styling through CSS classes.
Payload provides default classes that you can style:
-
pl-input- Base input styling -
pl-input-sec- Secure field styling -
pl-focus- Focused input state -
pl-invalid- Invalid input state
Visual Feedback: Use distinct styling for pre-filled data versus editable fields to help users understand what they're updating. Apply clear focus and validation states to guide user input.
Schema Reference
Configuration options for payment method update intents:
Update Intent Configuration
payment_method_formpayment_method_templateaccount_defaultsfundingall, deposits, withdrawspayingall, payments, payoutsaccount_holderaccount_idbank_accountcurrencyUSD, CADbilling_addressaddress_line_1address_line_2citycountry_codepostal_codestate_provinceidtransfer_typesend_only, receive_only, two_wayFor complete field documentation, see:
- Payment Methods API Reference - All payment method fields and update operations
- Intents API Reference - Intent configuration and options
Next Steps
Enhance payment processing and payment method management
Process Transactions
Use Payment API to process payments with updated payment methods, set up Recurring Payments for subscriptions with updated methods, and send Payouts to updated bank accounts.
Manage Payment Methods
Update methods programmatically with Payment Method API, implement Payment Method Verification to verify updated payment methods, and explore Payment Methods for overview of management options.
Build Payment Interfaces
Create Payment Method Form for collecting new payment methods, build Payment Form for processing immediate payments, and integrate Checkout Plugin for complete checkout experiences.
Related articles
- Payment Methods - Overview of payment methods
- Update via API - Programmatic updates
- Payment Method Form - Create new payment methods
- Payment Method Verification - Verify payment methods
- Intents API Reference - Complete API reference