Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
How do I add subscription cancellation to paypal in future date?

I am looking for a way to implement future date cancellation to paypal subscription, can't find it in their docs nor anywhere. I want it to work like that so when we have 14 days or less before subscription ends we cannot end the billing cycle this month (we are ending it the next month). It is working normally for cancellation in present time: here is the code so far.

    paypal.configure({
      mode: process.env.NODE_ENV === 'development' ? 'sandbox' : 'live',
      client_id: process.env.NODE_ENV === 'development' ? paypalConfig.sandboxClientId : paypalConfig.productionClientId,
      client_secret: process.env.NODE_ENV === 'development' ? paypalConfig.sandboxSecret : paypalConfig.productionSecret
    });
    const cancelBillingAgreementSync = Meteor.wrapAsync(paypal.billingAgreement.cancel, paypal.billingAgreement);

    const getBillingAgreementSync = Meteor.wrapAsync(paypal.billingAgreement.get, paypal.billingAgreement);
    try {
      const oldBillingAgreement = getBillingAgreementSync(user.billing.paypalBillingAgreementId);
      if (oldBillingAgreement && oldBillingAgreement.state && oldBillingAgreement.state.toLowerCase() === 'active') {
        cancelBillingAgreementSync(user.billing.paypalBillingAgreementId, { note: 'Plan cancellation' });
        if (manual) {
          Meteor.users.update(Meteor.userId(), { $set: { 'plan.cancelled': true } });
        }
      }
    } catch (err) {
      console.error(err);
      throw new Meteor.Error(err.code || err.type || 500, err.message || err.reason);
    }```
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you are integrating the current version of PayPal Subscriptions, billing agreements are not used. Subscriptions will bill according to the Plan you specify.

Subscriptions can always be cancelled by the payer, so you need to bill ahead. There is no way to "prevent" one from being cancelled during the last 14 days, nor will there ever be any guarantee that the next payment will bill successfully.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda