Payment - max-power/paymill-ruby GitHub Wiki

The Payment object represents a payment with a credit card or via direct debit. It is used for several function calls (e.g. transactions, subscriptions, clients, ...). To be PCI compliant these information is encoded by our Paymill PSP. You only get in touch with safe data (the token object) and needn’t to care about the security problematic of informations like credit card data.

Create new Credit Card Payment with …

… Token

Paymill::CreditCard.create(token: '098f6bcd4621d373cade4e832627b4f6')

… Token and Client

with_client_and_token = {
  token: '098f6bcd4621d373cade4e832627b4f6', 
  client: 'client_88a388d9dd48f86c3136' # optional
}
Paymill::CreditCard.create(with_client_and_token)

Create new Debit Payment with …

params = {
  type:    'debit',                     # TODO: remove this
  code:    '860555000',
  account: '1234512345',
  holder:  'Max Mustermann',
  client:  'client_88a388d9dd48f86c3136' # optional
}
Paymill::DirectDebit.create(params)

Payment Details

Returns data of a specific payment. Returns a Paymill::CreditCard or Paymill::DirectDebit Object

Paymill::Payment.find('pay_917018675b21ca03c4fb')

List Payments

Paymill::Payment.all

Remove Payment

Deletes the specified payment.

Paymill::Payment.delete('pay_3af44644dd6d25c820a8')

CreditCard & DirectDebit

payment = Paymill::Payment.first
payment.number # wrapper for last4 or account: returns a 16 digit masked number '**** **** **** 1234'
payment.holder # wrapper for holder or account_holder
payment.debit?
payment.creditcard?
payment.visa?
payment.mastercard?
⚠️ **GitHub.com Fallback** ⚠️