xendit/xendit-node

customerNotificationPreference API_VALIDATION_ERROR

ShoichiIshida opened this issue · 8 comments

customer: { email: payer_email }, customerNotificationPreference: { "invoice_created": "email", },

"customer" works.
customerNotificationPreference does not work.

I also tried bellow types.

customerNotificationPreference: { invoice_created: "email", },

customerNotificationPreference: { invoiceCreated: "email", },

However all types did not work.

Hi @ShoichiIshida , the customerNotificationPreference is not a valid JSON. try to remove the , after email and you should be good to go

Hi @luminto17 , thank you. I remove the ,. but something went wrong.

I tried this code.

        customerNotificationPreference: {
          invoice_created: "email"
        },

Hi @ShoichiIshida , do you mind to share your full request payload or external ID and response payload? we can help to check what's wrong

@luminto17 Please check my full request payload.

      xd_data = {
        externalID: external_id,
        // payerEmail: payer_email,
        description: description,
        amount: plan.price,
        interval: RecurringPayment.Interval.Month, // 1 month
        intervalCount: 1,
        invoiceDuration: 259200, // 3day
        // shouldSendEmail: true,
        missedPaymentAction: 'STOP',
        successRedirectURL: req.body.successRedirectURL,
        failureRedirectURL: req.body.failureRedirectURL,
        customer: {
          email: payer_email
        },
        customerNotificationPreference: {
          invoice_created: "email"
        },
        reminderTimeUnit: "days",
        remiderTime: 1
      }

Thank you @ShoichiIshida . invoice_created should be an array

Try this and see if it works?

customerNotificationPreference: {
          invoice_created: ["email"]
        },

@luminto17 Thank you for your reply. It works!!

perfect, awesome! let us know if you need any help 😄