better-payment / bp-plugin-shopware6-api2

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

Webhook Processing #14

Closed gadimbaylisahil closed 1 year ago

gadimbaylisahil commented 1 year ago

Shops should handle incoming webhooks from Better Payment systems. Flow is simple - write a handler(controller action ?) to handle incoming webhooks.

This endpoint should be given when creating each transaction.


Incoming webhooks usually contain following body:

transaction_id=603cd960-5cb9-4947-9ab6-def2c190b499&status_code=3&status=completed&order_id=123000&message=Request%20successfully%20processed%20in%20%27Merchant%20in%20Connector%20Test%20Mode%27%20%28000.100.112%29&additional_transaction_data=&card_last_four=0000&card_expiry_year=2023&card_expiry_month=12&card_brand=VISA&card_type=&included_fees=0.00&checksum=0bd18b647c4d5caf65b71f37c40afb779bf1dadd
gadimbaylisahil commented 1 year ago

@hasanzade-hasan

Calculate checksum for the incoming webhook request: https://dashboard.betterpayment.de/docs/?php#checksum-legacy.

Remove checksum from body, calculate for the leftover parameters but with incoming key, following the function mentioned in the docs.