Skip to content

[Bug] Shipping callbacks not supported for flow: venmo #810

Description

@NTICompass

Library used

PayPal v6 via paypal-js

import { loadCoreSdkScript } from '@paypal/paypal-js/sdk-v6';

const paypalScript = await loadCoreSdkScript({ environment: 'sandbox' });

const paypalSdk = await paypalScript.createInstance({
    clientId: paypalClientId,
    components: ['paypal-payments', 'venmo-payments'],
    pageType: 'checkout',
});

🐞 Describe the Bug

I am adding PayPal and Venmo buttons to my checkout flow. I got everything working with createPayPalOneTimePaymentSession().

I tried to use createVenmoOneTimePaymentSession(), but got an error: shipping callbacks not supported for flow: venmo.

The docs say, and I quote:

The parameters are identical to createPayPalOneTimePaymentSession. Venmo sessions support the same callbacks and flow options.

🔬 Minimal Reproduction

The buttons:

<div class="tw-mb-2 tw-grid tw-grid-cols-1 tw-gap-2 min-[468px]:tw-grid-cols-2">
    <paypal-button
        type="checkout"
        class="paypal-gold tw-h-[42px] tw-w-full"
        @click="initPaypal"
    ></paypal-button>
    <venmo-button
        type="checkout"
        class="venmo-blue tw-h-[42px] tw-w-full"
        @click="initVenmo"
    ></venmo-button>
</div>

The JavaScript:

{
    get payPalOptions() {
        return {
            async onShippingAddressChange({orderId, shippingAddress}) {},
            async onShippingOptionsChange({orderId, selectedShippingOption}) {},
            async onApprove({orderId}) {}
            onCancel() {}
        };
    },

    async initPaypal() {
        await paypalSdk.createPayPalOneTimePaymentSession(this.payPalOptions).start({ presentationMode: 'auto' }, this.getPaypalOrderId());
    },

    async initVenmo() {
        await paypalSdk.createVenmoOneTimePaymentSession(this.payPalOptions).start({ presentationMode: 'auto' }, this.getPaypalOrderId());
    },
}

😕 Actual Behavior

Venmo does not open, saying shipping callbacks not supported for flow: venmo.

🤔 Expected Behavior

The docs say:

Venmo sessions support the same callbacks and flow options.

So, I would assume that Venmo supports onShippingAddressChange and onShippingOptionsChange. I would assume that I wouldn't need to change the code to support Venmo.

🌍 Environment

  • @paypal/paypal-js: 9.2.0
  • OS: Fedora 43 (KDE)
  • Zen 1.18.3b (Firefox 147.0.2)

➕ Additional Context

Both onShippingAddressChange and onShippingOptionsChange work fine with PayPal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions