mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
* Reflect new amount for returned/reverted transaction. * Enhance payout and transfer response structures with transaction IDs and pending transaction IDs; * Update payment creation logic to utilize new fields. * Remove periodic execution of fetch_payments * Update ParentReference and Reference fields in payment model for transfer creation * Update pkg/client/ * Set return payment to SUCCEEDED, remove adjustment update * trigger ready for review * retrigger CI * Reuse Refund functionality instead of created Returned upsert operation * fix: ensure PendingTimeline and DeclinedTimeline are preserved in payments state test: add unit test to preserve timeline states in FetchNextPayments * Retrigger CI --------- Co-authored-by: gitstart_bot <[email protected]>
33 lines
797 B
Go
33 lines
797 B
Go
package increase
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
|
|
"github.com/formancehq/payments/internal/connectors/plugins/public/increase/client"
|
|
"github.com/formancehq/payments/internal/models"
|
|
)
|
|
|
|
func (p *Plugin) uninstall(ctx context.Context, req models.UninstallRequest) (models.UninstallResponse, error) {
|
|
webhooks, err := p.client.ListEventSubscriptions(ctx)
|
|
if err != nil {
|
|
return models.UninstallResponse{}, err
|
|
}
|
|
|
|
for _, webhook := range webhooks {
|
|
if !strings.Contains(webhook.URL, req.ConnectorID) {
|
|
continue
|
|
}
|
|
|
|
es := &client.UpdateEventSubscriptionRequest{
|
|
Status: eventSubscriptionStatusDeleted,
|
|
}
|
|
|
|
if _, err := p.client.UpdateEventSubscription(ctx, es, webhook.ID); err != nil {
|
|
return models.UninstallResponse{}, err
|
|
}
|
|
}
|
|
|
|
return models.UninstallResponse{}, nil
|
|
}
|