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

Retrieve paddle subscription with options #890

Merged

Conversation

samuelmolinari
Copy link
Contributor

@samuelmolinari samuelmolinari commented Oct 29, 2023

The paddle gem accept the option extra when retrieving a subscription.

See: https://github.com/deanpcmad/paddle/blob/83120a9e285cfb5daf36f7f56939e985ab029843/lib/paddle/models/subscription.rb#L11

What this PR allows us to do:

subscription.processor_subscription(extra: 'next_transaction')

The paddle gem accept the option `extra` when retrieving a subscription.

See: https://github.com/deanpcmad/paddle/blob/83120a9e285cfb5daf36f7f56939e985ab029843/lib/paddle/models/subscription.rb#L11

This change allows Pay::Subscription#processor_subscription
to pass options to ::Paddle::Subscription.retrieve
@samuelmolinari
Copy link
Contributor Author

samuelmolinari commented Oct 29, 2023

I've noticed this is not exactly what I wanted to achieve. processor_subscription can be called on a Pay::Subscription , and that's where we should be able to pass the wanted options:

subscription.processor_subscription(extra: 'next_transaction')

Similar to how it's implemented on Pay::Stripe::Subscription (

def subscription(**options)
)

I'll work on that to complete this PR

Edit: Done ✅ 87983ce

It enables the following:

```ruby
subscription.processor_subscription(
  extra: 'next_transaction'
)
```
@excid3
Copy link
Collaborator

excid3 commented Nov 6, 2023

Maybe we should just include these extras by default? I guess we aren't using them currently, so probably just slows API requests if we do.

@excid3 excid3 merged commit 5831d3e into pay-rails:main Nov 6, 2023
36 checks passed
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.

None yet

2 participants