Payment
Representa a un Pago.
Modelo Payment
{
"id": 488,
"options": 31,
"payload": [
{
"input": {
"question": "Banco origen",
"required": true,
"hint": "Mercantil",
"regex": "^.+^",
"type": "bank",
"answer": "Mercantil"
}
},
{
"input": {
"question": "Número de operación",
"required": true,
"hint": "0000000",
"regex": "^[0-9]+^",
"type": "numeric",
"answer": "13215"
}
},
{
"input": {
"question": "Teléfono emisor del pago",
"required": true,
"hint": "+00 000 0000000",
"regex": "^[0-9]+^",
"type": "numeric",
"answer": "584121198667"
}
},
{
"input": {
"question": "Fecha de pago",
"required": true,
"hint": "00/00/0000",
"regex": "^([0-2][0-9]|(3)[0-1])(\/)(((0)[0-9])|((1)[0-2]))(\/)\d{4}^",
"type": "date",
"answer": "04/05/2020"
}
},
{
"file": {
"question": "Captura de pantalla",
"required": false,
"type": "file",
"allowed_types.0": "image/jpeg",
"allowed_types.1": "image/png",
"allowed_types.2": "application/pdf",
"answer": "http://127.0.0.1:8000/storage/companies/69/form/form_149_4_1588638445.png",
"file_type": "image/png"
}
},
{
"input": {
"question": "Descripción",
"required": false,
"hint": "Observación",
"regex": "^.+^",
"type": "text_area",
"answer": "asd"
}
}
],
"total_e2": 228000,
"order_e2": 228000,
"tax_e2": 0,
"tip_e2": 0,
"created_at": "2020-05-05 00:27:25",
"updated_at": "2024-05-31 14:42:04",
"order_id": 1547,
"provider_id": null,
"client_id": 43,
"company_id": 116,
"branch_id": 41,
"uid": "custom:488",
"payment_tax_e2": 0,
"is_visible": true,
"is_branch_gateway": false,
"type": "pago-movil",
"action_performed_at": null,
"status_code": 15,
"agent_code": 1,
"data": {
"order": {
"id": 1547,
"number": 1,
"uid": "011-0000001"
},
"client": {
"id": 43,
"name": "Pedro Parra",
"display_name": "user_196",
"email": "pedromiguelp18@gmail.com"
},
"transaction": {
"currency": "USD",
"sub_total": 228000,
"tax": 0,
"total": 228000
}
},
"gateway": {
"debug": null
},
"transaction": {
"currency": "USD",
"subtotal_e2": 228000,
"subtotal": "2,280.00$",
"order_tax_e2": 0,
"order_tax": "0.00$",
"tip_e2": 0,
"tip": "0.00$",
"payment_tax_e2": 0,
"payment_tax": "0.00$",
"total_e2": 228000,
"total": "2,280.00$",
"related_currency": "USD",
"total_related": "2,280.00$"
},
"order_status": "successful",
"portal": "custom",
"method_name": "pago móvil",
"related_payment_name": "Pago Móvil",
"status": "successful",
"warning_message": null
}
Atributo |
Tipo |
Descripción |
id |
int |
- |
options |
int |
- |
payload |
array\|null |
- |
total_e2 |
int |
- |
order_e2 |
int |
- |
tax_e2 |
int |
- |
tip_e2 |
int |
- |
created_at |
datetime\|null |
- |
updated_at |
datetime\|null |
- |
order_id |
int |
- |
client_id |
int\|null |
- |
company_id |
int |
- |
branch_id |
int\|null |
- |
uid |
string\|null |
- |
payment_tax_e2 |
int |
- |
is_visible |
bool |
- |
is_branch_gateway |
bool |
- |
type |
string\|null |
- |
status_code |
int |
BitMask ({@link self::options} & 0xf) |
agent_code |
int |
BitMask (({@link self::options} & 0xfff0) >> 4) |
is_status_pending |
bool |
BitMask (({@link self::options} & 0xf) === 1) |
is_status_waiting_for_taking_effect |
bool |
BitMask (({@link self::options} & 0xf) === 2) |
is_status_prepared |
bool |
BitMask (({@link self::options} & 0xf) === 3) |
is_status_ready_to_charge |
bool |
BitMask (({@link self::options} & 0xf) === 4) |
is_status_requires_confirmation |
bool |
BitMask (({@link self::options} & 0xf) === 5) |
is_status_canceled_by_client |
bool |
BitMask (({@link self::options} & 0xf) === 10) |
is_status_refused_expired |
bool |
BitMask (({@link self::options} & 0xf) === 11) |
is_status_refused_invalid |
bool |
BitMask (({@link self::options} & 0xf) === 13) |
is_status_refused_duplicated |
bool |
BitMask (({@link self::options} & 0xf) === 14) |
is_status_confirmed |
bool |
BitMask (({@link self::options} & 0xf) === 15) |
is_agent_custom |
bool |
BitMask (({@link self::options} & 0x10) !== 0) |
is_agent_paypal |
bool |
BitMask (({@link self::options} & 0x20) !== 0) |
is_agent_stripe |
bool |
BitMask (({@link self::options} & 0x40) !== 0) |
is_agent_instapago |
bool |
BitMask (({@link self::options} & 0x80) !== 0) |
is_agent_zelle |
bool |
BitMask (({@link self::options} & 0x100) !== 0) |
is_agent_post_payment |
bool |
BitMask (({@link self::options} & 0x200) !== 0) |
is_agent_coupon |
bool |
BitMask (({@link self::options} & 0x400) !== 0) |
is_agent_balance |
bool |
BitMask (({@link self::options} & 0x800) !== 0) |
is_agent_bdv |
bool |
BitMask (({@link self::options} & 0x1000) !== 0) |
is_agent_payco |
bool |
BitMask (({@link self::options} & 0x2000) !== 0) |
is_agent_binance |
bool |
BitMask (({@link self::options} & 0x4000) !== 0) |
data |
array |
- |
gateway |
array\|null |
- |
method_name |
string\|null |
- |
order_status |
string |
- |
portal |
string |
- |
transaction |
array |
- |
related_payment_name |
string |
- |
status |
string |
- |
Insertar Payment
Insertar Payment de Order
Registra un pago
Al registrar un pago, el payload varía según el tipo de pago:
-
stripe
:
"payment_method_id": "nullable|string|max:255"
-
pos
:
{
"authorization": "required_with:message|string|max:16",
"batch": "required_with:message|string|max:16",
"date": "required_with:message|string",
"time": "required_with:message|string",
"dni": "required_with:message|string",
"merchant_id": "required_with:message|string",
"message": "required_without:error_code|string",
"pan": "required_with:message|string",
"receipt": "required_with:message|string",
"response_code": "required_with:message|string",
"stan": "required_with:message|string",
"terminal_id": "required_with:message|string",
"error_code": "nullable|string|min:2",
"error_message": "required_with:error_code|string|max:128",
"error_at": "required_with:error_code|date"
}
-
banco_de_venezuela
:
{
"email": "required|email:rfc,filter",
"phone": "required|string:min:8",
"dni": "required|integer",
"dni_letter": "required|string|in:V,E,P"
}
-
binance
:
{
"terminal_type": "string|in:IOS,ANDROID,WEB"
}
-
bancamiga_ci
:
{
"payout_index" => "required|integer|min:0",
"debug_amount" => "integer|min:1",
}
Sin parámetros adicionales:
paypal
instapago
zelle
payco
balance
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/payments |
Authorization |
{
"type": "required|string|max:32|in:paypal,instapago,zelle,payco,stripe,balance,pos,banco_de_venezuela,binance,bancamiga_ci,post-payment",
"order_e2": "required|integer|min:0",
"tax_e2": "integer",
"tip_e2": "integer|min:0",
"currency_to_use": "string|min:3|max:8",
"payment_identifier": "integer|min:0"
}
Store a newly created resource in storage.
Método |
URI |
Cabeceras |
POST |
/companies/{companyId}/orders/{orderId}/payments/report |
Authorization |
{
"type": "required|integer|min:2|max:20",
"updated_at": "required_with:form|date",
"values": [
{
"question_index": "required_with:form.values|integer|distinct",
"answer": "required_with:form.values"
}
],
"order_e2": "required|integer|min:0",
"tip_e2": "required|integer|min:0",
"payment_identifier": "integer|min:0"
}
Listar Payment
{info} Soporta:
Paginación
Filters
Carga dinámica
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/payments |
Authorization |
Listar Pending
{info} Soporta:
Paginación
Filters
Carga dinámica
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/payments/pending |
Authorization |
Listar Payment de Order
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/orders/{orderId}/payments |
Authorization |
Listar Payment de Branch
{info} Soporta:
Paginación
Filters
Carga dinámica
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/branches/{branchId}/payments |
Authorization |
Mostrar Payment
{info} Soporta:
Carga dinámica
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/payments/{paymentId} |
Authorization |
Actualizar Payment
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId} |
Authorization |
{
"order_e2": "required|integer|min:0",
"tax_e2": "integer",
"tip_e2": "integer|min:0"
}
Acciones de Payment
Calculate Debt For Amount
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/payments/calculate-debt |
Authorization |
Cancel
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId}/cancel |
Authorization |
Accept
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId}/accept |
Authorization |
{
"comment": "string|max:255"
}
Set Invalid
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId}/set-invalid |
Authorization |
Set Duplicated
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId}/set-duplicated |
Authorization |
Prepare
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId}/prepare |
Authorization |
Verify
Método |
URI |
Cabeceras |
PATCH |
/companies/{companyId}/payments/{paymentId}/verify |
Authorization |
Show Accepted
Shows the specified resource from storage.
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/orders/{orderId}/payments-accepted |
Authorization |
Calculate Debt
Método |
URI |
Cabeceras |
GET |
/companies/{companyId}/orders/{orderId}/calculate-debt |
Authorization |
Enlaces de Payment