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.RequestEntityAll 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.
- charge_type (subclass of
-
class
veritranspay.request.StatusRequest(order_id)[source]¶ Bases:
veritranspay.mixins.ValidatableMixinRequest 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.ValidatableMixinApproves 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.ValidatableMixinCancels 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.PaymentTypeBaseA 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.PaymentTypeBasePayment 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.SerializableMixinBase 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.RequestEntitySub-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.RequestEntityPersonal 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.
- first_name (
-
class
veritranspay.request.TransactionDetails(order_id, gross_amount)[source]¶ Bases:
veritranspay.mixins.RequestEntityBasic 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.
- order_id (
-
class
veritranspay.request.ItemDetails(item_id, price, quantity, name)[source]¶ Bases:
veritranspay.mixins.RequestEntityLine 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.
- item_id (