Requests

Request objects are passed to a Gateway object to perform an action or retrieve some data from the Veritrans API.

Request Types

class veritranspay.request.ChargeRequest(charge_type, transaction_details, customer_details, item_details=[])[source]

Bases: veritranspay.mixins.RequestEntity

All the information sent to Veritrans to request a customer be charged for a particular order.

Parameters:
class veritranspay.request.StatusRequest(order_id)[source]

Bases: veritranspay.mixins.ValidatableMixin

Request used to retrieve information about a single charge that has already been submitted to Veritrans.

Parameters:order_id (str <= 50) – The unique order id of the transaction.
class veritranspay.request.ApprovalRequest(order_id)[source]

Bases: veritranspay.mixins.ValidatableMixin

Approves a transaction that is currently in state ‘CHALLENGE’.

Parameters:order_id (str <= 50) – The unique order id of the transaction.
class veritranspay.request.CancelRequest(order_id)[source]

Bases: veritranspay.mixins.ValidatableMixin

Cancels a transaction. This can only be submitted if the transaction is currently still pending.

Parameters:order_id (str <= 50) – The unique order id of the transaction.

Sub Entities

Subentities are logically smaller components that are used to generate a request. Currently, sub-entities are only used when making a ChargeRequest.

Payment Types

class veritranspay.payment_types.CreditCard(bank, token_id, save_token_id=False)[source]

Bases: veritranspay.payment_types.PaymentTypeBase

A payment made with a credit card.

http://docs.veritranspay.co.id/sandbox/charge.html#vtdirect-cc

Parameters:
  • bank (six.string_types) – Represents the acquiring bank.
  • token_id (six.string_types) – A token retrieved from the Veritrans JavaScript library, after submitting the credit card details.
  • save_token_id (bool) – Used in conjunction with a 2-click to indicate whether or not this token is to be made reusable.
class veritranspay.payment_types.Indomaret(message)[source]

Bases: veritranspay.payment_types.PaymentTypeBase

Payment that must be completed at a later point in time by the customer at an Indomaret.

http://docs.veritrans.co.id/en/vtdirect/integration_indomrt.html

Parameters:message (six.string_types) – Label to be displayed in Indomaret POS
class veritranspay.payment_types.PaymentTypeBase[source]

Bases: veritranspay.mixins.SerializableMixin

Base type for all payment types. Not usable by itself.

Others

Note

These have no use beyond building a veritranspay.request.ChargeRequest.

class veritranspay.request.Address(address, city, postal_code, first_name=None, last_name=None, phone=None, country_code=None)[source]

Bases: veritranspay.mixins.RequestEntity

Sub-entity that represents a postal address.

Parameters:
  • address (six.string_types) – (200 chars max) Street address.
  • city (six.string_types) – (20 chars max) City name.
  • postal_code (six.string_types) – (10 chars max; numbers, hyphens, spaces) Postal Code.
  • first_name (six.string_types) – (20 chars max; Optional) Person given name.
  • last_name (six.string_types) – (20 chars max; Optional) Person surname.
  • phone (six.string_types) – (5 to 19 chars; numbers, hyphens, parenthesis, spaces, plus symbol; Optional) Phone number.
  • country_code (six.string_types) – (10 chars max; Optional) ISO-3166 alpha-3 country code.
class veritranspay.request.CustomerDetails(first_name, last_name, email, phone, billing_address=None, shipping_address=None)[source]

Bases: veritranspay.mixins.RequestEntity

Personal information about a customer.

Parameters:
  • first_name (str <= 20.) – Person given name.
  • last_name (str <= 20.) – Person surname.
  • email (str <= 45; Must be a valid e-mail.) – Person’s contact e-mail address.
  • billing_address (veritranspay.request.Address) – Address used to validate the charge.
  • shipping_address (veritranspay.request.Address) – Address where order should be shipped.
class veritranspay.request.TransactionDetails(order_id, gross_amount)[source]

Bases: veritranspay.mixins.RequestEntity

Basic information about a transaction with a customer, including the order id and the total amount the customer should be charged.

Parameters:
  • order_id (str <= 50) – UNIQUE order identifier.
  • gross_amount (int) – Total amount the customer will be charged.
class veritranspay.request.ItemDetails(item_id, price, quantity, name)[source]

Bases: veritranspay.mixins.RequestEntity

Line items details for a transaction.

Parameters:
  • item_id (str <= 50) – Identifier for a given item.
  • price (int) – Unit price for a given item.
  • quantity (int) – Number of units purchased.
  • name (str <= 50) – Human-readable identifier for product.