better-payment / bp-plugin-shopware6-api2

Shopware 6 Plugin for Better Payment API2
Other
0 stars 0 forks source link

Support captures and capturing in context of BNPL(buy now pay later processes). #71

Closed gadimbaylisahil closed 1 year ago

gadimbaylisahil commented 1 year ago

Problems

  1. When creating an invoice payment, the state stays in pending. This invoices has to be captured manually by the merchants.

  2. Some merchants wants their invoices to be captured when state of the shipping changes to shipped(or whatever is the term in shopware 6).

Solution

  1. Provide a captures card for order just like we have for refunds.
  1. Configuration option in Invoice B2C and B2B payment methods separately

Configuration option should be named:

Configuration option should have informative text:

When order's shipping state changes to shipped, plugin will automatically capture the order's transaction in API. You can also capture transactions manually, by turning this flag off.

Unclear parts

What happens when order is shipped partially? Do we calculate shipped products' amounts and send capture request with that amount?

This only applies to automatic capturing. Manual captures are in control of merchants anyway.

How to capture?

  1. Create an Invoice B2C or Invoice B2B transaction.
  2. Transaction will now be in pending state.
  3. Only autorized, pending or completed state transactions can be captured. Over captures are possible.
  4. Capture the transaction with an amount.
  5. Expect successful result
  6. Transaction #show request now should contain captured amount.
hasanzade-hasan commented 1 year ago

Following is result of call with Neeme.

Creating an invoice calls capture with:

The rest of the magic will happen inside the BP API. Crefo wants to know the payment period / due date, but since Shopware doesn't keep track of that, we'll store the value in our dashboard for the first version.