Transactions

Transactions are the basic objects in the Pencepay platform, which represent the money flow from your customers to you, and from you to your customers (e.g. in case of refunds).

Transaction object is returned on the create method call. Depending on the type of payment method, you will need to perform different steps after the create.

Card payments

For card payments, you need to capture or void authorized payments. In case you wish to return the funds to the customer, you should call the refund method.

Bank transfers

When attempting to collect a bank transfer payment from a customer create method will return a PaymentInstruction. Using this data you should present payment information to your customer, including any payment references and other bank details.

Other payment methods

For all other payment methods, after a Transaction.create you will receive URL and parameters for executing a POST to a third-party server, in order to redirect your customer to finish a transaction at that site.

Object properties

uid

Unique ID of the Customer in our system

live

Boolean describing if this transaction was live or testing.

amount

Amount of the transaction.

currencyCode

3-letter ISO 4217 currency code (e.g. EUR). See a list

orderId

ID of the order in your system. This property is very useful as it is shown in the Administration tool and various reports, so you can link your order with the payment transaction using it.

description

String describing the purchase to the customer, useful in various UIs.

approvalCode

Approval code generated by the acquirer (bank, third party etc.) when the transaction was approved.

redirectUrl

If using a payment method which requires a redirect to provider page, this is an URL to which you will receive a synchronous outcome (browser redirect).

cancelUrl

If using a payment method which requires a redirect to provider page, this is an URL to which customer will be redirected if he chooses to cancel a payment.

failureCode

Integer code describing the reason of transaction failure.

failureMessage

Message describing the reason of transaction failure.

created

Object creation timestamp

Types

paymentMethod

Payment method of the transaction.

status

Status of the transaction.

Relations

customer

Customer object

billingAddress

Address object

card

CreditCard object

tags

List of Tags associated with this transaction.

customData

Map (Dictionary) of the custom data field and values which you provided