Meta object missing on Webhook Payload when using flutterwave-react-native pckage

I am using the flutterwave-react-native package to make payments from a mobile app. It works alright but in the webhook I set up, the payload I receive does not have the meta object I passed.

Do you know why this is?

Here is how the implementation is in react native

<PayWithFlutterwave
                    onRedirect={handleOnRedirect}
                    options={{
                      tx_ref: generateTransactionRef('online'),
                      authorization: 'PUBLIC-KEY',
                      customer: {
                        email,
                        name: fullname,
                      },
                      amount: 5000,
                      currency: 'NGN',
                      meta: {
                        ownerId: id,
                        isUser: true,
                        productName: safespace.name,
                        paymentType: 'transaction',
                      },
                    }}
                    customButton={(props) => (
                      <Pressable
                        onPress={props.onPress}
                        isBusy={props.isInitializing}
                        disabled={props.disabled}
                      >
                        <HStack py="8px" px="32px" space="16px">
                          <OnlineIcon />
                          <Text color="primary.700" fontWeight={500} fontSize="16px">
                            Pay Online
                          </Text>
                        </HStack>
                      </Pressable>
                    )}
                  />

And here is the payload that is returned on the webhook endpoint

{
  event: 'charge.completed',
  data: {
     id: 4604664,
     tx_ref: 'OLN_PAY_1695038391550',
     flw_ref: 'FLW-M03K-2273da3ff574bd960afa134660ffeb46',
     device_fingerprint: '*******',
     amount: 5000,
     currency: 'NGN',
     charged_amount: 5000,
     app_fee: 70,
     merchant_fee: 0,
     processor_response: 'Approved',
     auth_model: 'noauth-saved-card',
     ip: 'ip',
     narration: 'narration',
     status: 'successful',
     payment_type: 'card',
     created_at: '2023-09-18T12:00:41.000Z',
     account_id: 2231215,
     customer: {
        id: 2209698,
        name: 'victor mario',
        phone_number: '081****291',
        email: 'email@gmail.com',
        created_at: '2023-09-15T14:47:55.000Z'
      },
     card: {
        first_6digits: '553188',
        last_4digits: '2950',
        issuer: 'MASTERCARD  CREDIT',
        country: 'NG',
        type: 'MASTERCARD',
       expiry: '09/32'
     }
  },
'event.type': 'CARD_TRANSACTION'
}

@Adekunle here is a new thread regarding the issue I mentioned earlier.

Hi @Victor-mario_Umeh

The meta field passed in your payload can only be accessed in your Webhooks on request (to enable the preference). Therefore, if you want to access information you passed in the meta field of your request payload in subsequent Webhooks response, kindly provide your merchant ID ((located at the bottom left corner of your dashboard).

@Adekunle Thanks for your response.

Here is the merchant ID: 100401360

When should I expect this to work, so that I can verify?

Hi @Victor-mario_Umeh

Kindly provide the name and email of the account you are currently using, and confirm if you want this preference enabled on test mode or live mode.

I will remain on standby for this information

Hi @Adekunle

Kindly find the requested information

Name: InSync Health Solutions
Email: insynchello@gmail.com
merchant ID: 100401360

I would want this preference enabled on both test and live mode.

Thanks

Hi @Adekunle
I know this thread is focused on the metadata field preference but I will like to know if what you are working on in the backend isn’t affecting transfers from payout subaccounts to the account balance.

I tried initiating a transfer from a payout subaccount to the F4B account as suggested by the documentation but I keep getting the error below:

{
    "statusCode": "error",
    "status": "failed",
    "message": "Merchant not found"
}

I just started experiencing this recently (Yesterday and Today), so I was guessing maybe it had something to do with what you are doing on my account backend?

Hi @Victor-mario_Umeh

The preference that appends your meta information(passed in the meta field of your request payload) in your Webhook response has been enabled.

Hi @Victor-mario_Umeh

Kindly note that your test merchant ID is different from your live merchant ID, hence the error you encountered. Therefore, for subsequent transfers on Test mode from payout subaccounts to your F4B account balance, make use of your Test Mode Merchant ID passed as the “account_number”.

Test Merchant ID (InSync) : 200243934

Hi @Adekunle

This is awesome. Thanks for the help!!

@Adekunle I don’t think this is resolved.

I did a card transaction, a bank transfer and a USSD transaction, and I didn’t see any meta field in webhook payload response.

I carried this out on test mode.

What might be the issue here?

Hi @Victor-mario_Umeh

Apologies,

Here is an example Webhooks response with the appended meta information( Please note that this will result in a breaking change). Kindly confirm if you want us to go ahead and enable this preference on both Live and Test mode.

{
  "event": "charge.completed",
  "data": {
    "id": 1070307982,
    "tx_ref": "460d5be7-6aa2-424c-ba8c-62a212e1e403",
    "flw_ref": "100033230920183558000898669812",
    "device_fingerprint": "7c038dc508e9d601b59a058468b21d66",
    "amount": 10,
    "currency": "NGN",
    "charged_amount": 10,
    "app_fee": 0.14,
    "merchant_fee": 0,
    "processor_response": "success",
    "auth_model": "AUTH",
    "ip": "102.89.42.195",
    "narration": "test test",
    "status": "successful",
    "payment_type": "bank_transfer",
    "created_at": "2023-09-20T18:39:39.000Z",
    "account_id": 1834035,
    "customer": {
      "id": 678695450,
      "name": "test ",
      "phone_number": "08012345678",
      "email": "test@gmail.com",
      "created_at": "2023-09-20T18:00:03.000Z"
    }
  },
  "meta_data": {
    "__CheckoutInitAddress": "https://checkout.flutterwave.com/v3/hosted/pay",
    "sender": "deks",
    "user_name": "testing",
    "consumer_id": "23",
    "consumer_mac": "92a3-912ba-1192a",
    "originatorname": "Palmpay - test test",
    "bankname": "PALMPAY",
    "originatoramount": "90.00",
    "originatoraccountnumber": "806*******51",
    "remarks": "Overpaid"
  },
  "event.type": "BANK_TRANSFER_TRANSACTION"
}

I will remain on standby for your response

Hi @Adekunle

Kindly go ahead and enable this preference on both Live and Test mode.

Also, on live mode, since I will only using a virtual account to top up a payout subaccount (PSA), is there any information from the webhook event that can tell which PSA the top up belongs to?

Hi @Adekunle

I will like to confirm if this is fixed yet.

And also, can you please provide a response to the question above?

Thanks

Hi @Victor-mario_Umeh

The preference that appends your meta information(passed in the meta field of your request payload) in your Webhook response has been enabled both on Live and Test Mode.

Kindly confirm

Hi @Adekunle

I can confirm that the meta information passed in the meta field of my request payload is now returned in the Webhook response.

Thanks for your help.

I just need to clarify one more thing, and I will stop stressing you.
On live mode, since I will only be using a virtual account to top up a payout subaccount (PSA), is there any information from the Webhook response payload that can tell which PSA the top up belongs to? This information is important for my use case because I have a transaction table tied to users and top-up is a type of transaction we will need to record when a user performs that operation.

Hi @Victor-mario_Umeh

Happy you have gotten your initial request resolved.

Kindly refer back to the thread titled List of Webhook event types as I have address the question above

Regards

Hi. I am also having the same issue. I mean the meta field isn’t being returned in the Webhook response. Can you help me with this too?

Hi Emmanuel. Since webhooks are handled on the backend, I don’t think you should worry about the details returned in the webhook. Even if only the tx_ref is returned, that’s enough for you to handle the webhook. Simply fetch the transaction again using the tx_ref or transaction_id and you can proceed with the details of the transaction fetched. After all, flutterwave recommends cross-checking the details(amount and currency) in the webhook with the actual transaction details(which you can fetch on spot using the tx_ref or tx_id) before releasing value to the customer.