SEPA Direct Debit
Vaulting
A payment method represents transactable payment information such as a customer's authorization to charge a SEPA Direct Debit account. Payment methods belong to a customer, are securely stored in the Braintree Vault, and have a payment_method_token attribute that you can store on your servers (with reduced PCI compliance burden) and later use to create transactions.
Create
Use Payment Method: Create
to create a payment method for an existing customer using a payment method nonce received from the client:
- Ruby
result = gateway.payment_method.create(
:customer_id => "131866",
:payment_method_nonce => nonce_from_the_client
)
Alternatively, you can create a new customer with a payment method using Customer: Create
with the payment_method_nonce parameter.
Once successfully created, you can use Transaction: Sale
with the payment_method_token parameter to create a transaction.
Find
Use Payment Method: Find
to find a payment method:
- Ruby
payment_method = gateway.payment_method.find("token")
If the payment method can't be found, it will raise a Braintree::NotFoundError
.
The return value of the Payment Method: Find
call will be a PaymentMethod
response object.
Delete
Use Payment Method: Delete
to delete a payment method:
- Ruby
result = gateway.payment_method.delete("the_token")
result.success?
# true
If the payment method can't be found, it will raise a Braintree::NotFoundError
.
- Ruby
result = gateway.payment_method.delete("the_token")
result.success?
# true
If the payment method can't be found, it will raise a Braintree::NotFoundError
.
Next Page: Testing and Go Live →