Skip to content

Fill the gaps found in the 0.4.0 audit - #7

Merged
martian56 merged 1 commit into
mainfrom
feat/0.4.0-audit
Oct 20, 2026
Merged

martian56 merged 1 commit into
mainfrom
feat/0.4.0-audit

Conversation

@martian56

Copy link
Copy Markdown
Owner

Closes #6

Every change applies to EpointClient and AsyncEpointClient, with tests for each.

  • get_status returns a payment that ended in status error. The rule: on get_status, a 2xx response whose body has status: "error" and a transaction field is a payment state and comes back as a Response. Any other error body, such as an unknown transaction, and any 4xx or 5xx answer still raise. Every other method is unchanged. The README documents the rule.
  • Response.ok is also true for the B2B SUCCESS and the heartbeat's ok (OK_STATUSES). error, failed, server_error and returned stay false. Callback.ok still checks SETTLED_STATUSES.
  • create_token_split_payment posts to /api/1/token/split-payment with the same arguments and defaults as create_split_payment.
  • checkout_form returns a CheckoutForm (url, data, signature) for the browser form post to /api/1/checkout, signed like every other request, without making a request. The README shows an auto-submitting form.
  • New optional parameters: is_installment (sent as 1 or 0, omitted when not given) on create_payment, checkout_form and create_payment_request; bulk_description on create_bank_transfer; description and other_attr on get_installment_plans; other_attr on pay_by_installment; tin, contract_number and merchant_order_id on update_invoice.
  • Typed Response attributes: trace_id, code, bank_transaction, bank_response, operation_code, rrn, card_name, card_mask, amount (a float from a number or numeric string), card_id, order_id, widget_url.
  • Callback gains optional bank_response, trace_id and card_id.
  • parse_b2b_webhook turns the B2B webhook body into a B2BWebhook. The README says the docs define no signature for it and to confirm with get_bank_transfer.

Sandbox tests cover the error, server_error and returned statuses, token split payment (settles, and an unknown split user is refused), the checkout form post (303 to the card page, then paid and read back), and the invoice update fields coming back from invoices/view.

The version bump and changelog follow in a separate release PR.

get_status returns a payment that ended in status error, ok covers SUCCESS and the heartbeat, create_token_split_payment, checkout_form, the missing optional parameters, typed response fields, new callback fields and parse_b2b_webhook. Applies to EpointClient and AsyncEpointClient.

Closes #6
@martian56
martian56 merged commit 7e22ddd into main Oct 20, 2026
6 checks passed
@martian56
martian56 deleted the feat/0.4.0-audit branch October 20, 2026 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fill the gaps found in the 0.4.0 audit

1 participant