Response

Response objects are generated by a gateway after data is sent back from Veritrans about a request. Response formats can vary depending on the type of error encountered from Veritrans, so the only two parameters that are required for ALL responses are status_code, and status_message. The rest are all purely optional (though unexpected parameters will be ignored).

To see the expected attributes for a given type of request, check the documentation at:

class veritranspay.response.response.ResponseBase(status_code, status_message, *args, **kwargs)[source]

Bases: veritranspay.mixins.SerializableMixin

Base class for all responses from Veritrans. The only two things we can be safely assured should be in every transaction are status_code and status_message.

Parameters:
  • status_code (str) – Transaction status code supplied by Veritrans.
  • status_message (str) – Human-readable status message.
class veritranspay.response.response.ChargeResponseBase(*args, **kwargs)[source]

Bases: veritranspay.response.response.ResponseBase

Encapsulates the response from Vertrans, returned after a veritranspay.request.ChargeRequest.

class veritranspay.response.response.CreditCardChargeResponse(*args, **kwargs)[source]

Bases: veritranspay.response.response.ChargeResponseBase

Response from Veritrans, returned after a veritrans.request.ChargeRequest with a charge type of veritrans.payment_types.CreditCard.

class veritranspay.response.response.IndomaretChargeResponse(*args, **kwargs)[source]

Bases: veritranspay.response.response.ChargeResponseBase

CStore charge response when using payment_type.Indomaret

http://docs.veritrans.co.id/en/vtdirect/integration_indomrt.html#response-transaction-indomrt

class veritranspay.response.response.StatusResponse(*args, **kwargs)[source]

Bases: veritranspay.response.response.ResponseBase

Encapsulates information about the status of a single charge. Returned from Veritrans after submitting a veritranspay.request.StatusRequest

class veritranspay.response.response.CancelResponse(*args, **kwargs)[source]

Bases: veritranspay.response.response.ResponseBase

Data returned from Veritrans after submitting a veritranspay.request.CancelRequest.

veritranspay.response.response.build_charge_response(request, *args, **kwargs)[source]

Builds a response appropriate for a given type of request.

Parameters:request (veritranspay.request.ChargeRequest) – The request that was submitted to Veritrans. The charge_type is used to determine the appropriate response type to build.
class veritranspay.response.response.ApproveResponse(*args, **kwargs)[source]

Bases: veritranspay.response.response.ResponseBase

Data returned from Veritrans after submitting a veritranspay.request.ApprovalRequest