augustin-wien / augustina-backend

An open-source web shop designed for selling magazines on the street.
GNU Affero General Public License v3.0
4 stars 0 forks source link

Use marshmallow for failsave json unmarshal #123

Closed nanu-c closed 10 months ago

nanu-c commented 10 months ago

Type of change

Description

IMPORTANT TO KNOW

This can be tested now via Swagger for example on /webhooks/vivawallet/success/ with this sample JSON code

{
  "CorrelationId": "string",
  "Created": "2006-01-02T15:04:05Z",
  "Delay": "string",
  "newParameter": "string",
  "EventData": {
    "acquirerApproved": true,
    "amount": 0,
    "assignedMerchantUsers": [
      "string"
    ],
    "assignedResellerUsers": [
      "string"
    ],
    "authorizationID": "string",
    "bankID": "string",
    "billID": "string",
    "binID": 0,
    "cardCountryCode": "string",
    "cardExpirationDate": "string",
    "cardIssuingBank": "string",
    "cardNumber": "string",
    "cardToken": "string",
    "cardTypeID": 0,
    "cardUniqueReference": "string",
    "channelID": "string",
    "clearanceDate": "string",
    "companyName": "string",
    "companyTitle": "string",
    "connectedAccountID": "string",
    "currencyCode": "string",
    "currentInstallment": 0,
    "customerTrns": "string",
    "digitalWalletID": "string",
    "dualMessage": true,
    "electronicCommerceIndicator": "string",
    "email": "string",
    "externalTransactionID": "string",
    "fullName": "string",
    "insDate": "string",
    "isManualRefund": true,
    "latitude": "string",
    "longitude": "string",
    "loyaltyTriggered": true,
    "merchantCategoryCode": 0,
    "merchantID": "string",
    "merchantTrns": "string",
    "moto": true,
    "orderCode": 0,
    "orderCulture": "string",
    "orderServiceID": 0,
    "panEntryMode": "string",
    "parentID": "string",
    "phone": "string",
    "productID": "string",
    "redeemedAmount": 0,
    "referenceNumber": 0,
    "resellerCompanyName": "string",
    "resellerID": "string",
    "resellerSourceAddress": "string",
    "resellerSourceCode": "string",
    "resellerSourceName": "string",
    "responseCode": "string",
    "responseEventID": "string",
    "retrievalReferenceNumber": "string",
    "serviceID": "string",
    "sourceCode": "string",
    "sourceName": "string",
    "statusID": "string",
    "switching": true,
    "systemic": true,
    "tags": [
      "string"
    ],
    "targetPersonID": "string",
    "targetWalletID": "string",
    "terminalID": 0,
    "tipAmount": 0,
    "totalFee": 0,
    "totalInstallments": 0,
    "transactionID": "string",
    "transactionTypeID": 0,
    "ucaf": "string"
  },
  "EventTypeId": 0,
  "MessageId": "string",
  "MessageTypeId": 0,
  "RecipientId": "string",
  "Url": "string"
}

CHANGES

TODO

Checklist:

lebe1 commented 10 months ago

Hey @nanu-c, maybe you test this once in your local swagger as described above and if you think everything is fine you merge it?

nanu-c commented 10 months ago

I have tried it with your json on the current main and on this branch and it seems to be fixed!