Inline Payment Methods in Transactions
Create payment methods inline during transaction processing
Payment methods can be provided inline in transaction creation requests, allowing you to process payments without separately creating and managing payment method objects. This approach simplifies one-time transactions while optionally allowing you to save the payment method for future use.
When to Use Inline Payment Methods
Use inline payment methods when customers don't need to save their payment details for future transactions:
- Guest checkout flows
- Single invoice payments
- One-time service payment
- Initial subscription purchases
Prerequisites
Before inline payment methods in transactions, familiarize yourself with these topics.
Learn about transactions
Understand transaction creation, types, and lifecycle before inline payment methods.
Learn about payment methods
Understand payment method types, validation, and security requirements.
Why use Inline Payment Methods
Payment details provided directly in transaction creation:
transaction = pl.Transaction.create(
type="payment",
amount=100.0,
sender={
"method": {
"type": "card",
"card": {
"card_number": "4111111111111111",
"expiry": "12/25",
"card_code": "123"
}
}
},
receiver={
"account_id": "acct_processing123"
}
)Benefits:
- Single API call for payment processing
- No orphaned payment method objects
- Simpler error handling
- Faster checkout for one-time payments
Limitations:
- Payment details must be collected for each transaction
- No payment method reuse without additional configuration
Inline Payment Methods
Create transactions with inline payment method details.
Inline card payment method
Process payments with inline card details:
Key Fields:
-
card_number- Full card number (16 digits for most cards) -
expiry- Expiration date in MM/YY format -
card_code- CVV/CVC security code (3-4 digits)
After processing, the transaction's sender.method contains the created payment method with
masked card details:
print(transaction.sender.method.description) # "Visa x-1111"
print(transaction.sender.method.id) # "pm_abc123"PCI Compliance: When inline card payment methods, ensure your integration is PCI DSS compliant. Never log or store raw card numbers, expiry dates, or CVV codes. Use tokenization or encryption for handling sensitive card data.
Inline bank account payment method
Process payments with inline bank account details:
Key Fields:
-
account_number- Bank account number -
routing_number- Bank routing number (9 digits) -
account_type- Eithercheckingorsavings
Bank account transactions process asynchronously. The initial transaction status is typically
pending and updates to processed or reject via webhook notifications:
print(transaction.status.value) # "pending"
print(transaction.sender.method.description) # "Checking x-6789"Reusing Inline Payment Methods
Inline payment methods are automatically saved for future use by default.
Using Saved Payment Methods
By default, inline payment methods remain active and can be reused (keep_active: true):
When payment methods are kept active (default behavior):
- Transaction processes with the inline payment method
- Payment method is automatically saved and assigned a unique ID
- Future transactions can reference the saved payment method ID
Schema Reference
Payment method fields used when inline in transactions:
Card Payment Method
card_number^[0-9]+$track1=nulltype=cardexpiry^(0[1-9]|1[0-2])([0-9]{2}|[0-9]{4})$card[track1]=nulltype=cardBank Account Payment Method
account_number^[0-9]+$routing_number^[0-9]+$account_typechecking, savingsAccount Holder Information
account_holderkeep_activeFor complete field documentation, see:
- Transaction API Reference - All transaction fields, properties, and methods
- Payment Method API Reference - All payment method fields and properties
Next Steps
Enhance payment processing and payment method management
Process Transactions
Use Payment API to process payments with inline payment methods, monitor Transaction Status to track processing, and set up Transaction Webhooks to receive real-time transaction updates for asynchronous bank payments.
Manage Payment Methods
Learn about Payment Methods for full payment method management, implement Payment Method Verification to validate bank accounts and cards, and use Testing Payment Methods to test payment flows with test data.
Handle Payment Scenarios
Handle Payment Declines to recover from declined payments, process Voids and Refunds to reverse and refund transactions, and set up Recurring Payments to implement automatic billing with saved payment methods.
Related articles
- Payment API - Transaction processing with payment methods
- Payment Methods - Payment method management
- Transaction Webhooks - Real-time transaction updates
- Transaction Status - Transaction lifecycle
- Transactions API Reference - Transaction API details
- Payment Methods API Reference - Payment method API details