Skip to content

[Bug] CardFields submit callback takes an optional argument #649

Open
@jonty-comp

Description

@jonty-comp

Library used

paypal-js

🐞 Describe the Bug

In following the guide at https://developer.paypal.com/studio/checkout/advanced/integrate, and flowchart at https://www.paypalobjects.com/devdoc/HostedCardFields3Ds%20SequenceDiagram.png, I can see that the PayPalCardFieldsComponent.submit function can optionally take an object argument, notably the billing address for 3DS authentication. However, this is missing in the TypeScript definition.

🔬 Minimal Reproduction

As per the above integration code, in lines 63:87 of the example code:

cardField
  .submit({
    // From your billing address fields
    billingAddress: { ... }
  });

😕 Actual Behavior

TypeScript error: Expected 0 arguments, but got 1.

🤔 Expected Behavior

The example documentation says "Anything you pass into the submit function is sent to the iframe that communicates with the Orders API.", so maybe it is supposed to accept an object of anything, but it seems this is only used for sending the billing address across for 3DS, so perhaps it should rather accept only the format shown in the example?

If there is a different method by which to achieve the same end goal, please let me know.

🌍 Environment

  • Visual Studio Code / ts-server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions