fix paypal discounting

This commit is contained in:
Leonard Biano
2024-11-20 12:03:23 +08:00
parent 36725277e8
commit 47d0d4a76b

View File

@@ -239,12 +239,12 @@ class PaypalPaymentService
$post_data['billing_cycles'] = [
[
'frequency' => [
'interval_unit' => $custom_intervals[$planPrice->custom_interval_type],
'interval_count' => ($planPrice->payment != 'upfront' ? 1 : $planPrice->custom_interval)
'interval_unit' => $planPrice->payment == 'monthly' ? 'MONTH' : 'YEAR',
'interval_count' => 1
],
'tenure_type' => 'REGULAR',
'sequence' => 1,
'total_cycles' => ($planPrice->payment == 'upfront' ? 1 : $planPrice->custom_interval),
'total_cycles' => ($planPrice->payment == 'upfront' ? 0 : $planPrice->custom_interval),
'pricing_scheme' => [
'fixed_price' => [
'currency_code' => getCurrencyCode(),