Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass an item reference to the Payment.get_purchased_items method? #404

Open
rtdev-com opened this issue Mar 27, 2024 · 0 comments
Open

Comments

@rtdev-com
Copy link

rtdev-com commented Mar 27, 2024

Can someone help me understand how to pass some sort of item reference to Payment.get_purchased_items?

  1. The get_purchased_items method does not take any input arguments except for self
  2. The BasePayment class does not have any item references either
    def get_purchased_items(self) -> Iterable[PurchasedItem]:
         # do we have item info here?
         item = get_item_from_somewhere()

        # Return items that will be included in this payment.
        yield PurchasedItem(
            name=item.name,
            sku=item.sku,
            quantity=1,
            price=item.price,
            currency='USD',
        )

This part is unclear to me from reading the documentation since the docs just hard code an item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant