Repository navigation
Fill the gaps found in the 0.4.0 audit - #7
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6
Every change applies to
EpointClientandAsyncEpointClient, with tests for each.get_statusreturns a payment that ended in statuserror. The rule: onget_status, a 2xx response whose body hasstatus: "error"and atransactionfield is a payment state and comes back as aResponse. 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.okis also true for the B2BSUCCESSand the heartbeat'sok(OK_STATUSES).error,failed,server_errorandreturnedstay false.Callback.okstill checksSETTLED_STATUSES.create_token_split_paymentposts to/api/1/token/split-paymentwith the same arguments and defaults ascreate_split_payment.checkout_formreturns aCheckoutForm(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.is_installment(sent as 1 or 0, omitted when not given) oncreate_payment,checkout_formandcreate_payment_request;bulk_descriptiononcreate_bank_transfer;descriptionandother_attronget_installment_plans;other_attronpay_by_installment;tin,contract_numberandmerchant_order_idonupdate_invoice.Responseattributes: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.Callbackgains optionalbank_response,trace_idandcard_id.parse_b2b_webhookturns the B2B webhook body into aB2BWebhook. The README says the docs define no signature for it and to confirm withget_bank_transfer.Sandbox tests cover the
error,server_errorandreturnedstatuses, 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.