Skip to content

Commit

Permalink
Update method to avoid clash with laravel cashier (#2)
Browse files Browse the repository at this point in the history
* Update method to avoid clash with laravel cashier

Currently both billable and payable implement the same pay method. This can break applications that can have users that will receive and pay on the platform in case of affiliate links for example

This is a breaking change

* update readme
  • Loading branch information
arthurnassar authored Jul 9, 2024
1 parent c8c0ffc commit 0f8182d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ Route::get('/connect', function () {
})->middleware(['auth']);
```

Once a user's Stripe account is all connected and active, you can start sending them payments:
Once a user's Stripe account is all connected and active, you can start creating transfers:

```php
auth()->user()->pay(10000, 'usd');
auth()->user()->transfer(10000, 'usd');
```

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Payable.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getStripeAccountLink(LinkType $type = LinkType::Onboarding): str
return $link->url;
}

public function pay($amount, $currency): Transfer
public function transfer($amount, $currency): Transfer
{
// TODO: capture this in the database, which may allow us to do a reversal later
return static::$stripe->transfers->create([
Expand Down

0 comments on commit 0f8182d

Please sign in to comment.