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

Paddle Billing support #192

Closed
dommer1 opened this issue Aug 17, 2023 · 49 comments
Closed

Paddle Billing support #192

dommer1 opened this issue Aug 17, 2023 · 49 comments

Comments

@dommer1
Copy link

dommer1 commented Aug 17, 2023

Paddle has launched a new version called Paddle Billing. I tried to use it with this package, but it seems that it doesn't work because Paddle Billing and Paddle Classic use different APIs. Do you have any plans to update cashier-paddle to support the new API?

For reference, here's the announcement about Paddle Billing:
https://developer.paddle.com/changelog/2023/enable-paddle-billing

@driesvints
Copy link
Member

Right now we don't have immediate plans, sorry.

@Arielblues
Copy link

Hi, I am new to paddle and also this bundle.

I try to set it up but doesn't seem to work. I guess this maybe has to do with the billing account? I registered after 8th of august. There doesn't seem to be an option to switch to classic.

@driesvints
Copy link
Member

@Arielblues you're using the new Paddle Billing which this package doesn't supports.

@Arielblues
Copy link

Thanks for the quick feedback. I will check out other options then. If you do plan to update sooner would be very much appreciated.

@crnkovic
Copy link

crnkovic commented Aug 29, 2023

Since Paddle Billing is now the default option for new Paddle accounts, I think a little warning in the docs that Paddle Billing is not supported by Cashier could've been a nice heads-up.

Also a notice to not use this package if your Paddle account was created after August 8th.

@driesvints
Copy link
Member

I'm probably gonna start looking into a Cashier Paddle v2 soonish.

@inooid
Copy link

inooid commented Sep 27, 2023

Please let us know if we can help with contributing to this @driesvints 👍 Paddle Billing seems to be way closer to the way Stripe is working, so I am assuming we can keep the implementations similar as well (apart from having a solid migration path in place).

@driesvints
Copy link
Member

Working on it... just a lot to dig through. Thanks!

@bobbyiliev
Copy link

Thank you for working on this @driesvints! Very appreciated! I was looking through their new API and it seems like that they've basically changed everything 😓

@giltotherescue
Copy link

Just raising my hand as interested in using Paddle Billing support 🙋

Thanks to @driesvints and all others working on this initiative.

@paulocastellano
Copy link

Really cashier paddle package not is working with new paddle accounts.

@driesvints
Copy link
Member

Hey all. We realize you all want support quickly. We’re doing our best here to provide you that but for now please have patience.

@laravel laravel locked and limited conversation to collaborators Sep 30, 2023
@laravel laravel unlocked this conversation Nov 17, 2023
@driesvints
Copy link
Member

Got the code pretty much tied up and docs almost finished. We'll be tagging an alpha release early next week for people to test out for a bit before we tag a stable release.

@coolsam726
Copy link

Eagerly waiting for this. I am one of the customers who signed up to paddle after August 8th. Thanks @driesvints and the team for the amount of work you've put into this.

@tinusg
Copy link

tinusg commented Nov 20, 2023

Perfect timing. I'm starting on integration payments in my app in the following weeks. I'll try the alpha for sure.

@kirc0de
Copy link

kirc0de commented Nov 21, 2023

Hi everyone!

I'm trying to use the current dev-version for my project.

I found a bug (I think it's a bug). Steps to reproduce:

  1. Use button-component: <x-cashier::button :checkout="$checkoutObj">Buy plan</x-cashier::button>
  2. Pass Checkout object as expected inside component

I got an error:

trim(): Argument #1 ($string) must be of type string, Laravel\Paddle\Checkout given

Solution was the following:
add __toString() function inside Laravel\Paddle\Checkout:

public function __toString()
{
    return json_encode($this->options()); // in fact it doesn't matter what to return here
}

I understand that your solution is still in dev, but maybe my message will help you to fix it faster :)

@driesvints
Copy link
Member

@kirillarutyunov I don't think you're using that correctly. Try:

<x-paddle-button :checkout="$checkout" class="px-8 py-4">
    Subscribe
</x-paddle-button>

@driesvints
Copy link
Member

We've released a first alpha version btw and would love feedback on it and testing: https://github.com/laravel/cashier-paddle/tree/master

@karlomikus
Copy link
Contributor

karlomikus commented Nov 24, 2023

Hello,

seems like you are missing a method

"message": "Call to undefined method Laravel\\Paddle\\Subscription::syncSubscriptionItems()",
    "exception": "BadMethodCallException",
    "file": "/var/www/cocktails/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php",
    "line": 67,
...

Got that by calling $request->user()->subscription()->pause(); method.

Also an issue with customer update webhook:

local.ERROR: Attempt to read property "billable" on bool {"exception":"[object] (ErrorException(code: 0): Attempt to read property \"billable\" on bool at /var/www/app/vendor/laravel/cashier-paddle/src/Http/Controllers/WebhookController.php:81)

@driesvints
Copy link
Member

Thanks @karlomikus. I did a new v2.0.0-alpha.2 release with fixes for these. Good finds.

@karlomikus
Copy link
Contributor

Seems like Subscription.php -> resume() method also needs update. Resume endpoint now requires a request body with effective_from property. Following other examples in the class, I think something like this should work:

public function resume(bool $resumeNow = false)
{
    $response = Cashier::api('POST', "subscriptions/{$this->paddle_id}/resume", [
        'effective_from' => $resumeNow ? 'immediately' : 'next_billing_period',
    ])['data'];
    // ...
}

But in testing, when resuming a subscription that is active with a scheduled change to pause, I get internal server error from the paddle api (Paddle API can't process your request), hopefully this is a temporary issue on paddle sandbox side.

Other conditions like using, pauseNow() and then resume(true) work fine.

@driesvints
Copy link
Member

Thanks @karlomikus. I made this PR to fix that: #206

Could you give it a look? #206

@driesvints
Copy link
Member

Hello everyone in this thread. Seeing many people who want Paddle Billing support but not many people who are willing to help test the upcoming version. Can we get a little more people trying out the next version? Once it's out it's a lot harder to do changes. Thanks!

@kidsdayio
Copy link

kidsdayio commented Nov 29, 2023

@driesvints I think this is also missing

/**
     * Set the subscription model class name.
     *
     * @param  string  $subscriptionItemModel
     * @return void
     */
    public static function useSubscriptionItemModel($subscriptionItemModel)
    {
        static::$subscriptionItemModel = $subscriptionItemModel;
    }

@zeknoss
Copy link

zeknoss commented Nov 29, 2023

Hello everyone in this thread. Seeing many people who want Paddle Billing support but not many people who are willing to help test the upcoming version. Can we get a little more people trying out the next version? Once it's out it's a lot harder to do changes. Thanks!

Hello!
Is it possible for us to get a checklist on what is implemented so we can test them methodically? I have a feeling I can be better of your help in that way.

@driesvints
Copy link
Member

@kidsdayio thanks, will have a look.

@zeknoss basically going through the docs and trying things out.

@zeknoss
Copy link

zeknoss commented Nov 30, 2023

Hey @driesvints
I found an issue. When receiving a "subscription.created" webhook the handler complains about missing paddle_subscription_id field in subscription_items table.
The migration doesn't contain that column.

Created a PR for you: #207

@driesvints
Copy link
Member

@zeknoss replied to your PR

@zeknoss
Copy link

zeknoss commented Dec 1, 2023

Hi @driesvints !
The overlay worked pretty good. The subscription, upgrades, downgrades work good. Webhooks and being able to listen to incoming webhooks work too.

However, while I was trying to display the inline paddle element I'm getting the following error:
image

I've supplied the output of checkout('price-id')->returnTo('return-url') method into the blade. When I looked at the code, I can see that the last commit was made 3 years ago so maybe could it be forgotten?

@driesvints
Copy link
Member

can see that the last commit was made 3 years ago so maybe could it be forgotten

Hmm, are you sure you're looking on the master branch?

@zeknoss
Copy link

zeknoss commented Dec 1, 2023

can see that the last commit was made 3 years ago so maybe could it be forgotten

Hmm, are you sure you're looking on the master branch?

Indeed I am.

https://github.com/laravel/cashier-paddle/tree/master/resources/views/components says so :)

@driesvints
Copy link
Member

@zeknoss managed to reproduce that one and forwarded it to Paddle. Hoping to get an answer soon. Thanks for testing!

@zeknoss
Copy link

zeknoss commented Dec 1, 2023

@zeknoss managed to reproduce that one and forwarded it to Paddle. Hoping to get an answer soon. Thanks for testing!

You're most welcome, actually you are the one I should thank. Ciao!

@zahidhassanshaikot
Copy link

zahidhassanshaikot commented Dec 4, 2023

How Can I charge from a user without auth and priceId?

And Can I generate a payment link for the subscription?

@driesvints
Copy link
Member

How Can I charge from a user without auth and priceId?

That's not possible I'm afraid. You need a user up front.

And Can I generate a payment link for the subscription?

There's no concept of payment links anymore in Paddle Billing.

@zahidhassanshaikot
Copy link

zahidhassanshaikot commented Dec 4, 2023

thanks @driesvints

So How can I take a payment by only passing the amount? In my case no need to create a product or price ID
and can you tell me when will be published casher-paddle v2

@driesvints
Copy link
Member

So How can I take a payment by only passing the amount?

That's not possible with Paddle Billing. You always need a price ID.

@jskarp
Copy link

jskarp commented Dec 4, 2023

Hi you phenomenal guys that are working on this! Do you have an app. date when Paddle Billing will be available in Laravel Cashier as a first stable release?

@driesvints
Copy link
Member

Out now! https://github.com/laravel/cashier-paddle/releases/tag/v2.0.0

@driesvints
Copy link
Member

Thanks to everyone who helped testing 👍

@Kovah
Copy link

Kovah commented Dec 4, 2023

Great to see Cashier supporting Billing, even if I can't upgrade from Classic.

Will there be an upgrade option once Paddle releases such an option from their side?

@driesvints
Copy link
Member

@Kovah maybe. But the codebase and data scheme of Cashier Paddle changed a lot. So unsure if that would be possible.

@iskrisis
Copy link

So How can I take a payment by only passing the amount?

That's not possible with Paddle Billing. You always need a price ID.

@driesvints @zahidhassanshaikot Are you sure about this? It seems that https://developer.paddle.com/build/transactions/bill-create-custom-items-prices-products its possible it's just done in a bit different way.

@iskrisis
Copy link

I can confirm creating fully custom prices/items directly works with Paddle Billing. Not sure how it should be supported in this library but it's quite similar to the paddle classic. Instead of creating custom "checkout" and getting checkout URL you create custom transaction using API > get transaction ID > open checkout with that transaction id.

Paddle.Checkout.open({
	transactionId: "txn_abcdef12345"
});

@driesvints
Copy link
Member

@iskrisis it seems this was only added a few weeks ago. We'd accept a PR for this.

https://developer.paddle.com/changelog/2023/add-custom-items-transaction

@tariquedev
Copy link

tariquedev commented Jan 19, 2024

I used Paddle webhook like this domain.com/paddle/webhook and didn't Overriding Default Models.

ENV setup below
PADDLE_SANDBOX=true
PADDLE_SELLER_ID=
PADDLE_API_KEY=
PADDLE_WEBHOOK_SECRET=

I used the latest version and checkout is working fine with one-time payment(by price ID). Also, store data on the Customer table and Payment added to the paddle balance.

But No data is stored in the transactions table.

When I view log-on transaction.completed from webhook status it failed.

@driesvints help please
Screenshot_14

@driesvints
Copy link
Member

@tariquedev that seems like a weird status display. Best to contact Paddle about this.

@InfinityXTech
Copy link

InfinityXTech commented Feb 20, 2024

Hello, I am unsure if this is paddle or package problem, but I get this:
image

EDIT: Configuration problem, you need to add checkout settings URL for this to work.

@iRajul
Copy link

iRajul commented Aug 26, 2024

@InfinityXTech set the website at https://sandbox-vendors.paddle.com/request-domain-approval it should work.

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

No branches or pull requests