Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Support for meta information while creating payment and more importantly with webhook event response #1320

Open
thinkstudeo opened this issue Dec 7, 2019 · 0 comments

Comments

@thinkstudeo
Copy link

thinkstudeo commented Dec 7, 2019

General information

This is not an issue but a request.

The current webhook event response does not have provision to return any meta information.

It would be nice to have a property/field for meta information when the payment is created for eg:

'meta' => [
    'cart_id' => 'SOMECARTID'
]

maybe via a setMeta()

public function setMeta(array $meta)
{
    $this->meta = array_merge($this->meta, $meta);
}

public function getMeta()
{
    return $this->meta;
}

/** 
  * Can then be used to add meta info when creating payment 
  * And then when webhook event response is returned
  * This meta info is returned in the event response
  */
$this->setMeta([
    'cart_id' => 'SOMECARTID',
    'order_no' => '123456'
]);

And then when a webhook is subscribed for eg: PAYMENT.CAPTURE.COMPLETED the webhook event response returns this meta information within the response.

{
    "meta": {
        "cart_id": "SOMECARTID",
        "order_id": 123456
    }
}

This would help in tracking down the record (database) corresponding to the captured event easily.

Currently the tracking has to be done via the payment/resource id returned by the webhook event response - which means to create one more index on the database on the payment_id column.

Ability to add and get meta information in webhook event response will help simplify the process of reconciliation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants