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

Stripe FDW: Adding checkout sessions #98

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

kav
Copy link
Contributor

@kav kav commented May 26, 2023

What kind of change does this PR introduce?

Adding checkout sessions to the Stripe FDW. For those wondering why this object before others, my particular use case needs to get at custom field data captured on checkout. Happy to help build out more objects once I make sure I'm doing this correctly.

This PR is currently WIP. I need to resolve running the tests locally, and documentation updates. So far I'm getting errors that indicate no data when running. Documentation on testing under contrib is out of date as well

docker-compose -f wrappers/.ci/docker-compose.yaml up -d
cargo pgx test pg15 --features stripe_fdw

What is the current behavior?

Not implemented

What is the new behavior?

Enables

create foreign table stripe.checkout_sessions (
  id text,
  customer text,
  payment_intent text,
  subscription text,
  attrs jsonb
)
  server stripe_server
  options (
    object 'checkout/sessions',
    rowid_column 'id'
  );

@burmecia
Copy link
Member

@kav Thank you for the PR! Just let know once this is ready. And for local development, it might be the Stripe mock service doesn't have that data, could you try it using a real Stripe account?

@kav kav force-pushed the stripe-fdw-checkout-sessions branch from b2b6233 to ee43bd8 Compare May 30, 2023 22:51
@kav
Copy link
Contributor Author

kav commented May 30, 2023

Looks great on a real account. The mock endpoint doesn't have customer, intent, or subscription on that mock so I removed that test and left the id test.

{
  "data": [
    {
      "after_expiration": null,
      "allow_promotion_codes": null,
      "amount_subtotal": null,
      "amount_total": null,
      "automatic_tax": {
        "enabled": false,
        "status": null
      },
      "billing_address_collection": null,
      "cancel_url": "https://example.com/cancel",
      "client_reference_id": null,
      "consent": null,
      "consent_collection": null,
      "currency": null,
      "customer": null,
      "customer_creation": null,
      "customer_details": null,
      "customer_email": null,
      "expires_at": 1234567890,
      "id": "cs_test_a1DmlfbOPqmbKHfpwpFQ0RM3pVXmKoESZbJxnKrPdMsLDPPMGYtEBcHGPR",
      "livemode": false,
      "locale": null,
      "metadata": {},
      "mode": "payment",
      "object": "checkout.session",
      "payment_intent": "pi_1Lb4lVDciZwYG8GP0fdnQDdd",
      "payment_link": null,
      "payment_method_collection": null,
      "payment_method_options": {},
      "payment_method_types": [
        "card"
      ],
      "payment_status": "unpaid",
      "phone_number_collection": {
        "enabled": false
      },
      "recovered_from": null,
      "setup_intent": null,
      "shipping_address_collection": null,
      "shipping_cost": null,
      "shipping_details": null,
      "shipping_options": [],
      "status": "expired",
      "submit_type": null,
      "subscription": null,
      "success_url": "https://example.com/success",
      "total_details": null,
      "url": null
    }
  ],
  "has_more": false,
  "object": "list",
  "url": "/v1/checkout/sessions"
}

@kav kav changed the title Stripe FDW: WIP adding checkout sessions Stripe FDW: Adding checkout sessions May 30, 2023
@kav
Copy link
Contributor Author

kav commented May 31, 2023

@burmecia should be ready to go. Let me know if it needs anything else

Copy link
Member

@burmecia burmecia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR!

22. [Transfers](https://stripe.com/docs/api/transfers/list) (*read only*)

### Wrapper
1. [Accounts](https://stripe.com/docs/api/accounts/list) (*read only*)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this list number correct?

@burmecia burmecia merged commit 19bebb5 into supabase:main Jun 1, 2023
@kav kav deleted the stripe-fdw-checkout-sessions branch June 1, 2023 01:42
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

Successfully merging this pull request may close these issues.

2 participants