PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.28
Booktics – Appointment Booking Calendar for Service Businesses v1.0.28
1.0.29 1.0.28 1.0.27 1.0.26 1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 All 31 releases
← All changes | core/order/controllers/order-controller.php +3 -5 1.0.29 → 1.0.28 View file →
@@ -532,11 +532,9 @@
532 532 *
533 533 * @return array [Order_Model $order_model, array $appointments]
534 534 */
535 535 private function create_order_and_appointments( $input_data, $db ) {
536 - // The total is priced server side in the store currency, so the order is
537 - // too. A buyer-sent currency would relabel 100 USD as 100 KRW at Stripe.
538 - $input_data['currency'] = booktics_get_store_currency();
536 + $input_data['currency'] = ! empty( $input_data['currency'] ) ? strtolower( $input_data['currency'] ) : strtolower( booktics_get_option( 'currency', 'USD' ) );
539 537 $order_model = new Order_Model( $db );
540 538
541 539 $input_timezone_string = $input_data['timezone'] ?? 'UTC';
542 540 $input_timezone = Time_Zone_Handler::get_timezone_from_string( $input_timezone_string );
@@ -677,10 +675,10 @@
677 675 ( new Payment_Model( $db ) )->create(
678 676 array(
679 677 'order_id' => $order_model->id,
680 678 'customer_id' => $input_data['customer_id'],
681 - 'amount' => booktics_amount_to_minor_units( $order_model->total, $order_model->currency ),
682 - 'currency' => $order_model->currency,
679 + 'amount' => $input_data['total'] * 100,
680 + 'currency' => $input_data['currency'] ?? booktics_get_option( 'currency', 'USD' ),
683 681 'intent_id' => $payment_intent['payment_intent'] ?? null,
684 682 'transaction_id' => null,
685 683 'payment_method' => $input_data['payment_method'],
686 684 'status' => $payment_intent['status'] == 'success' ? 'completed' : 'pending',