@paypal/paypal-js
    Preparing search index...

    Interface for PayPal legacy billing agreement functionality.

    This interface provides legacy billing agreement methods that should not be used for new implementations. Use the newer vault setup token approach with PayPalPaymentsInstance.createPayPalSavePaymentSession instead.

    Provides methods for creating billing agreements without requiring an immediate purchase. This legacy interface allows merchants to set up recurring payment agreements with customers that can be used for future transactions.

    // Legacy billing agreement setup (deprecated)
    const billingAgreementWithoutPurchaseSession = sdkInstance.createPayPalBillingAgreementWithoutPurchase({
    billingToken: 'your-billing-token',
    onApprove: (data) => {
    console.log('Billing agreement approved:', data);
    },
    onCancel: () => {
    console.log('Billing agreement canceled');
    },
    onError: (data) => {
    console.error('Billing agreement error:', data);
    }
    });

    // Start the billing agreement flow
    await billingAgreementWithoutPurchaseSession.start({
    mode: 'popup'
    });

    PayPalPaymentsInstance.createPayPalSavePaymentSession For the recommended modern approach

    interface PayPalLegacyBillingInstance {
        createPayPalBillingAgreementWithoutPurchase: (
            paymentSessionOptions: PayPalLegacyBillingAgreementsSessionOptions,
        ) => PayPalLegacyBillingAgreementsSession;
    }
    Index

    Properties

    createPayPalBillingAgreementWithoutPurchase: (
        paymentSessionOptions: PayPalLegacyBillingAgreementsSessionOptions,
    ) => PayPalLegacyBillingAgreementsSession

    Creates a PayPal billing agreement session without requiring an immediate purchase.

    Type Declaration

    This method is legacy and should not be used for new implementations. Use the newer vault setup token approach with PayPalPaymentsInstance.createPayPalSavePaymentSession instead.

    This legacy method allows merchants to set up recurring payment agreements with customers that can be used for future transactions.

    const billingSession = sdkInstance.createPayPalBillingAgreementWithoutPurchase({
    billingToken: 'your-billing-token',
    onApprove: (data) => {
    console.log('Billing agreement approved:', data);
    },
    onCancel: () => {
    console.log('Billing agreement canceled');
    },
    onError: (data) => {
    console.error('Billing agreement error:', data);
    }
    });