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: - charge_type (subclass of veritranspay.payment_types.PaymentTypeBase) – Account information against which to submit the charge.
- transaction_details (veritranspay.request.TransactionDetails) – Details about the charge being submitted, such as the total amount to bill.
- customer_details (veritranspay.request.CustomerDetails) – Personal details about the person being billed.
- item_details (iterable of veritranspay.request.ItemDetails) – Line item details for this transaction.
- 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¶
Warning
At the current time ONLY Credit Card payments are supported.
- class veritranspay.payment_types.CreditCard(bank, token_id)[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 (str) – Represents the acquiring bank.
- token_id (str) – A token retrieved from the Veritrans JavaScript library, after submitting the credit card details.
- 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
Represents a physical address somewhere in the world.
Parameters: - address (str <= 200) – Street address.
- city (str <= 20.) – City name.
- postal_code (str <= 10; numbers, hyphens ‘-‘, and spaces ‘ ‘) – Postal Code.
- first_name (str <= 20.) – Person given name.
- last_name (str <= 20.) – Person surname.
- phone (str 5 >=< 19; numbers, hyphens ‘-‘, parenthesis ‘()’, spaces ‘ ‘; can start with plus symbol ‘+’) – Phone number.
- country_code (str <= 10) – 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.