reepay / reepay-woocommerce-payment

Reepay Woocommerce Payment Plugin
https://wordpress.org/plugins/reepay-checkout-gateway/
6 stars 10 forks source link

Subscriptions for virtual products Invoice error #159

Closed cpiechotta closed 1 year ago

cpiechotta commented 2 years ago

It is not possible for the customer to order a virtual subscription product the error: "API Error: Invoice has zero amount - amount must be greater than 0." is returned from Reepay (see below)

subscription_zero_amount_error

Redacted Log of an occurrance:

10-10-2022 @ 14:55:23 - WebHook: Initialized /wc-api/WC_Gateway_Reepay_Checkout/ from <REDACTED>
10-10-2022 @ 14:55:23 - WebHook: Post data: '{"id":"4928a4598cc90a505d5f7fc4d7738af9","timestamp":"2022-10-10T12:55:22.935Z","signature":"dc7071b17d582c3f3dfcea4605ed5d16388fbc9c678a324898d1d5edc1852d32","invoice":"order-MC-53301","customer":"cust-12326","transaction":"b9fe09db0301540733d450ab8f3c3f88","event_type":"invoice_settled","event_id":"7765a9024a27faf027d1c0556f3db438"}'
10-10-2022 @ 15:00:50 - Request: GET https://api.reepay.com/v1/invoice/order-MC-53879 []
10-10-2022 @ 15:00:50 - [0.1314] HTTP Code: 404. Response: {"code":31,"error":"Invoice not found","path":"/v1/invoice/order-MC-53879","timestamp":"2022-10-10T13:00:50.770+00:00","http_status":404,"http_reason":"Not Found","request_id":"15d40fa2133486f20d3ca6b83596bd65"}

<REQUEST PAYLOAD REDACTED>

10-10-2022 @ 15:00:50 - [0.1459] HTTP Code: 400. Response: {"code":145,"error":"Invoice has zero amount","message":"amount must be greater than 0","path":"/v1/session/charge","timestamp":"2022-10-10T13:00:50.933+00:00","http_status":400,"http_reason":"Bad Request","request_id":"d99e199e74a204b0c05d68283d5544d5"}

Invoices on virtual subscription products in general seem to return a 404 and are labelled on the WooCommerce order as "Invoice not found" under the product image in the respective orderline.