booking-payments.php
Table of Contents
Functions
- buddyc_deposits_enabled() : bool
- Checks whether deposits are enabled.
- buddyc_get_booking_payment() : BookingPayment
- Retrieves a BookingPayment by ID.
- buddyc_update_booking_payment() : mixed
- Updates a single property of a BookingPayment.
- buddyc_update_booking_payments() : mixed
- Updates a single property of multiple BookingPayment objects.
- buddyc_new_booking_payment() : mixed
- Creates a new BookingPayment.
- buddyc_new_booking_payment_id() : mixed
- Returns the ID of a new BookingPayment.
- buddyc_build_pay_link() : string
- Builds the url where clients can pay the fee.
- buddyc_get_unpaid_payment_data() : array<string|int, mixed>
- Builds an array of data for the open BookingPayments for a single BookingIntent.
- buddyc_get_payment_booking_status() : mixed
- Retrieves the status of the BookingIntent attached to a BookingPayment.
- buddyc_get_all_active_payments() : mixed
- Retrieves all active BookingPayment objects.
- buddyc_delete_booking_intent_booking_payments() : mixed
- Deletes all BookingPayment objects associated with a BookingIntent.
- buddyc_succeed_booking_payment() : mixed
- Updates a BookingPayment on successful Stripe payment.
- buddyc_booking_payments_due() : mixed
- Marks a BookingPayment as due.
- buddyc_unsucceed_booking_payment() : mixed
- Unsucceeds a BookingPayment. Used manually in the admin area.
- buddyc_handle_booking_payment_action() : mixed
- Handles booking actions (delete/update).
Functions
buddyc_deposits_enabled()
Checks whether deposits are enabled.
buddyc_deposits_enabled() : bool
Tags
Return values
bool —True if deposits are enabled, false if not.
buddyc_get_booking_payment()
Retrieves a BookingPayment by ID.
buddyc_get_booking_payment(int $payment_id) : BookingPayment
Parameters
- $payment_id : int
-
The ID of the BookingPayment.
Tags
Return values
BookingPayment —The BookingPayment object.
buddyc_update_booking_payment()
Updates a single property of a BookingPayment.
buddyc_update_booking_payment(int $ID, string $property, mixed $value) : mixed
Parameters
- $ID : int
-
The BookingPayment ID.
- $property : string
-
The property to update.
- $value : mixed
-
The new value for the property.
Tags
buddyc_update_booking_payments()
Updates a single property of multiple BookingPayment objects.
buddyc_update_booking_payments(array<string|int, mixed> $payment_ids, string $property, mixed $value) : mixed
Parameters
- $payment_ids : array<string|int, mixed>
-
The BookingPayment IDs.
- $property : string
-
The property to update.
- $value : mixed
-
The new value for the property.
Tags
buddyc_new_booking_payment()
Creates a new BookingPayment.
buddyc_new_booking_payment(BookingIntent $booking_intent, string $type) : mixed
Parameters
- $booking_intent : BookingIntent
-
The BookingIntent object.
- $type : string
-
The type of BookingPayment to create. Accepts 'deposit' and 'final'.
Tags
buddyc_new_booking_payment_id()
Returns the ID of a new BookingPayment.
buddyc_new_booking_payment_id(BookingIntent $booking_intent, string $type) : mixed
Parameters
- $booking_intent : BookingIntent
-
The BookingIntent object.
- $type : string
-
The type of BookingPayment to create. Accepts 'deposit' and 'final'.
Tags
buddyc_build_pay_link()
Builds the url where clients can pay the fee.
buddyc_build_pay_link(int $payment_id[, int $booking_intent_id = null ]) : string
Parameters
- $payment_id : int
-
The ID of the BookingPayment.
- $booking_intent_id : int = null
-
Optional. The ID of the BookingIntent.
Tags
Return values
string —The url to pay.
buddyc_get_unpaid_payment_data()
Builds an array of data for the open BookingPayments for a single BookingIntent.
buddyc_get_unpaid_payment_data(int $booking_intent_id) : array<string|int, mixed>
Parameters
- $booking_intent_id : int
-
The ID of the BookingIntent.
Tags
Return values
array<string|int, mixed> —{ An array of data for unpaid payments for the BookingIntent.
@type string $pay_link The url to submit payment.
@type string $type The type of payment (final or deposit).
@type string $type_label The formatted label for the type.
@type float $amount The amount of the payment.
@status string $status The status of the payment (paid or unpaid).
}
buddyc_get_payment_booking_status()
Retrieves the status of the BookingIntent attached to a BookingPayment.
buddyc_get_payment_booking_status(int $payment_id) : mixed
Parameters
- $payment_id : int
-
The ID of the BookingPayment.
Tags
buddyc_get_all_active_payments()
Retrieves all active BookingPayment objects.
buddyc_get_all_active_payments() : mixed
Active BookingPayment objects are attached to a succeeded BookingIntent.
Tags
buddyc_delete_booking_intent_booking_payments()
Deletes all BookingPayment objects associated with a BookingIntent.
buddyc_delete_booking_intent_booking_payments(int $booking_intent_id) : mixed
Parameters
- $booking_intent_id : int
-
The ID of the BookingIntent.
Tags
buddyc_succeed_booking_payment()
Updates a BookingPayment on successful Stripe payment.
buddyc_succeed_booking_payment(PaymentIntent $payment_intent) : mixed
Parameters
- $payment_intent : PaymentIntent
-
The PaymentIntent from Stripe.
Tags
buddyc_booking_payments_due()
Marks a BookingPayment as due.
buddyc_booking_payments_due(int $booking_intent_id[, bool $due = true ]) : mixed
Parameters
- $booking_intent_id : int
-
The ID of the BookingIntent.
- $due : bool = true
-
Optional. Whether the BookingPayments should be marked as due. Defaults to true.
Tags
buddyc_unsucceed_booking_payment()
Unsucceeds a BookingPayment. Used manually in the admin area.
buddyc_unsucceed_booking_payment(mixed $payment_id) : mixed
Parameters
- $payment_id : mixed
Tags
buddyc_handle_booking_payment_action()
Handles booking actions (delete/update).
buddyc_handle_booking_payment_action() : mixed