Migrate billing from Paddle to Lemon Squeezy
This commit is contained in:
@@ -36,7 +36,7 @@ class GiftVoucherCheckoutController extends Controller
|
||||
|
||||
if (! $checkout['checkout_url']) {
|
||||
throw ValidationException::withMessages([
|
||||
'tier_key' => __('Unable to create Paddle checkout.'),
|
||||
'tier_key' => __('Unable to create Lemon Squeezy checkout.'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -46,19 +46,19 @@ class GiftVoucherCheckoutController extends Controller
|
||||
public function show(Request $request): JsonResponse
|
||||
{
|
||||
$data = $request->validate([
|
||||
'checkout_id' => ['nullable', 'string', 'required_without_all:transaction_id,code'],
|
||||
'transaction_id' => ['nullable', 'string', 'required_without_all:checkout_id,code'],
|
||||
'code' => ['nullable', 'string', 'required_without_all:checkout_id,transaction_id'],
|
||||
'checkout_id' => ['nullable', 'string', 'required_without_all:order_id,code'],
|
||||
'order_id' => ['nullable', 'string', 'required_without_all:checkout_id,code'],
|
||||
'code' => ['nullable', 'string', 'required_without_all:checkout_id,order_id'],
|
||||
]);
|
||||
|
||||
$voucherQuery = GiftVoucher::query();
|
||||
|
||||
if (! empty($data['checkout_id'])) {
|
||||
$voucherQuery->where('paddle_checkout_id', $data['checkout_id']);
|
||||
$voucherQuery->where('lemonsqueezy_checkout_id', $data['checkout_id']);
|
||||
}
|
||||
|
||||
if (! empty($data['transaction_id'])) {
|
||||
$voucherQuery->orWhere('paddle_transaction_id', $data['transaction_id']);
|
||||
if (! empty($data['order_id'])) {
|
||||
$voucherQuery->orWhere('lemonsqueezy_order_id', $data['order_id']);
|
||||
}
|
||||
|
||||
if (! empty($data['code'])) {
|
||||
|
||||
Reference in New Issue
Block a user