diff --git a/CHANGELOG.md b/CHANGELOG.md index b309f340..ec8b5602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,193 @@ +### v4.27.0 (2026-09-24) +* * * +### New Resources: +- [`AppliedBusinessRule`](https://apidocs.chargebee.com/docs/api/applied_business_rules) has been added. +- [`AppliedRule`](https://apidocs.chargebee.com/docs/api/applied_rules) has been added. +- [`ApplyRule`](https://apidocs.chargebee.com/docs/api/apply_rules) has been added. +- [`BusinessRule`](https://apidocs.chargebee.com/docs/api/business_rules) has been added. +- [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets) has been added. +- [`BusinessRulesetRule`](https://apidocs.chargebee.com/docs/api/business_ruleset_rules) has been added. +- [`CustomDataSchema`](https://apidocs.chargebee.com/docs/api/custom_data_schemas) has been added. +- [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes) has been added. +- [`EmailLog`](https://apidocs.chargebee.com/docs/api/email_logs) has been added. + + +### New Actions: +- [`send_credit_note_email`](https://apidocs.chargebee.com/docs/api/credit_notes/send-credit-note-email) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`send_payment_request_email`](https://apidocs.chargebee.com/docs/api/customers/send-payment-request-email) has been added to [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`retrieve_an_e-invoice`](https://apidocs.chargebee.com/docs/api/einvoices/retrieve-an-e-invoice) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`send_invoice_email`](https://apidocs.chargebee.com/docs/api/invoices/send-invoice-email) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) has been added to [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) has been added to [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). + + +### New Attributes: +- [`brand_id`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#brand_id) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/customers/customer-object#brand_id) has been added to [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- [`entity_type`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#entity_type) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`entity_id`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#entity_id) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`created_at`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#created_at) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`resource_version`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#resource_version) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#updated_at) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`deleted`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#deleted) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`business_entity_id`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#business_entity_id) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`artifacts`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#artifacts) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`site_id`](https://apidocs.chargebee.com/docs/api/events/event-object#site_id) has been added to [`Event`](https://apidocs.chargebee.com/docs/api/events). +- [`provisioned_block_balance`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#provisioned_block_balance) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`overdraft_block_balance`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#overdraft_block_balance) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/hosted-page-object#brand_id) has been added to [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/invoices/invoice-object#brand_id) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#brand_id) has been added to [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`reference_transactions`](https://apidocs.chargebee.com/docs/api/payment_schedules/payment-schedule-object#reference_transactions) has been added to [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#brand_id) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`network_transaction_reference`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#network_transaction_reference) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`billing_configuration`](https://apidocs.chargebee.com/docs/api/ramps/ramp-object#billing_configuration) has been added to [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/subscription-object#brand_id) has been added to [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`network_transaction_reference`](https://apidocs.chargebee.com/docs/api/third_party_payment_methods/third-party-payment-method-object#network_transaction_reference) has been added to [`ThirdPartyPaymentMethod`](https://apidocs.chargebee.com/docs/api/third_party_payment_methods). +- [`network_transaction_details`](https://apidocs.chargebee.com/docs/api/transactions/transaction-object#network_transaction_details) has been added to [`Transaction`](https://apidocs.chargebee.com/docs/api/transactions). + + +### New Parameters: +- [`limit`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#limit) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`offset`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#offset) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`reference_id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#reference_id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#updated_at) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`sort_by`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#sort_by) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`invoice_id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#invoice_id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`credit_note_id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#credit_note_id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#limit) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#offset) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`invoice_id`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#invoice_id) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`id`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#id) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#updated_at) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#limit) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#offset) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`id`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#id) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#updated_at) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`line_items.is_partial_tax_applied`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note#line_items_is_partial_tax_applied) has been added as request body parameter to [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`line_items.taxable_amount`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note#line_items_taxable_amount) has been added as request body parameter to [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/customers/create-a-customer#brand_id) has been added as request body parameter to [`create_a_customer`](https://apidocs.chargebee.com/docs/api/customers/create-a-customer) in [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-customer-and-subscription#subscription_items_description) has been added as request body parameter to [`estimate_for_creating_a_customer_and_subscription`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-customer-and-subscription) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-updating-a-subscription#subscription_items_description) has been added as request body parameter to [`estimate_for_updating_a_subscription`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-updating-a-subscription) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-subscription#subscription_items_description) has been added as request body parameter to [`estimate_for_creating_a_subscription`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-subscription) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges#brand_id) has been added as request body parameter to [`checkout_charge-items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/extend-subscription#brand_id) has been added as request body parameter to [`extend_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/extend-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-gift-subscription-for-items#brand_id) has been added as request body parameter to [`checkout_gift_subscription_for_items`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-gift-subscription-for-items) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/collect-now#brand_id) has been added as request body parameter to [`collect_now`](https://apidocs.chargebee.com/docs/api/hosted_pages/collect-now) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/accept-a-quote#brand_id) has been added as request body parameter to [`accept_a_quote`](https://apidocs.chargebee.com/docs/api/hosted_pages/accept-a-quote) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-for-a-new-subscription#brand_id) has been added as request body parameter to [`create_checkout_for_a_new_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-for-a-new-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/claim-a-gift-subscription#brand_id) has been added as request body parameter to [`claim_a_gift_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/claim-a-gift-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-to-update-a-subscription#brand_id) has been added as request body parameter to [`create_checkout_to_update_a_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-to-update-a-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page#brand_id) has been added as request body parameter to [`create_a_pre-cancel_hosted_page`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/manage-payment-sources#brand_id) has been added as request body parameter to [`manage_payment_sources`](https://apidocs.chargebee.com/docs/api/hosted_pages/manage-payment-sources) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`line_items.is_partial_tax_applied`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#line_items_is_partial_tax_applied) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`line_items.taxable_amount`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#line_items_taxable_amount) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`id`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#id) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`effective_from`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#effective_from) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#brand_id) has been added as request body parameter to [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token#brand_id) has been added as request body parameter to [`create_using_permanent_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-card-payment-source#brand_id) has been added as request body parameter to [`create_a_card_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-card-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-payment-intent#brand_id) has been added as request body parameter to [`create_using_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-payment-intent) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-voucher-payment-method#brand_id) has been added as request body parameter to [`create_a_voucher_payment_method`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-voucher-payment-method) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-gateway-temporary-token#brand_id) has been added as request body parameter to [`create_using_gateway_temporary_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-gateway-temporary-token) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`network_transaction_reference`](https://apidocs.chargebee.com/docs/api/payment_sources/update-a-card-payment-source#network_transaction_reference) has been added as request body parameter to [`update_a_card_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/update-a-card-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-chargebee-token#brand_id) has been added as request body parameter to [`create_using_chargebee_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-chargebee-token) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-bank-account-payment-source#brand_id) has been added as request body parameter to [`create_a_bank_account_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-bank-account-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription#brand_id) has been added as request body parameter to [`create_pricing_page_for_new_subscription`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription) in [`PricingPageSession`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions). +- [`id`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant#id) has been added as request body parameter to [`create_promotional_grant`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant) in [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants). +- [`effective_from`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant#effective_from) has been added as request body parameter to [`create_promotional_grant`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant) in [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants). +- [`billing_configuration`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp#billing_configuration) has been added as request body parameter to [`create_a_ramp`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`billing_configuration`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp#billing_configuration) has been added as request body parameter to [`update_a_subscription_ramp`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/subscriptions/update-subscription-for-items#subscription_items_description) has been added as request body parameter to [`update_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/update-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/create-a-subscription#brand_id) has been added as request body parameter to [`create_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/create-a-subscription) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-customer#brand_id) has been added as request body parameter to [`create_subscription_for_customer`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-customer) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/subscriptions/import-subscription-for-items#subscription_items_description) has been added as request body parameter to [`import_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/import-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items#subscription_items_description) has been added as request body parameter to [`create_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items#brand_id) has been added as request body parameter to [`create_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + +### New Events: +- [`business_rule_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_deleted) has been added. +- [`business_rules_applied`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rules_applied) has been added. +- [`business_ruleset_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_updated) has been added. +- [`business_rule_created`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_created) has been added. +- [`einvoice_created`](https://apidocs.chargebee.com/docs/api/events/webhook/einvoice_created) has been added. +- [`business_ruleset_deactivated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_deactivated) has been added. +- [`business_ruleset_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_deleted) has been added. +- [`business_ruleset_created`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_created) has been added. +- [`business_ruleset_activated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_activated) has been added. +- [`business_rule_deactivated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_deactivated) has been added. +- [`einvoice_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/einvoice_updated) has been added. +- [`business_rule_released`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_released) has been added. +- [`business_rule_activated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_activated) has been added. +- [`business_rule_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_updated) has been added. + + +### New Enums: +- `business_ruleset` and `price_ramp` have been added as new values enum `EntityType`. +- `einvoice_created`, `einvoice_updated`, `business_rule_created`, `business_rule_updated`, `business_rule_activated`, `business_rule_deactivated`, `business_rule_deleted`, `business_rule_released`, `business_rules_applied`, `business_ruleset_created`, `business_ruleset_updated`, `business_ruleset_activated`, `business_ruleset_deactivated`, and `business_ruleset_deleted` have been added as new values enum `EventType`. +- `payu` has been added as a new value enum `Gateway`. +- `payu` has been added as a new value enum `GatewayName`. +- `blik`, `fpx`, `wero`, `p24`, `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `affirm_pay`, and `rakuten_pay` have been added as new values enum `PaymentMethod`. +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values enum `PaymentMethodType`. +- `rescheduled`, `succeeded`, `failed`, `deferred`, `delivered`, `opened`, `bounced`, and `dropped` have been added as new values enum `Status`. +- `zero_rated` has been added as a new value enum `Taxability`. +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values enum `Type`. +- `cpq_quote` has been added as a new value to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/applied_business_rules/applied-business-rule-object#entity_type) in [`AppliedBusinessRule`](https://apidocs.chargebee.com/docs/api/applied_business_rules). +- `stop_on_first_true`, `stop_on_first_false`, `execute_all`, and `execute_all_true` have been added as new values to enum attribute [`execute_mode`](https://apidocs.chargebee.com/docs/api/business_rulesets/business-ruleset-object#execute_mode) in [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `active` and `archived` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/custom_data_schemas/custom-data-schema-object#status) in [`CustomDataSchema`](https://apidocs.chargebee.com/docs/api/custom_data_schemas). +- `initiated`, `funds_withdrawn`, `in_review`, `cancelled`, `lost`, and `won` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/disputes/dispute-object#status) in [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `chargeback` and `inquiry` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/disputes/dispute-object#type) in [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `invoice` and `credit_note` have been added as new values to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#entity_type) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- `overdraft_settlement` has been added as a new value to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `subscription_not_found_in_source` has been added as a new value to enum attribute [`expiration_reason`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_items/omnichannel-subscription-item-object#expiration_reason) in [`OmnichannelSubscriptionItem`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_items). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `true` and `false` have been added as new values to enum query parameter `draft.is` in [`list_business_rules`](https://apidocs.chargebee.com/docs/api/business_rules/list-business-rules) of [`BusinessRule`](https://apidocs.chargebee.com/docs/api/business_rules). +- `true` and `false` have been added as new values to enum query parameter `active.is` in [`list_business_rules`](https://apidocs.chargebee.com/docs/api/business_rules/list-business-rules) of [`BusinessRule`](https://apidocs.chargebee.com/docs/api/business_rules). +- `stop_on_first_true`, `stop_on_first_false`, `execute_all`, and `execute_all_true` have been added as new values to enum request body parameter `execute_mode` in [`update_a_business_ruleset`](https://apidocs.chargebee.com/docs/api/business_rulesets/update-a-business-ruleset) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `true` and `false` have been added as new values to enum query parameter `active.is` in [`list_rules_in_a_business_ruleset`](https://apidocs.chargebee.com/docs/api/business_rulesets/list-rules-in-a-business-ruleset) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `true` and `false` have been added as new values to enum query parameter `active.is` in [`list_business_rulesets`](https://apidocs.chargebee.com/docs/api/business_rulesets/list-business-rulesets) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `stop_on_first_true`, `stop_on_first_false`, `execute_all`, and `execute_all_true` have been added as new values to enum request body parameter `execute_mode` in [`create_a_business_ruleset`](https://apidocs.chargebee.com/docs/api/business_rulesets/create-a-business-ruleset) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `dankort` has been added as a new value to enum request body parameter `preferred_scheme` in [`update_card_for_a_customer`](https://apidocs.chargebee.com/docs/api/cards/update-card-for-a-customer) of [`Card`](https://apidocs.chargebee.com/docs/api/cards). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_a_customer`](https://apidocs.chargebee.com/docs/api/customers/create-a-customer) of [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`collect_payment_for_customer`](https://apidocs.chargebee.com/docs/api/customers/collect-payment-for-customer) of [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.is` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.is_not` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.not_in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.is` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.is_not` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.not_in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `updated_at` has been added as a new value to enum query parameter `sort_by.asc` in [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) of [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- `updated_at` has been added as a new value to enum query parameter `sort_by.desc` in [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) of [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_an_invoice`](https://apidocs.chargebee.com/docs/api/invoices/create-an-invoice) of [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) of [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- `overdraft_settlement` has been added as a new value to enum query parameter `type.is` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `overdraft_settlement` has been added as a new value to enum query parameter `type.in` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_a_card_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-card-payment-source) of [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`update_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/update-subscription-for-items) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/create-a-subscription) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`update_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/update-a-subscription) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`import_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/import-a-subscription) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + +### Deprecated Attributes: +- [`granted_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#granted_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`balance`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#balance) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`hold_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#hold_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`used_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#used_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`expired_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#expired_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`rolled_over_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#rolled_over_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`voided_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#voided_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). + + + ### v4.26.0 (2026-08-19) * * * ### New Resources: diff --git a/VERSION b/VERSION index 06edb387..02bb6671 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.26.0 +4.27.0 diff --git a/src/Actions/BusinessRuleActions.php b/src/Actions/BusinessRuleActions.php new file mode 100644 index 00000000..8c7bf259 --- /dev/null +++ b/src/Actions/BusinessRuleActions.php @@ -0,0 +1,439 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/apply-business-rules?lang=php-v4 + * @param array{ + * evaluate?: bool, + * rule_id?: string, + * ruleset_id?: string, + * skip_failed_rules?: bool, + * structured_expression?: mixed, + * context?: mixed, + * } $params Description of the parameters + * + * @param array $headers + * @return ApplyRulesBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function applyRules(array $params = [], array $headers = []): ApplyRulesBusinessRuleResponse + { + $jsonKeys = [ + "structuredExpression" => 0, + "context" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules","apply_rules"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("applyRules") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ApplyRulesBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/delete-a-business-rule-draft?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteDraftBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deleteDraft(string $id, array $headers = []): DeleteDraftBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules",$id,"delete_draft"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("deleteDraft") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeleteDraftBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/release-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return ReleaseRuleBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function releaseRule(string $id, array $headers = []): ReleaseRuleBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules",$id,"release"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("releaseRule") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ReleaseRuleBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/activate-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return ActivateRuleBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function activateRule(string $id, array $headers = []): ActivateRuleBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules",$id,"activate"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("activateRule") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ActivateRuleBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/retrieve-a-business-rule-draft?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveDraftBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveDraft(string $id, array $headers = []): RetrieveDraftBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_rules",$id,"draft"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("retrieveDraft") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveDraftBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/update-a-business-rule-draft?lang=php-v4 + * @param array{ + * name?: string, + * description?: string, + * tags?: array, + * structured_expression?: mixed, + * actions_on_success?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateDraftBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateDraft(string $id, array $params, array $headers = []): UpdateDraftBusinessRuleResponse + { + $jsonKeys = [ + "tags" => 0, + "structuredExpression" => 0, + "actionsOnSuccess" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules",$id,"draft"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("updateDraft") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateDraftBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/delete-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeleteBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules",$id,"delete"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("delete") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeleteBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/deactivate-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeactivateRuleBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deactivateRule(string $id, array $headers = []): DeactivateRuleBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules",$id,"deactivate"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("deactivateRule") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeactivateRuleBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/retrieve-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_rules",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/list-business-rules?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * draft?: array{ + * is?: mixed, + * }, + * active?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListBusinessRuleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_rules"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/create-a-business-rule?lang=php-v4 + * @param array{ + * id?: string, + * name?: string, + * description?: string, + * tags?: array, + * structured_expression?: mixed, + * actions_on_success?: array, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateBusinessRuleResponse + { + $jsonKeys = [ + "tags" => 0, + "structuredExpression" => 0, + "actionsOnSuccess" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rules"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRule") + ->withTelemetryOperation("create") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreateBusinessRuleResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/BusinessRulesetActions.php b/src/Actions/BusinessRulesetActions.php new file mode 100644 index 00000000..50ab7a67 --- /dev/null +++ b/src/Actions/BusinessRulesetActions.php @@ -0,0 +1,401 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/retrieve-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveBusinessRulesetResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_rulesets",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/update-a-business-ruleset?lang=php-v4 + * @param array{ + * name?: string, + * description?: string, + * execute_mode?: string, + * rules?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params, array $headers = []): UpdateBusinessRulesetResponse + { + $jsonKeys = [ + "rules" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("update") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return UpdateBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/remove-business-rules-from-a-ruleset?lang=php-v4 + * @param array{ + * rules?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return RemoveRulesBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function removeRules(string $id, array $params = [], array $headers = []): RemoveRulesBusinessRulesetResponse + { + $jsonKeys = [ + "rules" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets",$id,"remove_rules"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("removeRules") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RemoveRulesBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/delete-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeleteBusinessRulesetResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets",$id,"delete"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("delete") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeleteBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/deactivate-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeactivateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deactivate(string $id, array $headers = []): DeactivateBusinessRulesetResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets",$id,"deactivate"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("deactivate") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return DeactivateBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/list-rules-in-a-business-ruleset?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * active?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListRulesBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listRules(string $id, array $params = [], array $headers = []): ListRulesBusinessRulesetResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_rulesets",$id,"rules"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("listRules") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListRulesBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/list-business-rulesets?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * active?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListBusinessRulesetResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["business_rulesets"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/create-a-business-ruleset?lang=php-v4 + * @param array{ + * id?: string, + * name?: string, + * description?: string, + * execute_mode?: string, + * rules?: array, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateBusinessRulesetResponse + { + $jsonKeys = [ + "rules" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("create") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return CreateBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/activate-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return ActivateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function activate(string $id, array $headers = []): ActivateBusinessRulesetResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets",$id,"activate"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("activate") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ActivateBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/add-business-rules-to-a-ruleset?lang=php-v4 + * @param array{ + * rules?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AddRulesBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function addRules(string $id, array $params = [], array $headers = []): AddRulesBusinessRulesetResponse + { + $jsonKeys = [ + "rules" => 0, + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["business_rulesets",$id,"add_rules"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withIdempotent(true) + ->withTelemetryResource("businessRuleset") + ->withTelemetryOperation("addRules") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return AddRulesBusinessRulesetResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/BusinessRuleActionsInterface.php b/src/Actions/Contracts/BusinessRuleActionsInterface.php new file mode 100644 index 00000000..54e8a44e --- /dev/null +++ b/src/Actions/Contracts/BusinessRuleActionsInterface.php @@ -0,0 +1,208 @@ + $headers + * @return ApplyRulesBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function applyRules(array $params = [], array $headers = []): ApplyRulesBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/delete-a-business-rule-draft?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteDraftBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deleteDraft(string $id, array $headers = []): DeleteDraftBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/release-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return ReleaseRuleBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function releaseRule(string $id, array $headers = []): ReleaseRuleBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/activate-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return ActivateRuleBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function activateRule(string $id, array $headers = []): ActivateRuleBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/retrieve-a-business-rule-draft?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveDraftBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieveDraft(string $id, array $headers = []): RetrieveDraftBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/update-a-business-rule-draft?lang=php-v4 + * @param array{ + * name?: string, + * description?: string, + * tags?: array, + * structured_expression?: mixed, + * actions_on_success?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateDraftBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function updateDraft(string $id, array $params, array $headers = []): UpdateDraftBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/delete-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeleteBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/deactivate-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeactivateRuleBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deactivateRule(string $id, array $headers = []): DeactivateRuleBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/retrieve-a-business-rule?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/list-business-rules?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * draft?: array{ + * is?: mixed, + * }, + * active?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListBusinessRuleResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rules/create-a-business-rule?lang=php-v4 + * @param array{ + * id?: string, + * name?: string, + * description?: string, + * tags?: array, + * structured_expression?: mixed, + * actions_on_success?: array, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateBusinessRuleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateBusinessRuleResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/BusinessRulesetActionsInterface.php b/src/Actions/Contracts/BusinessRulesetActionsInterface.php new file mode 100644 index 00000000..52be5f46 --- /dev/null +++ b/src/Actions/Contracts/BusinessRulesetActionsInterface.php @@ -0,0 +1,191 @@ + $headers + * @return RetrieveBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/update-a-business-ruleset?lang=php-v4 + * @param array{ + * name?: string, + * description?: string, + * execute_mode?: string, + * rules?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return UpdateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function update(string $id, array $params, array $headers = []): UpdateBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/remove-business-rules-from-a-ruleset?lang=php-v4 + * @param array{ + * rules?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return RemoveRulesBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function removeRules(string $id, array $params = [], array $headers = []): RemoveRulesBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/delete-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeleteBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function delete(string $id, array $headers = []): DeleteBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/deactivate-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return DeactivateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function deactivate(string $id, array $headers = []): DeactivateBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/list-rules-in-a-business-ruleset?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * active?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return ListRulesBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listRules(string $id, array $params = [], array $headers = []): ListRulesBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/list-business-rulesets?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * active?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/create-a-business-ruleset?lang=php-v4 + * @param array{ + * id?: string, + * name?: string, + * description?: string, + * execute_mode?: string, + * rules?: array, + * } $params Description of the parameters + * + * @param array $headers + * @return CreateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function create(array $params, array $headers = []): CreateBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/activate-a-business-ruleset?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return ActivateBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function activate(string $id, array $headers = []): ActivateBusinessRulesetResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/business_rulesets/add-business-rules-to-a-ruleset?lang=php-v4 + * @param array{ + * rules?: array, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return AddRulesBusinessRulesetResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function addRules(string $id, array $params = [], array $headers = []): AddRulesBusinessRulesetResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/CreditNoteActionsInterface.php b/src/Actions/Contracts/CreditNoteActionsInterface.php index 8c21c574..cb11df85 100644 --- a/src/Actions/Contracts/CreditNoteActionsInterface.php +++ b/src/Actions/Contracts/CreditNoteActionsInterface.php @@ -2,6 +2,7 @@ namespace Chargebee\Actions\Contracts; use Chargebee\Responses\CreditNoteResponse\ResendEinvoiceCreditNoteResponse; +use Chargebee\Responses\CreditNoteResponse\SendEmailCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\SendEinvoiceCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\ImportCreditNoteCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\ListCreditNoteResponse; @@ -92,6 +93,8 @@ public function recordRefund(string $id, array $params, array $headers = []): Re * tax9_amount?: int, * tax10_name?: string, * tax10_amount?: int, + * is_partial_tax_applied?: bool, + * taxable_amount?: int, * proration_mode?: string, * }>, * line_item_tiers?: array $headers + * @return SendEmailCreditNoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function sendEmail(string $id, array $headers = []): SendEmailCreditNoteResponse; + } ?> \ No newline at end of file diff --git a/src/Actions/Contracts/CustomerActionsInterface.php b/src/Actions/Contracts/CustomerActionsInterface.php index 9ed593ce..b872abdb 100644 --- a/src/Actions/Contracts/CustomerActionsInterface.php +++ b/src/Actions/Contracts/CustomerActionsInterface.php @@ -9,6 +9,7 @@ use Chargebee\Responses\CustomerResponse\ContactsForCustomerCustomerResponse; use Chargebee\Responses\CustomerResponse\DeleteContactCustomerResponse; use Chargebee\Responses\CustomerResponse\ListCustomerResponse; +use Chargebee\Responses\CustomerResponse\SendPaymentRequestCustomerResponse; use Chargebee\Responses\CustomerResponse\DeleteCustomerResponse; use Chargebee\Responses\CustomerResponse\MergeCustomerResponse; use Chargebee\Responses\CustomerResponse\DeleteRelationshipCustomerResponse; @@ -545,6 +546,7 @@ public function all(array $params = [], array $headers = []): ListCustomerRespon * consolidated_invoicing?: bool, * token_id?: string, * business_entity_id?: string, + * brand_id?: string, * created_from_ip?: string, * invoice_notes?: string, * } $params Description of the parameters @@ -738,6 +740,20 @@ public function collectPayment(string $id, array $params, array $headers = []): */ public function recordExcessPayment(string $id, array $params, array $headers = []): RecordExcessPaymentCustomerResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/customers/send-payment-request-email?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return SendPaymentRequestCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function sendPaymentRequest(string $id, array $headers = []): SendPaymentRequestCustomerResponse; + /** * * @param array{ diff --git a/src/Actions/Contracts/DisputeActionsInterface.php b/src/Actions/Contracts/DisputeActionsInterface.php new file mode 100644 index 00000000..c2a6852e --- /dev/null +++ b/src/Actions/Contracts/DisputeActionsInterface.php @@ -0,0 +1,95 @@ + $headers + * @return RetrieveDisputeResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveDisputeResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/disputes/list-disputes?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * status?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * type?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * customer_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * transaction_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * amount?: array{ + * is?: mixed, + * is_not?: mixed, + * lt?: mixed, + * lte?: mixed, + * gt?: mixed, + * gte?: mixed, + * between?: mixed, + * }, + * created_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListDisputeResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListDisputeResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/EinvoiceActionsInterface.php b/src/Actions/Contracts/EinvoiceActionsInterface.php new file mode 100644 index 00000000..951b91fc --- /dev/null +++ b/src/Actions/Contracts/EinvoiceActionsInterface.php @@ -0,0 +1,67 @@ + $headers + * @return ListEinvoicesEinvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listEinvoices(array $params = [], array $headers = []): ListEinvoicesEinvoiceResponse; + + /** + * @see https://apidocs.chargebee.com/docs/api/einvoices/retrieve-an-e-invoice?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveEinvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveEinvoiceResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/EmailLogActionsInterface.php b/src/Actions/Contracts/EmailLogActionsInterface.php new file mode 100644 index 00000000..8c7f2f15 --- /dev/null +++ b/src/Actions/Contracts/EmailLogActionsInterface.php @@ -0,0 +1,44 @@ + $headers + * @return EmailLogsForCustomerEmailLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function emailLogsForCustomer(string $id, array $params = [], array $headers = []): EmailLogsForCustomerEmailLogResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/EstimateActionsInterface.php b/src/Actions/Contracts/EstimateActionsInterface.php index fb2331e4..46322b5d 100644 --- a/src/Actions/Contracts/EstimateActionsInterface.php +++ b/src/Actions/Contracts/EstimateActionsInterface.php @@ -112,6 +112,7 @@ public function renewalEstimate(string $id, array $params = [], array $headers = * charge_on_event?: string, * charge_once?: bool, * item_type?: string, + * description?: string, * charge_on_option?: string, * }>, * discounts?: array, * discounts?: array, * discounts?: array, * business_entity_id?: string, + * brand_id?: string, * layout?: string, * invoice_note?: string, * coupon?: string, @@ -227,7 +228,8 @@ public function updateCard(array $params, array $headers = []): UpdateCardHosted * subscription?: array{ * id?: string, * }, - * expiry?: int, + * brand_id?: string, + * expiry?: int, * billing_cycle?: int, * } $params Description of the parameters * @@ -283,6 +285,7 @@ public function events(array $params, array $headers = []): EventsHostedPageResp * }>, * layout?: string, * business_entity_id?: string, + * brand_id?: string, * redirect_url?: string, * coupon_ids?: array, * } $params Description of the parameters @@ -370,7 +373,8 @@ public function viewVoucher(array $params, array $headers = []): ViewVoucherHost * gateway?: string, * gateway_account_id?: string, * }, - * redirect_url?: string, + * brand_id?: string, + * redirect_url?: string, * currency_code?: string, * payment_method_save_policy?: string, * } $params Description of the parameters @@ -391,7 +395,8 @@ public function collectNow(array $params, array $headers = []): CollectNowHosted * quote?: array{ * id?: string, * }, - * redirect_url?: string, + * brand_id?: string, + * redirect_url?: string, * layout?: string, * } $params Description of the parameters * @@ -521,6 +526,7 @@ public function acceptQuote(array $params, array $headers = []): AcceptQuoteHost * }>, * layout?: string, * business_entity_id?: string, + * brand_id?: string, * billing_cycles?: int, * mandatory_items_to_remove?: array, * terms_to_charge?: int, @@ -551,7 +557,8 @@ public function checkoutNewForItems(array $params, array $headers = []): Checkou * customer?: array{ * locale?: string, * }, - * redirect_url?: string, + * brand_id?: string, + * redirect_url?: string, * } $params Description of the parameters * * @param array $headers @@ -639,6 +646,7 @@ public function claimGift(array $params, array $headers = []): ClaimGiftHostedPa * standard?: string, * }>, * layout?: string, + * brand_id?: string, * mandatory_items_to_remove?: array, * replace_items_list?: bool, * invoice_date?: int, @@ -675,7 +683,8 @@ public function checkoutExistingForItems(array $params, array $headers = []): Ch * subscription?: array{ * id?: string, * }, - * pass_thru_content?: string, + * brand_id?: string, + * pass_thru_content?: string, * cancel_url?: string, * redirect_url?: string, * locale?: string, @@ -746,6 +755,7 @@ public function retrieve(string $id, array $headers = []): RetrieveHostedPageRes * gateway_account_id?: string, * }, * business_entity_id?: string, + * brand_id?: string, * redirect_url?: string, * } $params Description of the parameters * diff --git a/src/Actions/Contracts/InvoiceActionsInterface.php b/src/Actions/Contracts/InvoiceActionsInterface.php index 942b1751..10f2fdda 100644 --- a/src/Actions/Contracts/InvoiceActionsInterface.php +++ b/src/Actions/Contracts/InvoiceActionsInterface.php @@ -18,6 +18,7 @@ use Chargebee\Responses\InvoiceResponse\CreateForChargeItemsAndChargesInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ListInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ChargeInvoiceResponse; +use Chargebee\Responses\InvoiceResponse\SendEmailInvoiceResponse; use Chargebee\Responses\InvoiceResponse\RecordPaymentInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ResumeDunningInvoiceResponse; use Chargebee\Responses\InvoiceResponse\AddAddonChargeInvoiceResponse; @@ -666,6 +667,20 @@ public function close(string $id, array $params = [], array $headers = []): Clos */ public function applyCredits(string $id, array $params = [], array $headers = []): ApplyCreditsInvoiceResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/invoices/send-invoice-email?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return SendEmailInvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function sendEmail(string $id, array $headers = []): SendEmailInvoiceResponse; + /** * @see https://apidocs.chargebee.com/docs/api/invoices/retrieve-an-invoice?lang=php-v4 * @param array{ @@ -1088,6 +1103,8 @@ public function delete(string $id, array $params = [], array $headers = []): Del * tax9_amount?: int, * tax10_name?: string, * tax10_amount?: int, + * is_partial_tax_applied?: bool, + * taxable_amount?: int, * proration_mode?: string, * created_at?: int, * }>, diff --git a/src/Actions/Contracts/LedgerOperationActionsInterface.php b/src/Actions/Contracts/LedgerOperationActionsInterface.php index 862dc17d..a146171d 100644 --- a/src/Actions/Contracts/LedgerOperationActionsInterface.php +++ b/src/Actions/Contracts/LedgerOperationActionsInterface.php @@ -62,7 +62,9 @@ public function capture(array $params, array $headers = []): CaptureLedgerOperat * @param array{ * subscription_id?: string, * unit_id?: string, + * id?: string, * amount?: string, + * effective_from?: int, * expires_at?: int, * metadata?: mixed, * } $params Description of the parameters diff --git a/src/Actions/Contracts/MeterActionsInterface.php b/src/Actions/Contracts/MeterActionsInterface.php index 7c0fdfdc..9c14370c 100644 --- a/src/Actions/Contracts/MeterActionsInterface.php +++ b/src/Actions/Contracts/MeterActionsInterface.php @@ -17,8 +17,8 @@ * limit?: int, * offset?: string, * name?: array{ - * is?: mixed, * starts_with?: mixed, + * is?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/Contracts/PaymentIntentActionsInterface.php b/src/Actions/Contracts/PaymentIntentActionsInterface.php index d79830ed..7ea39148 100644 --- a/src/Actions/Contracts/PaymentIntentActionsInterface.php +++ b/src/Actions/Contracts/PaymentIntentActionsInterface.php @@ -53,6 +53,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd * @see https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent?lang=php-v4 * @param array{ * business_entity_id?: string, + * brand_id?: string, * customer_id?: string, * amount?: int, * currency_code?: string, diff --git a/src/Actions/Contracts/PaymentScheduleActionsInterface.php b/src/Actions/Contracts/PaymentScheduleActionsInterface.php new file mode 100644 index 00000000..8b6dbab3 --- /dev/null +++ b/src/Actions/Contracts/PaymentScheduleActionsInterface.php @@ -0,0 +1,52 @@ + $headers + * @return ListPaymentScheduleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListPaymentScheduleResponse; + +} +?> \ No newline at end of file diff --git a/src/Actions/Contracts/PaymentScheduleSchemeActionsInterface.php b/src/Actions/Contracts/PaymentScheduleSchemeActionsInterface.php index 8ec62f0e..a6245640 100644 --- a/src/Actions/Contracts/PaymentScheduleSchemeActionsInterface.php +++ b/src/Actions/Contracts/PaymentScheduleSchemeActionsInterface.php @@ -4,6 +4,7 @@ use Chargebee\Responses\PaymentScheduleSchemeResponse\DeletePaymentScheduleSchemeResponse; use Chargebee\Responses\PaymentScheduleSchemeResponse\RetrievePaymentScheduleSchemeResponse; use Chargebee\Responses\PaymentScheduleSchemeResponse\CreatePaymentScheduleSchemeResponse; +use Chargebee\Responses\PaymentScheduleSchemeResponse\ListPaymentScheduleSchemeResponse; use Exception; use Chargebee\Exceptions\PaymentException; use Chargebee\Exceptions\OperationFailedException; @@ -27,6 +28,36 @@ */ public function retrieve(string $id, array $headers = []): RetrievePaymentScheduleSchemeResponse; + /** + * @see https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * updated_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListPaymentScheduleSchemeResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListPaymentScheduleSchemeResponse; + /** * @see https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/create-a-payment-schedule-scheme?lang=php-v4 * @param array{ diff --git a/src/Actions/Contracts/PaymentSourceActionsInterface.php b/src/Actions/Contracts/PaymentSourceActionsInterface.php index 5df49f3e..3782ca9a 100644 --- a/src/Actions/Contracts/PaymentSourceActionsInterface.php +++ b/src/Actions/Contracts/PaymentSourceActionsInterface.php @@ -52,6 +52,7 @@ * country?: string, * }, * customer_id?: string, + * brand_id?: string, * type?: string, * gateway_account_id?: string, * reference_id?: string, @@ -111,6 +112,7 @@ public function delete(string $id, array $headers = []): DeletePaymentSourceResp * additional_information?: mixed, * }, * customer_id?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * } $params Description of the parameters * @@ -243,6 +245,7 @@ public function exportPaymentSource(string $id, array $params, array $headers = * additional_information?: mixed, * }, * customer_id?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * } $params Description of the parameters * @@ -280,6 +283,7 @@ public function retrieve(string $id, array $headers = []): RetrievePaymentSource * billing_address?: mixed, * }, * customer_id?: string, + * brand_id?: string, * } $params Description of the parameters * * @param array $headers @@ -300,6 +304,7 @@ public function createVoucherPaymentSource(array $params, array $headers = []): * type?: string, * tmp_token?: string, * issuing_country?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * additional_information?: mixed, * } $params Description of the parameters @@ -331,6 +336,9 @@ public function createUsingTempToken(array $params, array $headers = []): Create * billing_country?: string, * additional_information?: mixed, * }, + * network_transaction_reference?: array{ + * original_network_transaction_id?: string, + * }, * gateway_meta_data?: mixed, * reference_transaction?: string, * } $params Description of the parameters @@ -365,6 +373,7 @@ public function switchGatewayAccount(string $id, array $params, array $headers = * @see https://apidocs.chargebee.com/docs/api/payment_sources/create-using-chargebee-token?lang=php-v4 * @param array{ * customer_id?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * token_id?: string, * } $params Description of the parameters @@ -415,6 +424,7 @@ public function deleteLocal(string $id, array $headers = []): DeleteLocalPayment * billing_address?: mixed, * }, * customer_id?: string, + * brand_id?: string, * issuing_country?: string, * replace_primary_payment_source?: bool, * } $params Description of the parameters diff --git a/src/Actions/Contracts/PricingPageSessionActionsInterface.php b/src/Actions/Contracts/PricingPageSessionActionsInterface.php index 46db726c..2aa66dd1 100644 --- a/src/Actions/Contracts/PricingPageSessionActionsInterface.php +++ b/src/Actions/Contracts/PricingPageSessionActionsInterface.php @@ -119,6 +119,7 @@ public function createForExistingSubscription(array $params, array $headers = [] * }>, * redirect_url?: string, * business_entity_id?: string, + * brand_id?: string, * auto_select_local_currency?: bool, * custom?: mixed, * } $params Description of the parameters diff --git a/src/Actions/Contracts/PromotionalGrantActionsInterface.php b/src/Actions/Contracts/PromotionalGrantActionsInterface.php index d5fbfe32..5970b76d 100644 --- a/src/Actions/Contracts/PromotionalGrantActionsInterface.php +++ b/src/Actions/Contracts/PromotionalGrantActionsInterface.php @@ -16,7 +16,9 @@ * @param array{ * subscription_id?: string, * unit_id?: string, + * id?: string, * amount?: string, + * effective_from?: int, * expires_at?: int, * metadata?: mixed, * } $params Description of the parameters diff --git a/src/Actions/Contracts/RampActionsInterface.php b/src/Actions/Contracts/RampActionsInterface.php index 1df8df1c..a075c20d 100644 --- a/src/Actions/Contracts/RampActionsInterface.php +++ b/src/Actions/Contracts/RampActionsInterface.php @@ -32,7 +32,10 @@ public function retrieve(string $id, array $headers = []): RetrieveRampResponse; /** * @see https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp?lang=php-v4 * @param array{ - * contract_term?: array{ + * billing_configuration?: array{ + * po_number?: string, + * }, + * contract_term?: array{ * action_at_term_end?: string, * cancellation_cutoff_period?: int, * renewal_billing_cycles?: int, @@ -149,7 +152,10 @@ public function all(array $params, array $headers = []): ListRampResponse; /** * @see https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp?lang=php-v4 * @param array{ - * contract_term?: array{ + * billing_configuration?: array{ + * po_number?: string, + * }, + * contract_term?: array{ * action_at_term_end?: string, * cancellation_cutoff_period?: int, * renewal_billing_cycles?: int, diff --git a/src/Actions/Contracts/SubscriptionActionsInterface.php b/src/Actions/Contracts/SubscriptionActionsInterface.php index c54bf5ff..02c2303a 100644 --- a/src/Actions/Contracts/SubscriptionActionsInterface.php +++ b/src/Actions/Contracts/SubscriptionActionsInterface.php @@ -174,6 +174,7 @@ public function removeAdvanceInvoiceSchedule(string $id, array $params = [], arr * charge_once?: bool, * charge_on_option?: string, * item_type?: string, + * description?: string, * proration_type?: string, * usage_accumulation_reset_frequency?: string, * }>, @@ -661,6 +662,7 @@ public function all(array $params = [], array $headers = []): ListSubscriptionRe * apply_till?: int, * }>, * id?: string, + * brand_id?: string, * plan_id?: string, * plan_quantity?: int, * plan_quantity_in_decimal?: string, @@ -798,6 +800,7 @@ public function subscriptionsForCustomer(string $id, array $params = [], array $ * apply_till?: int, * }>, * id?: string, + * brand_id?: string, * plan_id?: string, * plan_quantity?: int, * plan_quantity_in_decimal?: string, @@ -886,6 +889,7 @@ public function createForCustomer(string $id, array $params, array $headers = [] * charge_on_event?: string, * charge_once?: bool, * item_type?: string, + * description?: string, * }>, * discounts?: array, @@ -1226,6 +1231,7 @@ public function delete(string $id, array $headers = []): DeleteSubscriptionRespo * }>, * id?: string, * business_entity_id?: string, + * brand_id?: string, * trial_end?: int, * billing_cycles?: int, * setup_fee?: int, diff --git a/src/Actions/CreditNoteActions.php b/src/Actions/CreditNoteActions.php index e84f4452..0ad51336 100644 --- a/src/Actions/CreditNoteActions.php +++ b/src/Actions/CreditNoteActions.php @@ -3,6 +3,7 @@ use Chargebee\Responses\CreditNoteResponse\ResendEinvoiceCreditNoteResponse; use Chargebee\Actions\Contracts\CreditNoteActionsInterface; +use Chargebee\Responses\CreditNoteResponse\SendEmailCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\SendEinvoiceCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\ImportCreditNoteCreditNoteResponse; use Chargebee\Responses\CreditNoteResponse\ListCreditNoteResponse; @@ -125,6 +126,8 @@ public function recordRefund(string $id, array $params, array $headers = []): Re * tax9_amount?: int, * tax10_name?: string, * tax10_amount?: int, + * is_partial_tax_applied?: bool, + * taxable_amount?: int, * proration_mode?: string, * }>, * line_item_tiers?: arraydata, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/credit_notes/send-credit-note-email?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return SendEmailCreditNoteResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function sendEmail(string $id, array $headers = []): SendEmailCreditNoteResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["credit_notes",$id,"send_email"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("creditNote") + ->withTelemetryOperation("sendEmail") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return SendEmailCreditNoteResponse::from($respObject->data, $respObject->headers); + } + } ?> \ No newline at end of file diff --git a/src/Actions/CustomerActions.php b/src/Actions/CustomerActions.php index 48763f83..dbe63185 100644 --- a/src/Actions/CustomerActions.php +++ b/src/Actions/CustomerActions.php @@ -9,6 +9,7 @@ use Chargebee\Responses\CustomerResponse\ContactsForCustomerCustomerResponse; use Chargebee\Responses\CustomerResponse\DeleteContactCustomerResponse; use Chargebee\Responses\CustomerResponse\ListCustomerResponse; +use Chargebee\Responses\CustomerResponse\SendPaymentRequestCustomerResponse; use Chargebee\Responses\CustomerResponse\DeleteCustomerResponse; use Chargebee\Responses\CustomerResponse\MergeCustomerResponse; use Chargebee\Responses\CustomerResponse\DeleteRelationshipCustomerResponse; @@ -835,6 +836,7 @@ public function all(array $params = [], array $headers = []): ListCustomerRespon * consolidated_invoicing?: bool, * token_id?: string, * business_entity_id?: string, + * brand_id?: string, * created_from_ip?: string, * invoice_notes?: string, * } $params Description of the parameters @@ -1191,6 +1193,39 @@ public function recordExcessPayment(string $id, array $params, array $headers = return RecordExcessPaymentCustomerResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/customers/send-payment-request-email?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return SendPaymentRequestCustomerResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function sendPaymentRequest(string $id, array $headers = []): SendPaymentRequestCustomerResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["customers",$id,"send_payment_request"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("customer") + ->withTelemetryOperation("sendPaymentRequest") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return SendPaymentRequestCustomerResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/customers/set-promotional-credits-for-a-customer?lang=php-v4 * @param array{ diff --git a/src/Actions/DisputeActions.php b/src/Actions/DisputeActions.php new file mode 100644 index 00000000..8c272ee0 --- /dev/null +++ b/src/Actions/DisputeActions.php @@ -0,0 +1,145 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/disputes/retrieve-a-dispute?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveDisputeResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveDisputeResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["disputes",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("dispute") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveDisputeResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/disputes/list-disputes?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * status?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * type?: array{ + * is?: mixed, + * is_not?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * customer_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * transaction_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * amount?: array{ + * is?: mixed, + * is_not?: mixed, + * lt?: mixed, + * lte?: mixed, + * gt?: mixed, + * gte?: mixed, + * between?: mixed, + * }, + * created_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListDisputeResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListDisputeResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["disputes"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("dispute") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListDisputeResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/EinvoiceActions.php b/src/Actions/EinvoiceActions.php new file mode 100644 index 00000000..d94095bc --- /dev/null +++ b/src/Actions/EinvoiceActions.php @@ -0,0 +1,117 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * is?: mixed, + * in?: mixed, + * }, + * reference_id?: array{ + * is?: mixed, + * in?: mixed, + * }, + * updated_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * sort_by?: array{ + * asc?: string, + * desc?: string, + * }, + * invoice_id?: string, + * credit_note_id?: string, + * } $params Description of the parameters + * + * @param array $headers + * @return ListEinvoicesEinvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function listEinvoices(array $params = [], array $headers = []): ListEinvoicesEinvoiceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["einvoices"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("einvoice") + ->withTelemetryOperation("listEinvoices") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListEinvoicesEinvoiceResponse::from($respObject->data, $respObject->headers); + } + + /** + * @see https://apidocs.chargebee.com/docs/api/einvoices/retrieve-an-e-invoice?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return RetrieveEinvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function retrieve(string $id, array $headers = []): RetrieveEinvoiceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["einvoices",$id]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withTelemetryResource("einvoice") + ->withTelemetryOperation("retrieve") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return RetrieveEinvoiceResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/EmailLogActions.php b/src/Actions/EmailLogActions.php new file mode 100644 index 00000000..980caa66 --- /dev/null +++ b/src/Actions/EmailLogActions.php @@ -0,0 +1,76 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/email_logs/list-email-logs-for-a-customer?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * sent_on?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * business_entity_id?: array{ + * is?: mixed, + * }, + * brand_id?: array{ + * is?: mixed, + * }, + * } $params Description of the parameters + * @param string $id + * @param array $headers + * @return EmailLogsForCustomerEmailLogResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function emailLogsForCustomer(string $id, array $params = [], array $headers = []): EmailLogsForCustomerEmailLogResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["customers",$id,"email_logs"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("emailLog") + ->withTelemetryOperation("emailLogsForCustomer") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return EmailLogsForCustomerEmailLogResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/EstimateActions.php b/src/Actions/EstimateActions.php index 67d1d0f0..818828b1 100644 --- a/src/Actions/EstimateActions.php +++ b/src/Actions/EstimateActions.php @@ -143,6 +143,7 @@ public function renewalEstimate(string $id, array $params = [], array $headers = * charge_on_event?: string, * charge_once?: bool, * item_type?: string, + * description?: string, * charge_on_option?: string, * }>, * discounts?: array, * discounts?: array, * discounts?: array, * business_entity_id?: string, + * brand_id?: string, * layout?: string, * invoice_note?: string, * coupon?: string, @@ -300,7 +301,8 @@ public function updateCard(array $params, array $headers = []): UpdateCardHosted * subscription?: array{ * id?: string, * }, - * expiry?: int, + * brand_id?: string, + * expiry?: int, * billing_cycle?: int, * } $params Description of the parameters * @@ -397,6 +399,7 @@ public function events(array $params, array $headers = []): EventsHostedPageResp * }>, * layout?: string, * business_entity_id?: string, + * brand_id?: string, * redirect_url?: string, * coupon_ids?: array, * } $params Description of the parameters @@ -543,7 +546,8 @@ public function viewVoucher(array $params, array $headers = []): ViewVoucherHost * gateway?: string, * gateway_account_id?: string, * }, - * redirect_url?: string, + * brand_id?: string, + * redirect_url?: string, * currency_code?: string, * payment_method_save_policy?: string, * } $params Description of the parameters @@ -584,7 +588,8 @@ public function collectNow(array $params, array $headers = []): CollectNowHosted * quote?: array{ * id?: string, * }, - * redirect_url?: string, + * brand_id?: string, + * redirect_url?: string, * layout?: string, * } $params Description of the parameters * @@ -734,6 +739,7 @@ public function acceptQuote(array $params, array $headers = []): AcceptQuoteHost * }>, * layout?: string, * business_entity_id?: string, + * brand_id?: string, * billing_cycles?: int, * mandatory_items_to_remove?: array, * terms_to_charge?: int, @@ -784,7 +790,8 @@ public function checkoutNewForItems(array $params, array $headers = []): Checkou * customer?: array{ * locale?: string, * }, - * redirect_url?: string, + * brand_id?: string, + * redirect_url?: string, * } $params Description of the parameters * * @param array $headers @@ -892,6 +899,7 @@ public function claimGift(array $params, array $headers = []): ClaimGiftHostedPa * standard?: string, * }>, * layout?: string, + * brand_id?: string, * mandatory_items_to_remove?: array, * replace_items_list?: bool, * invoice_date?: int, @@ -948,7 +956,8 @@ public function checkoutExistingForItems(array $params, array $headers = []): Ch * subscription?: array{ * id?: string, * }, - * pass_thru_content?: string, + * brand_id?: string, + * pass_thru_content?: string, * cancel_url?: string, * redirect_url?: string, * locale?: string, @@ -1096,6 +1105,7 @@ public function retrieve(string $id, array $headers = []): RetrieveHostedPageRes * gateway_account_id?: string, * }, * business_entity_id?: string, + * brand_id?: string, * redirect_url?: string, * } $params Description of the parameters * diff --git a/src/Actions/InvoiceActions.php b/src/Actions/InvoiceActions.php index 63271ee9..15418629 100644 --- a/src/Actions/InvoiceActions.php +++ b/src/Actions/InvoiceActions.php @@ -18,6 +18,7 @@ use Chargebee\Responses\InvoiceResponse\CreateForChargeItemsAndChargesInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ListInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ChargeInvoiceResponse; +use Chargebee\Responses\InvoiceResponse\SendEmailInvoiceResponse; use Chargebee\Actions\Contracts\InvoiceActionsInterface; use Chargebee\Responses\InvoiceResponse\RecordPaymentInvoiceResponse; use Chargebee\Responses\InvoiceResponse\ResumeDunningInvoiceResponse; @@ -1037,6 +1038,39 @@ public function applyCredits(string $id, array $params = [], array $headers = [] return ApplyCreditsInvoiceResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/invoices/send-invoice-email?lang=php-v4 + * + * @param string $id + * @param array $headers + * @return SendEmailInvoiceResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function sendEmail(string $id, array $headers = []): SendEmailInvoiceResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("post") + ->withUriPaths(["invoices",$id,"send_email"]) + ->withParamEncoder( new URLFormEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withIdempotent(true) + ->withTelemetryResource("invoice") + ->withTelemetryOperation("sendEmail") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return SendEmailInvoiceResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/invoices/retrieve-an-invoice?lang=php-v4 * @param array{ @@ -1599,6 +1633,8 @@ public function delete(string $id, array $params = [], array $headers = []): Del * tax9_amount?: int, * tax10_name?: string, * tax10_amount?: int, + * is_partial_tax_applied?: bool, + * taxable_amount?: int, * proration_mode?: string, * created_at?: int, * }>, diff --git a/src/Actions/LedgerOperationActions.php b/src/Actions/LedgerOperationActions.php index 689e7578..ca1fcfd4 100644 --- a/src/Actions/LedgerOperationActions.php +++ b/src/Actions/LedgerOperationActions.php @@ -120,7 +120,9 @@ public function capture(array $params, array $headers = []): CaptureLedgerOperat * @param array{ * subscription_id?: string, * unit_id?: string, + * id?: string, * amount?: string, + * effective_from?: int, * expires_at?: int, * metadata?: mixed, * } $params Description of the parameters diff --git a/src/Actions/MeterActions.php b/src/Actions/MeterActions.php index 5bd549c4..83f0acc8 100644 --- a/src/Actions/MeterActions.php +++ b/src/Actions/MeterActions.php @@ -30,8 +30,8 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * limit?: int, * offset?: string, * name?: array{ - * is?: mixed, * starts_with?: mixed, + * is?: mixed, * }, * sort_by?: array{ * asc?: string, diff --git a/src/Actions/PaymentIntentActions.php b/src/Actions/PaymentIntentActions.php index 13b40f28..def54232 100644 --- a/src/Actions/PaymentIntentActions.php +++ b/src/Actions/PaymentIntentActions.php @@ -104,6 +104,7 @@ public function update(string $id, array $params = [], array $headers = []): Upd * @see https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent?lang=php-v4 * @param array{ * business_entity_id?: string, + * brand_id?: string, * customer_id?: string, * amount?: int, * currency_code?: string, diff --git a/src/Actions/PaymentScheduleActions.php b/src/Actions/PaymentScheduleActions.php new file mode 100644 index 00000000..db07fc49 --- /dev/null +++ b/src/Actions/PaymentScheduleActions.php @@ -0,0 +1,84 @@ +httpClientFactory = $httpClientFactory; + $this->env = $env; + } + + /** + * @see https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * invoice_id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * updated_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListPaymentScheduleResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListPaymentScheduleResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["payment_schedules"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("paymentSchedule") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListPaymentScheduleResponse::from($respObject->data, $respObject->headers); + } + +} +?> \ No newline at end of file diff --git a/src/Actions/PaymentScheduleSchemeActions.php b/src/Actions/PaymentScheduleSchemeActions.php index 1f0fbc97..0b5e28a5 100644 --- a/src/Actions/PaymentScheduleSchemeActions.php +++ b/src/Actions/PaymentScheduleSchemeActions.php @@ -5,6 +5,8 @@ use Chargebee\Responses\PaymentScheduleSchemeResponse\DeletePaymentScheduleSchemeResponse; use Chargebee\Responses\PaymentScheduleSchemeResponse\RetrievePaymentScheduleSchemeResponse; use Chargebee\Responses\PaymentScheduleSchemeResponse\CreatePaymentScheduleSchemeResponse; +use Chargebee\Responses\PaymentScheduleSchemeResponse\ListPaymentScheduleSchemeResponse; +use Chargebee\ValueObjects\Encoders\ListParamEncoder; use Chargebee\ValueObjects\Encoders\URLFormEncoder; use Chargebee\ValueObjects\Transporters\ChargebeePayload; use Chargebee\ValueObjects\APIRequester; @@ -57,6 +59,55 @@ public function retrieve(string $id, array $headers = []): RetrievePaymentSchedu return RetrievePaymentScheduleSchemeResponse::from($respObject->data, $respObject->headers); } + /** + * @see https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes?lang=php-v4 + * @param array{ + * limit?: int, + * offset?: string, + * id?: array{ + * is?: mixed, + * is_not?: mixed, + * starts_with?: mixed, + * in?: mixed, + * not_in?: mixed, + * }, + * updated_at?: array{ + * after?: mixed, + * before?: mixed, + * on?: mixed, + * between?: mixed, + * }, + * } $params Description of the parameters + * + * @param array $headers + * @return ListPaymentScheduleSchemeResponse + * @throws PaymentException + * @throws OperationFailedException + * @throws APIError + * @throws InvalidRequestException + * @throws Exception + */ + public function all(array $params = [], array $headers = []): ListPaymentScheduleSchemeResponse + { + $jsonKeys = [ + ]; + $payload = ChargebeePayload::builder() + ->withEnvironment($this->env) + ->withHttpMethod("get") + ->withUriPaths(["payment_schedule_schemes"]) + ->withParamEncoder(new ListParamEncoder()) + ->withSubDomain(null) + ->withJsonKeys($jsonKeys) + ->withHeaders($headers) + ->withParams($params) + ->withTelemetryResource("paymentScheduleScheme") + ->withTelemetryOperation("list") + ->build(); + $apiRequester = new APIRequester($this->httpClientFactory, $this->env); + $respObject = $apiRequester->makeRequest($payload); + return ListPaymentScheduleSchemeResponse::from($respObject->data, $respObject->headers); + } + /** * @see https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/create-a-payment-schedule-scheme?lang=php-v4 * @param array{ diff --git a/src/Actions/PaymentSourceActions.php b/src/Actions/PaymentSourceActions.php index 1a960045..e5c0bd06 100644 --- a/src/Actions/PaymentSourceActions.php +++ b/src/Actions/PaymentSourceActions.php @@ -65,6 +65,7 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * country?: string, * }, * customer_id?: string, + * brand_id?: string, * type?: string, * gateway_account_id?: string, * reference_id?: string, @@ -164,6 +165,7 @@ public function delete(string $id, array $headers = []): DeletePaymentSourceResp * additional_information?: mixed, * }, * customer_id?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * } $params Description of the parameters * @@ -395,6 +397,7 @@ public function exportPaymentSource(string $id, array $params, array $headers = * additional_information?: mixed, * }, * customer_id?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * } $params Description of the parameters * @@ -472,6 +475,7 @@ public function retrieve(string $id, array $headers = []): RetrievePaymentSource * billing_address?: mixed, * }, * customer_id?: string, + * brand_id?: string, * } $params Description of the parameters * * @param array $headers @@ -513,6 +517,7 @@ public function createVoucherPaymentSource(array $params, array $headers = []): * type?: string, * tmp_token?: string, * issuing_country?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * additional_information?: mixed, * } $params Description of the parameters @@ -565,6 +570,9 @@ public function createUsingTempToken(array $params, array $headers = []): Create * billing_country?: string, * additional_information?: mixed, * }, + * network_transaction_reference?: array{ + * original_network_transaction_id?: string, + * }, * gateway_meta_data?: mixed, * reference_transaction?: string, * } $params Description of the parameters @@ -641,6 +649,7 @@ public function switchGatewayAccount(string $id, array $params, array $headers = * @see https://apidocs.chargebee.com/docs/api/payment_sources/create-using-chargebee-token?lang=php-v4 * @param array{ * customer_id?: string, + * brand_id?: string, * replace_primary_payment_source?: bool, * token_id?: string, * } $params Description of the parameters @@ -730,6 +739,7 @@ public function deleteLocal(string $id, array $headers = []): DeleteLocalPayment * billing_address?: mixed, * }, * customer_id?: string, + * brand_id?: string, * issuing_country?: string, * replace_primary_payment_source?: bool, * } $params Description of the parameters diff --git a/src/Actions/PricingPageSessionActions.php b/src/Actions/PricingPageSessionActions.php index 015bb42c..150d8ca5 100644 --- a/src/Actions/PricingPageSessionActions.php +++ b/src/Actions/PricingPageSessionActions.php @@ -152,6 +152,7 @@ public function createForExistingSubscription(array $params, array $headers = [] * }>, * redirect_url?: string, * business_entity_id?: string, + * brand_id?: string, * auto_select_local_currency?: bool, * custom?: mixed, * } $params Description of the parameters diff --git a/src/Actions/PromotionalGrantActions.php b/src/Actions/PromotionalGrantActions.php index 1c88d3c8..14a2701d 100644 --- a/src/Actions/PromotionalGrantActions.php +++ b/src/Actions/PromotionalGrantActions.php @@ -29,7 +29,9 @@ public function __construct(HttpClientFactory $httpClientFactory, Environment $e * @param array{ * subscription_id?: string, * unit_id?: string, + * id?: string, * amount?: string, + * effective_from?: int, * expires_at?: int, * metadata?: mixed, * } $params Description of the parameters diff --git a/src/Actions/RampActions.php b/src/Actions/RampActions.php index 897af978..2db6c3a1 100644 --- a/src/Actions/RampActions.php +++ b/src/Actions/RampActions.php @@ -63,7 +63,10 @@ public function retrieve(string $id, array $headers = []): RetrieveRampResponse /** * @see https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp?lang=php-v4 * @param array{ - * contract_term?: array{ + * billing_configuration?: array{ + * po_number?: string, + * }, + * contract_term?: array{ * action_at_term_end?: string, * cancellation_cutoff_period?: int, * renewal_billing_cycles?: int, @@ -219,7 +222,10 @@ public function all(array $params, array $headers = []): ListRampResponse /** * @see https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp?lang=php-v4 * @param array{ - * contract_term?: array{ + * billing_configuration?: array{ + * po_number?: string, + * }, + * contract_term?: array{ * action_at_term_end?: string, * cancellation_cutoff_period?: int, * renewal_billing_cycles?: int, diff --git a/src/Actions/SubscriptionActions.php b/src/Actions/SubscriptionActions.php index ec1dd8c2..b399b821 100644 --- a/src/Actions/SubscriptionActions.php +++ b/src/Actions/SubscriptionActions.php @@ -207,6 +207,7 @@ public function removeAdvanceInvoiceSchedule(string $id, array $params = [], arr * charge_once?: bool, * charge_on_option?: string, * item_type?: string, + * description?: string, * proration_type?: string, * usage_accumulation_reset_frequency?: string, * }>, @@ -816,6 +817,7 @@ public function all(array $params = [], array $headers = []): ListSubscriptionRe * apply_till?: int, * }>, * id?: string, + * brand_id?: string, * plan_id?: string, * plan_quantity?: int, * plan_quantity_in_decimal?: string, @@ -1016,6 +1018,7 @@ public function subscriptionsForCustomer(string $id, array $params = [], array $ * apply_till?: int, * }>, * id?: string, + * brand_id?: string, * plan_id?: string, * plan_quantity?: int, * plan_quantity_in_decimal?: string, @@ -1126,6 +1129,7 @@ public function createForCustomer(string $id, array $params, array $headers = [] * charge_on_event?: string, * charge_once?: bool, * item_type?: string, + * description?: string, * }>, * discounts?: array, @@ -1662,6 +1667,7 @@ public function delete(string $id, array $headers = []): DeleteSubscriptionRespo * }>, * id?: string, * business_entity_id?: string, + * brand_id?: string, * trial_end?: int, * billing_cycles?: int, * setup_fee?: int, diff --git a/src/ChargebeeClient.php b/src/ChargebeeClient.php index 4dd2eb8c..1b8f415e 100644 --- a/src/ChargebeeClient.php +++ b/src/ChargebeeClient.php @@ -12,6 +12,10 @@ use Chargebee\Actions\AttachedItemActions; use Chargebee\Actions\Contracts\BusinessEntityActionsInterface; use Chargebee\Actions\BusinessEntityActions; +use Chargebee\Actions\Contracts\BusinessRuleActionsInterface; +use Chargebee\Actions\BusinessRuleActions; +use Chargebee\Actions\Contracts\BusinessRulesetActionsInterface; +use Chargebee\Actions\BusinessRulesetActions; use Chargebee\Actions\Contracts\CardActionsInterface; use Chargebee\Actions\CardActions; use Chargebee\Actions\Contracts\CommentActionsInterface; @@ -36,6 +40,12 @@ use Chargebee\Actions\CustomerEntitlementActions; use Chargebee\Actions\Contracts\DifferentialPriceActionsInterface; use Chargebee\Actions\DifferentialPriceActions; +use Chargebee\Actions\Contracts\DisputeActionsInterface; +use Chargebee\Actions\DisputeActions; +use Chargebee\Actions\Contracts\EinvoiceActionsInterface; +use Chargebee\Actions\EinvoiceActions; +use Chargebee\Actions\Contracts\EmailLogActionsInterface; +use Chargebee\Actions\EmailLogActions; use Chargebee\Actions\Contracts\EntitlementActionsInterface; use Chargebee\Actions\EntitlementActions; use Chargebee\Actions\Contracts\EntitlementOverrideActionsInterface; @@ -90,6 +100,8 @@ use Chargebee\Actions\OrderActions; use Chargebee\Actions\Contracts\PaymentIntentActionsInterface; use Chargebee\Actions\PaymentIntentActions; +use Chargebee\Actions\Contracts\PaymentScheduleActionsInterface; +use Chargebee\Actions\PaymentScheduleActions; use Chargebee\Actions\Contracts\PaymentScheduleSchemeActionsInterface; use Chargebee\Actions\PaymentScheduleSchemeActions; use Chargebee\Actions\Contracts\PaymentSourceActionsInterface; @@ -255,6 +267,14 @@ public function businessEntity() :BusinessEntityActionsInterface { return new BusinessEntityActions($this->httpClientFactory, $this->env); } + public function businessRule() :BusinessRuleActionsInterface { + return new BusinessRuleActions($this->httpClientFactory, $this->env); + } + + public function businessRuleset() :BusinessRulesetActionsInterface { + return new BusinessRulesetActions($this->httpClientFactory, $this->env); + } + public function card() :CardActionsInterface { return new CardActions($this->httpClientFactory, $this->env); } @@ -303,6 +323,18 @@ public function differentialPrice() :DifferentialPriceActionsInterface { return new DifferentialPriceActions($this->httpClientFactory, $this->env); } + public function dispute() :DisputeActionsInterface { + return new DisputeActions($this->httpClientFactory, $this->env); + } + + public function einvoice() :EinvoiceActionsInterface { + return new EinvoiceActions($this->httpClientFactory, $this->env); + } + + public function emailLog() :EmailLogActionsInterface { + return new EmailLogActions($this->httpClientFactory, $this->env); + } + public function entitlement() :EntitlementActionsInterface { return new EntitlementActions($this->httpClientFactory, $this->env); } @@ -411,6 +443,10 @@ public function paymentIntent() :PaymentIntentActionsInterface { return new PaymentIntentActions($this->httpClientFactory, $this->env); } + public function paymentSchedule() :PaymentScheduleActionsInterface { + return new PaymentScheduleActions($this->httpClientFactory, $this->env); + } + public function paymentScheduleScheme() :PaymentScheduleSchemeActionsInterface { return new PaymentScheduleSchemeActions($this->httpClientFactory, $this->env); } diff --git a/src/Enums/EnabledEvents.php b/src/Enums/EnabledEvents.php index 0e4537ab..bf73a722 100644 --- a/src/Enums/EnabledEvents.php +++ b/src/Enums/EnabledEvents.php @@ -61,6 +61,8 @@ enum EnabledEvents : string { case CREDIT_NOTE_CREATED_WITH_BACKDATING = "credit_note_created_with_backdating"; case CREDIT_NOTE_UPDATED = "credit_note_updated"; case CREDIT_NOTE_DELETED = "credit_note_deleted"; + case EINVOICE_CREATED = "einvoice_created"; + case EINVOICE_UPDATED = "einvoice_updated"; case PAYMENT_SCHEDULES_CREATED = "payment_schedules_created"; case PAYMENT_SCHEDULES_UPDATED = "payment_schedules_updated"; case PAYMENT_SCHEDULE_SCHEME_CREATED = "payment_schedule_scheme_created"; @@ -231,9 +233,21 @@ enum EnabledEvents : string { case GRANT_BLOCKS_CREATED = "grant_blocks_created"; case GRANT_BLOCKS_UPDATED = "grant_blocks_updated"; case LEDGER_UPDATED = "ledger_updated"; + case BUSINESS_RULE_CREATED = "business_rule_created"; + case BUSINESS_RULE_UPDATED = "business_rule_updated"; + case BUSINESS_RULE_ACTIVATED = "business_rule_activated"; + case BUSINESS_RULE_DEACTIVATED = "business_rule_deactivated"; + case BUSINESS_RULE_DELETED = "business_rule_deleted"; + case BUSINESS_RULE_RELEASED = "business_rule_released"; case VAULT_TOKEN_CREATED = "vault_token_created"; case VAULT_TOKEN_UPDATED = "vault_token_updated"; case VAULT_TOKEN_DELETED = "vault_token_deleted"; + case BUSINESS_RULES_APPLIED = "business_rules_applied"; + case BUSINESS_RULESET_CREATED = "business_ruleset_created"; + case BUSINESS_RULESET_UPDATED = "business_ruleset_updated"; + case BUSINESS_RULESET_ACTIVATED = "business_ruleset_activated"; + case BUSINESS_RULESET_DEACTIVATED = "business_ruleset_deactivated"; + case BUSINESS_RULESET_DELETED = "business_ruleset_deleted"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/EntityType.php b/src/Enums/EntityType.php index 95712d91..c559cb98 100644 --- a/src/Enums/EntityType.php +++ b/src/Enums/EntityType.php @@ -42,9 +42,10 @@ enum EntityType : string { case OMNICHANNEL_ONE_TIME_ORDER_ITEM = "omnichannel_one_time_order_item"; case USAGE_FILE = "usage_file"; case BUSINESS_RULE = "business_rule"; - case RULESET = "ruleset"; + case BUSINESS_RULESET = "business_ruleset"; case ALERT_STATUS = "alert_status"; case OMNICHANNEL_SUBSCRIPTION_ITEM_METRIC = "omnichannel_subscription_item_metric"; + case PRICE_RAMP = "price_ramp"; /* * @depcreated */ diff --git a/src/Enums/EventType.php b/src/Enums/EventType.php index d0b24f0f..3127f759 100644 --- a/src/Enums/EventType.php +++ b/src/Enums/EventType.php @@ -61,6 +61,8 @@ enum EventType : string { case CREDIT_NOTE_CREATED_WITH_BACKDATING = "credit_note_created_with_backdating"; case CREDIT_NOTE_UPDATED = "credit_note_updated"; case CREDIT_NOTE_DELETED = "credit_note_deleted"; + case EINVOICE_CREATED = "einvoice_created"; + case EINVOICE_UPDATED = "einvoice_updated"; case PAYMENT_SCHEDULES_CREATED = "payment_schedules_created"; case PAYMENT_SCHEDULES_UPDATED = "payment_schedules_updated"; case PAYMENT_SCHEDULE_SCHEME_CREATED = "payment_schedule_scheme_created"; @@ -222,9 +224,21 @@ enum EventType : string { case GRANT_BLOCKS_CREATED = "grant_blocks_created"; case GRANT_BLOCKS_UPDATED = "grant_blocks_updated"; case LEDGER_UPDATED = "ledger_updated"; + case BUSINESS_RULE_CREATED = "business_rule_created"; + case BUSINESS_RULE_UPDATED = "business_rule_updated"; + case BUSINESS_RULE_ACTIVATED = "business_rule_activated"; + case BUSINESS_RULE_DEACTIVATED = "business_rule_deactivated"; + case BUSINESS_RULE_DELETED = "business_rule_deleted"; + case BUSINESS_RULE_RELEASED = "business_rule_released"; case VAULT_TOKEN_CREATED = "vault_token_created"; case VAULT_TOKEN_UPDATED = "vault_token_updated"; case VAULT_TOKEN_DELETED = "vault_token_deleted"; + case BUSINESS_RULES_APPLIED = "business_rules_applied"; + case BUSINESS_RULESET_CREATED = "business_ruleset_created"; + case BUSINESS_RULESET_UPDATED = "business_ruleset_updated"; + case BUSINESS_RULESET_ACTIVATED = "business_ruleset_activated"; + case BUSINESS_RULESET_DEACTIVATED = "business_ruleset_deactivated"; + case BUSINESS_RULESET_DELETED = "business_ruleset_deleted"; case PLAN_CREATED = "plan_created"; case PLAN_UPDATED = "plan_updated"; case PLAN_DELETED = "plan_deleted"; diff --git a/src/Enums/Gateway.php b/src/Enums/Gateway.php index 39406905..7a316fcf 100644 --- a/src/Enums/Gateway.php +++ b/src/Enums/Gateway.php @@ -62,6 +62,7 @@ enum Gateway : string { case TEMPUS = "tempus"; case MOYASAR = "moyasar"; case PAYWAY = "payway"; + case PAYU = "payu"; case GOCARDLESS = "gocardless"; case NOT_APPLICABLE = "not_applicable"; case UNKNOWN = "unknown"; diff --git a/src/Enums/GatewayName.php b/src/Enums/GatewayName.php index f7d70a18..ca22be4c 100644 --- a/src/Enums/GatewayName.php +++ b/src/Enums/GatewayName.php @@ -63,6 +63,7 @@ enum GatewayName : string { case TEMPUS = "tempus"; case MOYASAR = "moyasar"; case PAYWAY = "payway"; + case PAYU = "payu"; case NOT_APPLICABLE = "not_applicable"; case UNKNOWN = "unknown"; diff --git a/src/Enums/PaymentMethod.php b/src/Enums/PaymentMethod.php index 65b2b305..1cb22c5e 100644 --- a/src/Enums/PaymentMethod.php +++ b/src/Enums/PaymentMethod.php @@ -8,10 +8,12 @@ enum PaymentMethod : string { case BANK_TRANSFER = "bank_transfer"; case OTHER = "other"; case CUSTOM = "custom"; - case DANA = "dana"; - case TOUCH_N_GO = "touch_n_go"; case TAMARA = "tamara"; case QPAY = "qpay"; + case BLIK = "blik"; + case FPX = "fpx"; + case WERO = "wero"; + case P24 = "p24"; case CHARGEBACK = "chargeback"; case CARD = "card"; case AMAZON_PAYMENTS = "amazon_payments"; @@ -65,6 +67,17 @@ enum PaymentMethod : string { case PAYNOW = "paynow"; case BIZUM = "bizum"; case PROMPTPAY = "promptpay"; + case DANA = "dana"; + case TOUCH_N_GO = "touch_n_go"; + case OVO = "ovo"; + case MOMO = "momo"; + case MERCADO_PAGO = "mercado_pago"; + case NEQUI = "nequi"; + case NUPAY = "nupay"; + case PICPAY = "picpay"; + case THAI_QR = "thai_qr"; + case AFFIRM_PAY = "affirm_pay"; + case RAKUTEN_PAY = "rakuten_pay"; /* * @depcreated */ diff --git a/src/Enums/PaymentMethodType.php b/src/Enums/PaymentMethodType.php index e6863e1b..4085438f 100644 --- a/src/Enums/PaymentMethodType.php +++ b/src/Enums/PaymentMethodType.php @@ -57,6 +57,19 @@ enum PaymentMethodType : string { case TOUCH_N_GO = "touch_n_go"; case TAMARA = "tamara"; case QPAY = "qpay"; + case OVO = "ovo"; + case MOMO = "momo"; + case MERCADO_PAGO = "mercado_pago"; + case NEQUI = "nequi"; + case NUPAY = "nupay"; + case PICPAY = "picpay"; + case THAI_QR = "thai_qr"; + case BLIK = "blik"; + case FPX = "fpx"; + case WERO = "wero"; + case P24 = "p24"; + case AFFIRM_PAY = "affirm_pay"; + case RAKUTEN_PAY = "rakuten_pay"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/Status.php b/src/Enums/Status.php index bd7c073c..083ccc41 100644 --- a/src/Enums/Status.php +++ b/src/Enums/Status.php @@ -3,12 +3,20 @@ namespace Chargebee\Enums; enum Status : string { + case SCHEDULED = "scheduled"; + case RESCHEDULED = "rescheduled"; + case SUCCEEDED = "succeeded"; + case FAILED = "failed"; + case DEFERRED = "deferred"; + case DELIVERED = "delivered"; + case OPENED = "opened"; + case BOUNCED = "bounced"; + case DROPPED = "dropped"; case ACTIVE = "active"; case ARCHIVED = "archived"; case DELETED = "deleted"; case AVAILABLE = "available"; case EXHAUSTED = "exhausted"; - case SCHEDULED = "scheduled"; case IN_GRACE_PERIOD = "in_grace_period"; case UNKNOWN = "unknown"; diff --git a/src/Enums/Taxability.php b/src/Enums/Taxability.php index 7aa86934..8b71bd19 100644 --- a/src/Enums/Taxability.php +++ b/src/Enums/Taxability.php @@ -5,6 +5,7 @@ enum Taxability : string { case TAXABLE = "taxable"; case EXEMPT = "exempt"; + case ZERO_RATED = "zero_rated"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Enums/Type.php b/src/Enums/Type.php index 8361d894..71f21809 100644 --- a/src/Enums/Type.php +++ b/src/Enums/Type.php @@ -57,6 +57,19 @@ enum Type : string { case TOUCH_N_GO = "touch_n_go"; case TAMARA = "tamara"; case QPAY = "qpay"; + case OVO = "ovo"; + case MOMO = "momo"; + case MERCADO_PAGO = "mercado_pago"; + case NEQUI = "nequi"; + case NUPAY = "nupay"; + case PICPAY = "picpay"; + case THAI_QR = "thai_qr"; + case BLIK = "blik"; + case FPX = "fpx"; + case WERO = "wero"; + case P24 = "p24"; + case AFFIRM_PAY = "affirm_pay"; + case RAKUTEN_PAY = "rakuten_pay"; case FREE_TRIAL = "free_trial"; case PAY_UP_FRONT = "pay_up_front"; case PAY_AS_YOU_GO = "pay_as_you_go"; diff --git a/src/Resources/AppliedBusinessRule/AppliedBusinessRule.php b/src/Resources/AppliedBusinessRule/AppliedBusinessRule.php new file mode 100644 index 00000000..c784976d --- /dev/null +++ b/src/Resources/AppliedBusinessRule/AppliedBusinessRule.php @@ -0,0 +1,128 @@ + $knownFields + */ + protected static array $knownFields = [ "handle" , "entity_id" , "entity_version" , "rule_id" , "version" , "created_at" , "modified_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $handle, + ?int $entity_id, + ?int $entity_version, + ?string $rule_id, + ?int $version, + ?int $created_at, + ?int $modified_at, + ?\Chargebee\Resources\AppliedBusinessRule\Enums\EntityType $entity_type, + ) + { + $this->handle = $handle; + $this->entity_id = $entity_id; + $this->entity_version = $entity_version; + $this->rule_id = $rule_id; + $this->version = $version; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + $this->entity_type = $entity_type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['handle'] ?? null, + $resourceAttributes['entity_id'] ?? null, + $resourceAttributes['entity_version'] ?? null, + $resourceAttributes['rule_id'] ?? null, + $resourceAttributes['version'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + + + isset($resourceAttributes['entity_type']) ? \Chargebee\Resources\AppliedBusinessRule\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['handle' => $this->handle, + 'entity_id' => $this->entity_id, + 'entity_version' => $this->entity_version, + 'rule_id' => $this->rule_id, + 'version' => $this->version, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + + 'entity_type' => $this->entity_type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/AppliedBusinessRule/Enums/EntityType.php b/src/Resources/AppliedBusinessRule/Enums/EntityType.php new file mode 100644 index 00000000..14dc2713 --- /dev/null +++ b/src/Resources/AppliedBusinessRule/Enums/EntityType.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/src/Resources/AppliedRule/AppliedRule.php b/src/Resources/AppliedRule/AppliedRule.php new file mode 100644 index 00000000..931fb4cb --- /dev/null +++ b/src/Resources/AppliedRule/AppliedRule.php @@ -0,0 +1,116 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "version" , "name" , "description" , "evaluation_result" , "error_message" , "actions" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?int $version, + ?string $name, + ?string $description, + ?bool $evaluation_result, + ?string $error_message, + mixed $actions, + ) + { + $this->id = $id; + $this->version = $version; + $this->name = $name; + $this->description = $description; + $this->evaluation_result = $evaluation_result; + $this->error_message = $error_message; + $this->actions = $actions; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['version'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['description'] ?? null, + $resourceAttributes['evaluation_result'] ?? null, + $resourceAttributes['error_message'] ?? null, + $resourceAttributes['actions'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'version' => $this->version, + 'name' => $this->name, + 'description' => $this->description, + 'evaluation_result' => $this->evaluation_result, + 'error_message' => $this->error_message, + 'actions' => $this->actions, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/ApplyRule/ApplyRule.php b/src/Resources/ApplyRule/ApplyRule.php new file mode 100644 index 00000000..f9b6349a --- /dev/null +++ b/src/Resources/ApplyRule/ApplyRule.php @@ -0,0 +1,126 @@ + $rules + */ + public ?array $rules; + + /** + * @var array $knownFields + */ + protected static array $knownFields = [ "evaluate" , "rule_id" , "ruleset_id" , "skip_failed_rules" , "structured_expression" , "context" , "rules" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?bool $evaluate, + ?string $rule_id, + ?string $ruleset_id, + ?bool $skip_failed_rules, + mixed $structured_expression, + mixed $context, + ?array $rules, + ) + { + $this->evaluate = $evaluate; + $this->rule_id = $rule_id; + $this->ruleset_id = $ruleset_id; + $this->skip_failed_rules = $skip_failed_rules; + $this->structured_expression = $structured_expression; + $this->context = $context; + $this->rules = $rules; + } + + public static function from(array $resourceAttributes): self + { + $rules = array_map(fn (array $result): Rule => Rule::from( + $result + ), $resourceAttributes['rules'] ?? []); + + $returnData = new self( $resourceAttributes['evaluate'] ?? null, + $resourceAttributes['rule_id'] ?? null, + $resourceAttributes['ruleset_id'] ?? null, + $resourceAttributes['skip_failed_rules'] ?? null, + $resourceAttributes['structured_expression'] ?? null, + $resourceAttributes['context'] ?? null, + $rules, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['evaluate' => $this->evaluate, + 'rule_id' => $this->rule_id, + 'ruleset_id' => $this->ruleset_id, + 'skip_failed_rules' => $this->skip_failed_rules, + 'structured_expression' => $this->structured_expression, + 'context' => $this->context, + + + ], function ($value) { + return $value !== null; + }); + + + + if($this->rules !== []){ + $data['rules'] = array_map( + fn (Rule $rules): array => $rules->toArray(), + $this->rules + ); + } + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/ApplyRule/Rule.php b/src/Resources/ApplyRule/Rule.php new file mode 100644 index 00000000..8ab11ba4 --- /dev/null +++ b/src/Resources/ApplyRule/Rule.php @@ -0,0 +1,116 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "version" , "name" , "description" , "evaluation_result" , "error_message" , "actions" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?int $version, + ?string $name, + ?string $description, + ?bool $evaluation_result, + ?string $error_message, + mixed $actions, + ) + { + $this->id = $id; + $this->version = $version; + $this->name = $name; + $this->description = $description; + $this->evaluation_result = $evaluation_result; + $this->error_message = $error_message; + $this->actions = $actions; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['version'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['description'] ?? null, + $resourceAttributes['evaluation_result'] ?? null, + $resourceAttributes['error_message'] ?? null, + $resourceAttributes['actions'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'version' => $this->version, + 'name' => $this->name, + 'description' => $this->description, + 'evaluation_result' => $this->evaluation_result, + 'error_message' => $this->error_message, + 'actions' => $this->actions, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/BusinessRule/BusinessRule.php b/src/Resources/BusinessRule/BusinessRule.php new file mode 100644 index 00000000..e8766bf3 --- /dev/null +++ b/src/Resources/BusinessRule/BusinessRule.php @@ -0,0 +1,196 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "name" , "description" , "latest_version" , "active" , "released_at" , "released_by" , "updated_at" , "updated_by" , "created_by" , "created_at" , "tags" , "structured_expression" , "actions_on_success" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $name, + ?string $description, + ?int $latest_version, + ?bool $active, + ?int $released_at, + ?string $released_by, + ?int $updated_at, + ?string $updated_by, + ?string $created_by, + ?int $created_at, + mixed $tags, + mixed $structured_expression, + mixed $actions_on_success, + ?int $resource_version, + ) + { + $this->id = $id; + $this->name = $name; + $this->description = $description; + $this->latest_version = $latest_version; + $this->active = $active; + $this->released_at = $released_at; + $this->released_by = $released_by; + $this->updated_at = $updated_at; + $this->updated_by = $updated_by; + $this->created_by = $created_by; + $this->created_at = $created_at; + $this->tags = $tags; + $this->structured_expression = $structured_expression; + $this->actions_on_success = $actions_on_success; + $this->resource_version = $resource_version; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['description'] ?? null, + $resourceAttributes['latest_version'] ?? null, + $resourceAttributes['active'] ?? null, + $resourceAttributes['released_at'] ?? null, + $resourceAttributes['released_by'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['updated_by'] ?? null, + $resourceAttributes['created_by'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['tags'] ?? null, + $resourceAttributes['structured_expression'] ?? null, + $resourceAttributes['actions_on_success'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + 'latest_version' => $this->latest_version, + 'active' => $this->active, + 'released_at' => $this->released_at, + 'released_by' => $this->released_by, + 'updated_at' => $this->updated_at, + 'updated_by' => $this->updated_by, + 'created_by' => $this->created_by, + 'created_at' => $this->created_at, + 'tags' => $this->tags, + 'structured_expression' => $this->structured_expression, + 'actions_on_success' => $this->actions_on_success, + 'resource_version' => $this->resource_version, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/BusinessRuleset/BusinessRuleset.php b/src/Resources/BusinessRuleset/BusinessRuleset.php new file mode 100644 index 00000000..232d9a63 --- /dev/null +++ b/src/Resources/BusinessRuleset/BusinessRuleset.php @@ -0,0 +1,158 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "name" , "description" , "active" , "updated_at" , "updated_by" , "created_by" , "created_at" , "rules" , "resource_version" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $name, + ?string $description, + ?bool $active, + ?int $updated_at, + ?string $updated_by, + ?string $created_by, + ?int $created_at, + mixed $rules, + ?int $resource_version, + ?\Chargebee\Resources\BusinessRuleset\Enums\ExecuteMode $execute_mode, + ) + { + $this->id = $id; + $this->name = $name; + $this->description = $description; + $this->active = $active; + $this->updated_at = $updated_at; + $this->updated_by = $updated_by; + $this->created_by = $created_by; + $this->created_at = $created_at; + $this->rules = $rules; + $this->resource_version = $resource_version; + $this->execute_mode = $execute_mode; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['name'] ?? null, + $resourceAttributes['description'] ?? null, + $resourceAttributes['active'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['updated_by'] ?? null, + $resourceAttributes['created_by'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['rules'] ?? null, + $resourceAttributes['resource_version'] ?? null, + + + isset($resourceAttributes['execute_mode']) ? \Chargebee\Resources\BusinessRuleset\Enums\ExecuteMode::tryFromValue($resourceAttributes['execute_mode']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + 'active' => $this->active, + 'updated_at' => $this->updated_at, + 'updated_by' => $this->updated_by, + 'created_by' => $this->created_by, + 'created_at' => $this->created_at, + 'rules' => $this->rules, + 'resource_version' => $this->resource_version, + + 'execute_mode' => $this->execute_mode?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/BusinessRuleset/Enums/ExecuteMode.php b/src/Resources/BusinessRuleset/Enums/ExecuteMode.php new file mode 100644 index 00000000..13f2d63b --- /dev/null +++ b/src/Resources/BusinessRuleset/Enums/ExecuteMode.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/src/Resources/BusinessRulesetRule/BusinessRulesetRule.php b/src/Resources/BusinessRulesetRule/BusinessRulesetRule.php new file mode 100644 index 00000000..61182502 --- /dev/null +++ b/src/Resources/BusinessRulesetRule/BusinessRulesetRule.php @@ -0,0 +1,66 @@ + $knownFields + */ + protected static array $knownFields = [ "rule_id" , "priority" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $rule_id, + ?int $priority, + ) + { + $this->rule_id = $rule_id; + $this->priority = $priority; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['rule_id'] ?? null, + $resourceAttributes['priority'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['rule_id' => $this->rule_id, + 'priority' => $this->priority, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Content/Content.php b/src/Resources/Content/Content.php index 63243e96..ec40f4b1 100644 --- a/src/Resources/Content/Content.php +++ b/src/Resources/Content/Content.php @@ -6,6 +6,9 @@ use Chargebee\Resources\AdvanceInvoiceSchedule\AdvanceInvoiceSchedule; use Chargebee\Resources\Alert\Alert; use Chargebee\Resources\AlertStatus\AlertStatus; +use Chargebee\Resources\AppliedBusinessRule\AppliedBusinessRule; +use Chargebee\Resources\AppliedRule\AppliedRule; +use Chargebee\Resources\ApplyRule\ApplyRule; use Chargebee\Resources\AsyncResponse\AsyncResponse; use Chargebee\Resources\AsyncResponseList\AsyncResponseList; use Chargebee\Resources\AttachedItem\AttachedItem; @@ -14,6 +17,9 @@ use Chargebee\Resources\Brand\Brand; use Chargebee\Resources\BusinessEntity\BusinessEntity; use Chargebee\Resources\BusinessEntityTransfer\BusinessEntityTransfer; +use Chargebee\Resources\BusinessRule\BusinessRule; +use Chargebee\Resources\BusinessRuleset\BusinessRuleset; +use Chargebee\Resources\BusinessRulesetRule\BusinessRulesetRule; use Chargebee\Resources\Card\Card; use Chargebee\Resources\ColumnDefinition\ColumnDefinition; use Chargebee\Resources\Comment\Comment; @@ -28,12 +34,15 @@ use Chargebee\Resources\CreditNoteEstimate\CreditNoteEstimate; use Chargebee\Resources\CreditUnit\CreditUnit; use Chargebee\Resources\Currency\Currency; +use Chargebee\Resources\CustomDataSchema\CustomDataSchema; use Chargebee\Resources\Customer\Customer; use Chargebee\Resources\CustomerEntitlement\CustomerEntitlement; use Chargebee\Resources\DifferentialPrice\DifferentialPrice; use Chargebee\Resources\Discount\Discount; +use Chargebee\Resources\Dispute\Dispute; use Chargebee\Resources\Download\Download; use Chargebee\Resources\Einvoice\Einvoice; +use Chargebee\Resources\EmailLog\EmailLog; use Chargebee\Resources\Entitlement\Entitlement; use Chargebee\Resources\EntitlementOverride\EntitlementOverride; use Chargebee\Resources\Estimate\Estimate; @@ -154,6 +163,24 @@ class Content { */ public ?AlertStatus $alertstatus; + /** + * + * @var ?AppliedBusinessRule $appliedbusinessrule + */ + public ?AppliedBusinessRule $appliedbusinessrule; + + /** + * + * @var ?AppliedRule $appliedrule + */ + public ?AppliedRule $appliedrule; + + /** + * + * @var ?ApplyRule $applyrule + */ + public ?ApplyRule $applyrule; + /** * * @var ?AsyncResponse $asyncresponse @@ -202,6 +229,24 @@ class Content { */ public ?BusinessEntityTransfer $businessentitytransfer; + /** + * + * @var ?BusinessRule $businessrule + */ + public ?BusinessRule $businessrule; + + /** + * + * @var ?BusinessRuleset $businessruleset + */ + public ?BusinessRuleset $businessruleset; + + /** + * + * @var ?BusinessRulesetRule $businessrulesetrule + */ + public ?BusinessRulesetRule $businessrulesetrule; + /** * * @var ?Card $card @@ -286,6 +331,12 @@ class Content { */ public ?Currency $currency; + /** + * + * @var ?CustomDataSchema $customdataschema + */ + public ?CustomDataSchema $customdataschema; + /** * * @var ?Customer $customer @@ -310,6 +361,12 @@ class Content { */ public ?Discount $discount; + /** + * + * @var ?Dispute $dispute + */ + public ?Dispute $dispute; + /** * * @var ?Download $download @@ -322,6 +379,12 @@ class Content { */ public ?Einvoice $einvoice; + /** + * + * @var ?EmailLog $emaillog + */ + public ?EmailLog $emaillog; + /** * * @var ?Entitlement $entitlement @@ -853,7 +916,7 @@ class Content { /** * @var array $knownFields */ - protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "download" , "einvoice" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gateway_payment_method_token" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_metric" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_entitlement" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "vaulted_payment_method" , "virtual_bank_account" , "webhook_endpoint" ]; + protected static array $knownFields = [ "addon" , "address" , "advance_invoice_schedule" , "alert" , "alert_status" , "applied_business_rule" , "applied_rule" , "apply_rule" , "async_response" , "async_response_list" , "attached_item" , "attribute" , "billing_configuration" , "brand" , "business_entity" , "business_entity_transfer" , "business_rule" , "business_ruleset" , "business_ruleset_rule" , "card" , "column_definition" , "comment" , "configuration" , "contact" , "contract_term" , "coupon" , "coupon_code" , "coupon_set" , "cpq_quote_signature" , "credit_note" , "credit_note_estimate" , "credit_unit" , "currency" , "custom_data_schema" , "customer" , "customer_entitlement" , "differential_price" , "discount" , "dispute" , "download" , "einvoice" , "email_log" , "entitlement" , "entitlement_override" , "estimate" , "event" , "export" , "feature" , "filter_condition" , "gateway_error_detail" , "gateway_payment_method_token" , "gift" , "grant_block" , "hierarchy" , "hosted_page" , "impacted_customer" , "impacted_item" , "impacted_item_price" , "impacted_subscription" , "in_app_subscription" , "invoice" , "invoice_estimate" , "item" , "item_entitlement" , "item_family" , "item_price" , "ledger_account_balance" , "ledger_entry" , "ledger_operation" , "metadata" , "meter" , "metered_feature" , "non_subscription" , "offer_event" , "offer_fulfillment" , "omnichannel_one_time_order" , "omnichannel_one_time_order_item" , "omnichannel_subscription" , "omnichannel_subscription_item" , "omnichannel_subscription_item_metric" , "omnichannel_subscription_item_offer" , "omnichannel_subscription_item_scheduled_change" , "omnichannel_transaction" , "order" , "payment_intent" , "payment_reference_number" , "payment_schedule" , "payment_schedule_estimate" , "payment_schedule_scheme" , "payment_source" , "payment_voucher" , "personalized_offer" , "plan" , "portal_session" , "price_variant" , "pricing_page_session" , "promotional_credit" , "promotional_grant" , "purchase" , "quote" , "quote_entitlement" , "quote_line_group" , "quoted_charge" , "quoted_delta_ramp" , "quoted_ramp" , "quoted_subscription" , "ramp" , "recorded_purchase" , "resource_migration" , "rule" , "site_migration_detail" , "subscription" , "subscription_entitlement" , "subscription_entitlements_created_detail" , "subscription_entitlements_updated_detail" , "subscription_estimate" , "tax_withheld" , "third_party_payment_method" , "time_machine" , "token" , "transaction" , "unbilled_charge" , "usage" , "usage_charge" , "usage_event" , "usage_file" , "usage_summary" , "vaulted_payment_method" , "virtual_bank_account" , "webhook_endpoint" ]; /** * dynamic properties for resources @@ -867,6 +930,9 @@ private function __construct( ?AdvanceInvoiceSchedule $advanceinvoiceschedule, ?Alert $alert, ?AlertStatus $alertstatus, + ?AppliedBusinessRule $appliedbusinessrule, + ?AppliedRule $appliedrule, + ?ApplyRule $applyrule, ?AsyncResponse $asyncresponse, ?AsyncResponseList $asyncresponselist, ?AttachedItem $attacheditem, @@ -875,6 +941,9 @@ private function __construct( ?Brand $brand, ?BusinessEntity $businessentity, ?BusinessEntityTransfer $businessentitytransfer, + ?BusinessRule $businessrule, + ?BusinessRuleset $businessruleset, + ?BusinessRulesetRule $businessrulesetrule, ?Card $card, ?ColumnDefinition $columndefinition, ?Comment $comment, @@ -889,12 +958,15 @@ private function __construct( ?CreditNoteEstimate $creditnoteestimate, ?CreditUnit $creditunit, ?Currency $currency, + ?CustomDataSchema $customdataschema, ?Customer $customer, ?CustomerEntitlement $customerentitlement, ?DifferentialPrice $differentialprice, ?Discount $discount, + ?Dispute $dispute, ?Download $download, ?Einvoice $einvoice, + ?EmailLog $emaillog, ?Entitlement $entitlement, ?EntitlementOverride $entitlementoverride, ?Estimate $estimate, @@ -990,6 +1062,9 @@ private function __construct( $this->advanceinvoiceschedule = $advanceinvoiceschedule; $this->alert = $alert; $this->alertstatus = $alertstatus; + $this->appliedbusinessrule = $appliedbusinessrule; + $this->appliedrule = $appliedrule; + $this->applyrule = $applyrule; $this->asyncresponse = $asyncresponse; $this->asyncresponselist = $asyncresponselist; $this->attacheditem = $attacheditem; @@ -998,6 +1073,9 @@ private function __construct( $this->brand = $brand; $this->businessentity = $businessentity; $this->businessentitytransfer = $businessentitytransfer; + $this->businessrule = $businessrule; + $this->businessruleset = $businessruleset; + $this->businessrulesetrule = $businessrulesetrule; $this->card = $card; $this->columndefinition = $columndefinition; $this->comment = $comment; @@ -1012,12 +1090,15 @@ private function __construct( $this->creditnoteestimate = $creditnoteestimate; $this->creditunit = $creditunit; $this->currency = $currency; + $this->customdataschema = $customdataschema; $this->customer = $customer; $this->customerentitlement = $customerentitlement; $this->differentialprice = $differentialprice; $this->discount = $discount; + $this->dispute = $dispute; $this->download = $download; $this->einvoice = $einvoice; + $this->emaillog = $emaillog; $this->entitlement = $entitlement; $this->entitlementoverride = $entitlementoverride; $this->estimate = $estimate; @@ -1115,6 +1196,9 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['advance_invoice_schedule']) ? AdvanceInvoiceSchedule::from($resourceAttributes['advance_invoice_schedule']) : null, isset($resourceAttributes['alert']) ? Alert::from($resourceAttributes['alert']) : null, isset($resourceAttributes['alert_status']) ? AlertStatus::from($resourceAttributes['alert_status']) : null, + isset($resourceAttributes['applied_business_rule']) ? AppliedBusinessRule::from($resourceAttributes['applied_business_rule']) : null, + isset($resourceAttributes['applied_rule']) ? AppliedRule::from($resourceAttributes['applied_rule']) : null, + isset($resourceAttributes['apply_rule']) ? ApplyRule::from($resourceAttributes['apply_rule']) : null, isset($resourceAttributes['async_response']) ? AsyncResponse::from($resourceAttributes['async_response']) : null, isset($resourceAttributes['async_response_list']) ? AsyncResponseList::from($resourceAttributes['async_response_list']) : null, isset($resourceAttributes['attached_item']) ? AttachedItem::from($resourceAttributes['attached_item']) : null, @@ -1123,6 +1207,9 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['brand']) ? Brand::from($resourceAttributes['brand']) : null, isset($resourceAttributes['business_entity']) ? BusinessEntity::from($resourceAttributes['business_entity']) : null, isset($resourceAttributes['business_entity_transfer']) ? BusinessEntityTransfer::from($resourceAttributes['business_entity_transfer']) : null, + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + isset($resourceAttributes['business_ruleset_rule']) ? BusinessRulesetRule::from($resourceAttributes['business_ruleset_rule']) : null, isset($resourceAttributes['card']) ? Card::from($resourceAttributes['card']) : null, isset($resourceAttributes['column_definition']) ? ColumnDefinition::from($resourceAttributes['column_definition']) : null, isset($resourceAttributes['comment']) ? Comment::from($resourceAttributes['comment']) : null, @@ -1137,12 +1224,15 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['credit_note_estimate']) ? CreditNoteEstimate::from($resourceAttributes['credit_note_estimate']) : null, isset($resourceAttributes['credit_unit']) ? CreditUnit::from($resourceAttributes['credit_unit']) : null, isset($resourceAttributes['currency']) ? Currency::from($resourceAttributes['currency']) : null, + isset($resourceAttributes['custom_data_schema']) ? CustomDataSchema::from($resourceAttributes['custom_data_schema']) : null, isset($resourceAttributes['customer']) ? Customer::from($resourceAttributes['customer']) : null, isset($resourceAttributes['customer_entitlement']) ? CustomerEntitlement::from($resourceAttributes['customer_entitlement']) : null, isset($resourceAttributes['differential_price']) ? DifferentialPrice::from($resourceAttributes['differential_price']) : null, isset($resourceAttributes['discount']) ? Discount::from($resourceAttributes['discount']) : null, + isset($resourceAttributes['dispute']) ? Dispute::from($resourceAttributes['dispute']) : null, isset($resourceAttributes['download']) ? Download::from($resourceAttributes['download']) : null, isset($resourceAttributes['einvoice']) ? Einvoice::from($resourceAttributes['einvoice']) : null, + isset($resourceAttributes['email_log']) ? EmailLog::from($resourceAttributes['email_log']) : null, isset($resourceAttributes['entitlement']) ? Entitlement::from($resourceAttributes['entitlement']) : null, isset($resourceAttributes['entitlement_override']) ? EntitlementOverride::from($resourceAttributes['entitlement_override']) : null, isset($resourceAttributes['estimate']) ? Estimate::from($resourceAttributes['estimate']) : null, @@ -1353,6 +1443,15 @@ public function toArray(): array + + + + + + + + + @@ -1383,6 +1482,15 @@ public function toArray(): array if($this->alertstatus instanceof AlertStatus){ $data['alert_status'] = $this->alertstatus->toArray(); } + if($this->appliedbusinessrule instanceof AppliedBusinessRule){ + $data['applied_business_rule'] = $this->appliedbusinessrule->toArray(); + } + if($this->appliedrule instanceof AppliedRule){ + $data['applied_rule'] = $this->appliedrule->toArray(); + } + if($this->applyrule instanceof ApplyRule){ + $data['apply_rule'] = $this->applyrule->toArray(); + } if($this->asyncresponse instanceof AsyncResponse){ $data['async_response'] = $this->asyncresponse->toArray(); } @@ -1407,6 +1515,15 @@ public function toArray(): array if($this->businessentitytransfer instanceof BusinessEntityTransfer){ $data['business_entity_transfer'] = $this->businessentitytransfer->toArray(); } + if($this->businessrule instanceof BusinessRule){ + $data['business_rule'] = $this->businessrule->toArray(); + } + if($this->businessruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->businessruleset->toArray(); + } + if($this->businessrulesetrule instanceof BusinessRulesetRule){ + $data['business_ruleset_rule'] = $this->businessrulesetrule->toArray(); + } if($this->card instanceof Card){ $data['card'] = $this->card->toArray(); } @@ -1449,6 +1566,9 @@ public function toArray(): array if($this->currency instanceof Currency){ $data['currency'] = $this->currency->toArray(); } + if($this->customdataschema instanceof CustomDataSchema){ + $data['custom_data_schema'] = $this->customdataschema->toArray(); + } if($this->customer instanceof Customer){ $data['customer'] = $this->customer->toArray(); } @@ -1461,12 +1581,18 @@ public function toArray(): array if($this->discount instanceof Discount){ $data['discount'] = $this->discount->toArray(); } + if($this->dispute instanceof Dispute){ + $data['dispute'] = $this->dispute->toArray(); + } if($this->download instanceof Download){ $data['download'] = $this->download->toArray(); } if($this->einvoice instanceof Einvoice){ $data['einvoice'] = $this->einvoice->toArray(); } + if($this->emaillog instanceof EmailLog){ + $data['email_log'] = $this->emaillog->toArray(); + } if($this->entitlement instanceof Entitlement){ $data['entitlement'] = $this->entitlement->toArray(); } diff --git a/src/Resources/CreditNote/CreditNote.php b/src/Resources/CreditNote/CreditNote.php index e38b5cd2..b5cb6d7c 100644 --- a/src/Resources/CreditNote/CreditNote.php +++ b/src/Resources/CreditNote/CreditNote.php @@ -250,6 +250,12 @@ class CreditNote extends SupportsCustomFields { */ public ?string $business_entity_id; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?ShippingAddress $shipping_address @@ -307,7 +313,7 @@ class CreditNote extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "reference_invoice_id" , "vat_number" , "date" , "currency_code" , "total" , "amount_allocated" , "amount_refunded" , "amount_available" , "refunded_at" , "voided_at" , "generated_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "sub_total" , "sub_total_in_local_currency" , "total_in_local_currency" , "local_currency_code" , "round_off_amount" , "fractional_correction" , "notes" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_refunds" , "allocations" , "deleted" , "tax_category" , "local_currency_exchange_rate" , "exchange_rates" , "create_reason_code" , "vat_number_prefix" , "business_entity_id" , "shipping_address" , "billing_address" , "einvoice" , "site_details_at_creation" ]; + protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "reference_invoice_id" , "vat_number" , "date" , "currency_code" , "total" , "amount_allocated" , "amount_refunded" , "amount_available" , "refunded_at" , "voided_at" , "generated_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "sub_total" , "sub_total_in_local_currency" , "total_in_local_currency" , "local_currency_code" , "round_off_amount" , "fractional_correction" , "notes" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_refunds" , "allocations" , "deleted" , "tax_category" , "local_currency_exchange_rate" , "exchange_rates" , "create_reason_code" , "vat_number_prefix" , "business_entity_id" , "brand_id" , "shipping_address" , "billing_address" , "einvoice" , "site_details_at_creation" ]; /** * dynamic properties for resources @@ -357,6 +363,7 @@ private function __construct( ?string $create_reason_code, ?string $vat_number_prefix, ?string $business_entity_id, + ?string $brand_id, ?ShippingAddress $shipping_address, ?BillingAddress $billing_address, ?Einvoice $einvoice, @@ -409,6 +416,7 @@ private function __construct( $this->create_reason_code = $create_reason_code; $this->vat_number_prefix = $vat_number_prefix; $this->business_entity_id = $business_entity_id; + $this->brand_id = $brand_id; $this->shipping_address = $shipping_address; $this->billing_address = $billing_address; $this->einvoice = $einvoice; @@ -503,6 +511,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['create_reason_code'] ?? null, $resourceAttributes['vat_number_prefix'] ?? null, $resourceAttributes['business_entity_id'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['shipping_address']) ? ShippingAddress::from($resourceAttributes['shipping_address']) : null, isset($resourceAttributes['billing_address']) ? BillingAddress::from($resourceAttributes['billing_address']) : null, isset($resourceAttributes['einvoice']) ? Einvoice::from($resourceAttributes['einvoice']) : null, @@ -572,6 +581,7 @@ public function toArray(): array 'create_reason_code' => $this->create_reason_code, 'vat_number_prefix' => $this->vat_number_prefix, 'business_entity_id' => $this->business_entity_id, + 'brand_id' => $this->brand_id, diff --git a/src/Resources/CustomDataSchema/CustomDataSchema.php b/src/Resources/CustomDataSchema/CustomDataSchema.php new file mode 100644 index 00000000..5733b63f --- /dev/null +++ b/src/Resources/CustomDataSchema/CustomDataSchema.php @@ -0,0 +1,130 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "display_name" , "schema_definition" , "created_at" , "modified_at" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $display_name, + ?string $schema_definition, + ?int $created_at, + ?int $modified_at, + ?int $updated_at, + ?\Chargebee\Enums\EntityType $entity_type, + ?\Chargebee\Resources\CustomDataSchema\Enums\Status $status, + ) + { + $this->id = $id; + $this->display_name = $display_name; + $this->schema_definition = $schema_definition; + $this->created_at = $created_at; + $this->modified_at = $modified_at; + $this->updated_at = $updated_at; + $this->entity_type = $entity_type; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['display_name'] ?? null, + $resourceAttributes['schema_definition'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['modified_at'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['entity_type']) ? \Chargebee\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, + + isset($resourceAttributes['status']) ? \Chargebee\Resources\CustomDataSchema\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'display_name' => $this->display_name, + 'schema_definition' => $this->schema_definition, + 'created_at' => $this->created_at, + 'modified_at' => $this->modified_at, + 'updated_at' => $this->updated_at, + + 'entity_type' => $this->entity_type?->value, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/CustomDataSchema/Enums/Status.php b/src/Resources/CustomDataSchema/Enums/Status.php new file mode 100644 index 00000000..e1abb09f --- /dev/null +++ b/src/Resources/CustomDataSchema/Enums/Status.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/Customer/Customer.php b/src/Resources/Customer/Customer.php index 8b03589f..084502ce 100644 --- a/src/Resources/Customer/Customer.php +++ b/src/Resources/Customer/Customer.php @@ -316,6 +316,12 @@ class Customer extends SupportsCustomFields { */ public ?string $entity_identifier_standard; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?\Chargebee\Enums\AutoCollection $auto_collection @@ -403,7 +409,7 @@ class Customer extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "first_name" , "last_name" , "email" , "phone" , "company" , "vat_number" , "net_term_days" , "vat_number_validated_time" , "allow_direct_debit" , "is_location_valid" , "created_at" , "created_from_ip" , "exemption_details" , "exempt_number" , "resource_version" , "updated_at" , "locale" , "billing_date" , "billing_month" , "auto_close_invoices" , "active_id" , "primary_payment_source_id" , "backup_payment_source_id" , "billing_address" , "referral_urls" , "contacts" , "payment_method" , "invoice_notes" , "business_entity_id" , "preferred_currency_code" , "promotional_credits" , "unbilled_charges" , "refundable_credits" , "excess_payments" , "balances" , "entity_identifiers" , "tax_providers_fields" , "is_einvoice_enabled" , "meta_data" , "deleted" , "registered_for_gst" , "consolidated_invoicing" , "business_customer_without_vat_number" , "client_profile_id" , "relationship" , "use_default_hierarchy_settings" , "parent_account_access" , "child_account_access" , "vat_number_prefix" , "entity_identifier_scheme" , "entity_identifier_standard" ]; + protected static array $knownFields = [ "id" , "first_name" , "last_name" , "email" , "phone" , "company" , "vat_number" , "net_term_days" , "vat_number_validated_time" , "allow_direct_debit" , "is_location_valid" , "created_at" , "created_from_ip" , "exemption_details" , "exempt_number" , "resource_version" , "updated_at" , "locale" , "billing_date" , "billing_month" , "auto_close_invoices" , "active_id" , "primary_payment_source_id" , "backup_payment_source_id" , "billing_address" , "referral_urls" , "contacts" , "payment_method" , "invoice_notes" , "business_entity_id" , "preferred_currency_code" , "promotional_credits" , "unbilled_charges" , "refundable_credits" , "excess_payments" , "balances" , "entity_identifiers" , "tax_providers_fields" , "is_einvoice_enabled" , "meta_data" , "deleted" , "registered_for_gst" , "consolidated_invoicing" , "business_customer_without_vat_number" , "client_profile_id" , "relationship" , "use_default_hierarchy_settings" , "parent_account_access" , "child_account_access" , "vat_number_prefix" , "entity_identifier_scheme" , "entity_identifier_standard" , "brand_id" ]; /** * dynamic properties for resources @@ -464,6 +470,7 @@ private function __construct( ?string $vat_number_prefix, ?string $entity_identifier_scheme, ?string $entity_identifier_standard, + ?string $brand_id, ?\Chargebee\Enums\AutoCollection $auto_collection, ?\Chargebee\Enums\OfflinePaymentMethod $offline_payment_method, ?\Chargebee\Enums\Taxability $taxability, @@ -531,7 +538,8 @@ private function __construct( $this->child_account_access = $child_account_access; $this->vat_number_prefix = $vat_number_prefix; $this->entity_identifier_scheme = $entity_identifier_scheme; - $this->entity_identifier_standard = $entity_identifier_standard; + $this->entity_identifier_standard = $entity_identifier_standard; + $this->brand_id = $brand_id; $this->auto_collection = $auto_collection; $this->offline_payment_method = $offline_payment_method; $this->taxability = $taxability; @@ -622,6 +630,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['vat_number_prefix'] ?? null, $resourceAttributes['entity_identifier_scheme'] ?? null, $resourceAttributes['entity_identifier_standard'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['auto_collection']) ? \Chargebee\Enums\AutoCollection::tryFromValue($resourceAttributes['auto_collection']) : null, @@ -716,6 +725,7 @@ public function toArray(): array 'vat_number_prefix' => $this->vat_number_prefix, 'entity_identifier_scheme' => $this->entity_identifier_scheme, 'entity_identifier_standard' => $this->entity_identifier_standard, + 'brand_id' => $this->brand_id, 'auto_collection' => $this->auto_collection?->value, diff --git a/src/Resources/Dispute/Dispute.php b/src/Resources/Dispute/Dispute.php new file mode 100644 index 00000000..1747c32c --- /dev/null +++ b/src/Resources/Dispute/Dispute.php @@ -0,0 +1,190 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "customer_id" , "transaction_id" , "gateway_account_id" , "id_at_gateway" , "currency_code" , "amount" , "reason" , "is_partial_dispute" , "created_at" , "resource_version" , "updated_at" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $customer_id, + ?string $transaction_id, + ?string $gateway_account_id, + ?string $id_at_gateway, + ?string $currency_code, + ?int $amount, + ?string $reason, + ?bool $is_partial_dispute, + ?int $created_at, + ?int $resource_version, + ?int $updated_at, + ?\Chargebee\Resources\Dispute\Enums\Status $status, + ?\Chargebee\Resources\Dispute\Enums\Type $type, + ) + { + $this->id = $id; + $this->customer_id = $customer_id; + $this->transaction_id = $transaction_id; + $this->gateway_account_id = $gateway_account_id; + $this->id_at_gateway = $id_at_gateway; + $this->currency_code = $currency_code; + $this->amount = $amount; + $this->reason = $reason; + $this->is_partial_dispute = $is_partial_dispute; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->status = $status; + $this->type = $type; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['transaction_id'] ?? null, + $resourceAttributes['gateway_account_id'] ?? null, + $resourceAttributes['id_at_gateway'] ?? null, + $resourceAttributes['currency_code'] ?? null, + $resourceAttributes['amount'] ?? null, + $resourceAttributes['reason'] ?? null, + $resourceAttributes['is_partial_dispute'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Resources\Dispute\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + isset($resourceAttributes['type']) ? \Chargebee\Resources\Dispute\Enums\Type::tryFromValue($resourceAttributes['type']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'customer_id' => $this->customer_id, + 'transaction_id' => $this->transaction_id, + 'gateway_account_id' => $this->gateway_account_id, + 'id_at_gateway' => $this->id_at_gateway, + 'currency_code' => $this->currency_code, + 'amount' => $this->amount, + 'reason' => $this->reason, + 'is_partial_dispute' => $this->is_partial_dispute, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + + 'status' => $this->status?->value, + + 'type' => $this->type?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Dispute/Enums/Status.php b/src/Resources/Dispute/Enums/Status.php new file mode 100644 index 00000000..492dcd17 --- /dev/null +++ b/src/Resources/Dispute/Enums/Status.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/src/Resources/Dispute/Enums/Type.php b/src/Resources/Dispute/Enums/Type.php new file mode 100644 index 00000000..8b4f961c --- /dev/null +++ b/src/Resources/Dispute/Enums/Type.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/Einvoice/Artifact.php b/src/Resources/Einvoice/Artifact.php new file mode 100644 index 00000000..94c43012 --- /dev/null +++ b/src/Resources/Einvoice/Artifact.php @@ -0,0 +1,136 @@ + $knownFields + */ + protected static array $knownFields = [ "artifact_type" , "direction" , "status" , "code" , "external_artifact_id" , "created_at" , "resource_version" , "updated_at" , "deleted" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $artifact_type, + ?string $direction, + ?string $status, + ?string $code, + ?string $external_artifact_id, + ?int $created_at, + ?int $resource_version, + ?int $updated_at, + ?bool $deleted, + ) + { + $this->artifact_type = $artifact_type; + $this->direction = $direction; + $this->status = $status; + $this->code = $code; + $this->external_artifact_id = $external_artifact_id; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->deleted = $deleted; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['artifact_type'] ?? null, + $resourceAttributes['direction'] ?? null, + $resourceAttributes['status'] ?? null, + $resourceAttributes['code'] ?? null, + $resourceAttributes['external_artifact_id'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['deleted'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['artifact_type' => $this->artifact_type, + 'direction' => $this->direction, + 'status' => $this->status, + 'code' => $this->code, + 'external_artifact_id' => $this->external_artifact_id, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + 'deleted' => $this->deleted, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Einvoice/Einvoice.php b/src/Resources/Einvoice/Einvoice.php index e27f1aee..e01fd638 100644 --- a/src/Resources/Einvoice/Einvoice.php +++ b/src/Resources/Einvoice/Einvoice.php @@ -9,6 +9,12 @@ class Einvoice { */ public ?string $id; + /** + * + * @var ?string $entity_id + */ + public ?string $entity_id; + /** * * @var ?string $reference_id @@ -27,12 +33,54 @@ class Einvoice { */ public ?string $message; + /** + * + * @var ?int $created_at + */ + public ?int $created_at; + + /** + * + * @var ?int $resource_version + */ + public ?int $resource_version; + + /** + * + * @var ?int $updated_at + */ + public ?int $updated_at; + + /** + * + * @var ?bool $deleted + */ + public ?bool $deleted; + /** * * @var mixed $provider_references */ public mixed $provider_references; + /** + * + * @var ?string $business_entity_id + */ + public ?string $business_entity_id; + + /** + * + * @var ?array $artifacts + */ + public ?array $artifacts; + + /** + * + * @var ?\Chargebee\Resources\Einvoice\Enums\EntityType $entity_type + */ + public ?\Chargebee\Resources\Einvoice\Enums\EntityType $entity_type; + /** * * @var ?\Chargebee\Resources\Einvoice\Enums\Status $status @@ -42,7 +90,7 @@ class Einvoice { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "reference_id" , "reference_number" , "message" , "provider_references" ]; + protected static array $knownFields = [ "id" , "entity_id" , "reference_id" , "reference_number" , "message" , "created_at" , "resource_version" , "updated_at" , "deleted" , "provider_references" , "business_entity_id" , "artifacts" ]; /** * dynamic properties for resources @@ -52,30 +100,59 @@ class Einvoice { private function __construct( ?string $id, + ?string $entity_id, ?string $reference_id, ?string $reference_number, ?string $message, + ?int $created_at, + ?int $resource_version, + ?int $updated_at, + ?bool $deleted, mixed $provider_references, + ?string $business_entity_id, + ?array $artifacts, + ?\Chargebee\Resources\Einvoice\Enums\EntityType $entity_type, ?\Chargebee\Resources\Einvoice\Enums\Status $status, ) { $this->id = $id; + $this->entity_id = $entity_id; $this->reference_id = $reference_id; $this->reference_number = $reference_number; $this->message = $message; - $this->provider_references = $provider_references; + $this->created_at = $created_at; + $this->resource_version = $resource_version; + $this->updated_at = $updated_at; + $this->deleted = $deleted; + $this->provider_references = $provider_references; + $this->business_entity_id = $business_entity_id; + $this->artifacts = $artifacts; + $this->entity_type = $entity_type; $this->status = $status; } public static function from(array $resourceAttributes): self { + $artifacts = array_map(fn (array $result): Artifact => Artifact::from( + $result + ), $resourceAttributes['artifacts'] ?? []); + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['entity_id'] ?? null, $resourceAttributes['reference_id'] ?? null, $resourceAttributes['reference_number'] ?? null, $resourceAttributes['message'] ?? null, + $resourceAttributes['created_at'] ?? null, + $resourceAttributes['resource_version'] ?? null, + $resourceAttributes['updated_at'] ?? null, + $resourceAttributes['deleted'] ?? null, $resourceAttributes['provider_references'] ?? null, + $resourceAttributes['business_entity_id'] ?? null, + $artifacts, + isset($resourceAttributes['entity_type']) ? \Chargebee\Resources\Einvoice\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, + isset($resourceAttributes['status']) ? \Chargebee\Resources\Einvoice\Enums\Status::tryFromValue($resourceAttributes['status']) : null, ); @@ -87,10 +164,19 @@ public function toArray(): array { $data = array_filter(['id' => $this->id, + 'entity_id' => $this->entity_id, 'reference_id' => $this->reference_id, 'reference_number' => $this->reference_number, 'message' => $this->message, + 'created_at' => $this->created_at, + 'resource_version' => $this->resource_version, + 'updated_at' => $this->updated_at, + 'deleted' => $this->deleted, 'provider_references' => $this->provider_references, + 'business_entity_id' => $this->business_entity_id, + + + 'entity_type' => $this->entity_type?->value, 'status' => $this->status?->value, @@ -100,6 +186,12 @@ public function toArray(): array + if($this->artifacts !== []){ + $data['artifacts'] = array_map( + fn (Artifact $artifacts): array => $artifacts->toArray(), + $this->artifacts + ); + } return $data; diff --git a/src/Resources/Einvoice/Enums/EinvoiceArtifactDirection.php b/src/Resources/Einvoice/Enums/EinvoiceArtifactDirection.php new file mode 100644 index 00000000..e894dc11 --- /dev/null +++ b/src/Resources/Einvoice/Enums/EinvoiceArtifactDirection.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/Einvoice/Enums/EinvoiceArtifactStatus.php b/src/Resources/Einvoice/Enums/EinvoiceArtifactStatus.php new file mode 100644 index 00000000..03528308 --- /dev/null +++ b/src/Resources/Einvoice/Enums/EinvoiceArtifactStatus.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/src/Resources/Einvoice/Enums/EntityType.php b/src/Resources/Einvoice/Enums/EntityType.php new file mode 100644 index 00000000..def66ad6 --- /dev/null +++ b/src/Resources/Einvoice/Enums/EntityType.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/src/Resources/EmailLog/EmailLog.php b/src/Resources/EmailLog/EmailLog.php new file mode 100644 index 00000000..e53efde7 --- /dev/null +++ b/src/Resources/EmailLog/EmailLog.php @@ -0,0 +1,168 @@ + $knownFields + */ + protected static array $knownFields = [ "id" , "template_name" , "from_address" , "to_address" , "subject" , "sent_on" , "customer_id" , "site_id" , "business_entity_id" , "brand_id" , "error_message" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $id, + ?string $template_name, + ?string $from_address, + ?string $to_address, + ?string $subject, + ?int $sent_on, + ?string $customer_id, + ?string $site_id, + ?string $business_entity_id, + ?string $brand_id, + ?string $error_message, + ?\Chargebee\Enums\Status $status, + ) + { + $this->id = $id; + $this->template_name = $template_name; + $this->from_address = $from_address; + $this->to_address = $to_address; + $this->subject = $subject; + $this->sent_on = $sent_on; + $this->customer_id = $customer_id; + $this->site_id = $site_id; + $this->business_entity_id = $business_entity_id; + $this->brand_id = $brand_id; + $this->error_message = $error_message; + $this->status = $status; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['id'] ?? null, + $resourceAttributes['template_name'] ?? null, + $resourceAttributes['from_address'] ?? null, + $resourceAttributes['to_address'] ?? null, + $resourceAttributes['subject'] ?? null, + $resourceAttributes['sent_on'] ?? null, + $resourceAttributes['customer_id'] ?? null, + $resourceAttributes['site_id'] ?? null, + $resourceAttributes['business_entity_id'] ?? null, + $resourceAttributes['brand_id'] ?? null, + $resourceAttributes['error_message'] ?? null, + + + isset($resourceAttributes['status']) ? \Chargebee\Enums\Status::tryFromValue($resourceAttributes['status']) : null, + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['id' => $this->id, + 'template_name' => $this->template_name, + 'from_address' => $this->from_address, + 'to_address' => $this->to_address, + 'subject' => $this->subject, + 'sent_on' => $this->sent_on, + 'customer_id' => $this->customer_id, + 'site_id' => $this->site_id, + 'business_entity_id' => $this->business_entity_id, + 'brand_id' => $this->brand_id, + 'error_message' => $this->error_message, + + 'status' => $this->status?->value, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Event/Event.php b/src/Resources/Event/Event.php index 5a9aed8c..b9b8e379 100644 --- a/src/Resources/Event/Event.php +++ b/src/Resources/Event/Event.php @@ -34,6 +34,12 @@ class Event { */ public ?array $webhooks; + /** + * + * @var ?string $site_id + */ + public ?string $site_id; + /** * * @var ?Content $content @@ -73,7 +79,7 @@ class Event { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "occurred_at" , "user" , "webhook_failure_reason" , "webhooks" , "content" , "origin_user" ]; + protected static array $knownFields = [ "id" , "occurred_at" , "user" , "webhook_failure_reason" , "webhooks" , "site_id" , "content" , "origin_user" ]; /** * dynamic properties for resources @@ -87,6 +93,7 @@ private function __construct( ?string $user, ?string $webhook_failure_reason, ?array $webhooks, + ?string $site_id, ?Content $content, ?string $origin_user, ?\Chargebee\Enums\Source $source, @@ -100,6 +107,7 @@ private function __construct( $this->user = $user; $this->webhook_failure_reason = $webhook_failure_reason; $this->webhooks = $webhooks; + $this->site_id = $site_id; $this->content = $content; $this->origin_user = $origin_user; $this->source = $source; @@ -119,6 +127,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['user'] ?? null, $resourceAttributes['webhook_failure_reason'] ?? null, $webhooks, + $resourceAttributes['site_id'] ?? null, isset($resourceAttributes['content']) ? Content::from($resourceAttributes['content']) : null, $resourceAttributes['origin_user'] ?? null, @@ -144,6 +153,7 @@ public function toArray(): array 'user' => $this->user, 'webhook_failure_reason' => $this->webhook_failure_reason, + 'site_id' => $this->site_id, 'origin_user' => $this->origin_user, diff --git a/src/Resources/GrantBlock/GrantBlock.php b/src/Resources/GrantBlock/GrantBlock.php index 5f85fc9f..96aba4e9 100644 --- a/src/Resources/GrantBlock/GrantBlock.php +++ b/src/Resources/GrantBlock/GrantBlock.php @@ -22,7 +22,7 @@ class GrantBlock { public ?string $unit_id; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $granted_amount */ public ?string $granted_amount; @@ -40,37 +40,37 @@ class GrantBlock { public ?int $expires_at; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $balance */ public ?string $balance; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $hold_amount */ public ?string $hold_amount; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $used_amount */ public ?string $used_amount; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $expired_amount */ public ?string $expired_amount; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $rolled_over_amount */ public ?string $rolled_over_amount; /** - * + *@deprecated This attribute is deprecated and will be removed in future version. * @var ?string $voided_amount */ public ?string $voided_amount; @@ -99,6 +99,18 @@ class GrantBlock { */ public ?int $resource_version; + /** + * + * @var ?ProvisionedBlockBalance $provisioned_block_balance + */ + public ?ProvisionedBlockBalance $provisioned_block_balance; + + /** + * + * @var ?OverdraftBlockBalance $overdraft_block_balance + */ + public ?OverdraftBlockBalance $overdraft_block_balance; + /** * * @var mixed $metadata @@ -113,15 +125,15 @@ class GrantBlock { /** * - * @var ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type + * @var ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type */ - public ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type; + public ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type; /** * - * @var ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type + * @var ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type */ - public ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type; + public ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type; /** * @@ -132,7 +144,7 @@ class GrantBlock { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "subscription_id" , "unit_id" , "granted_amount" , "effective_from" , "expires_at" , "balance" , "hold_amount" , "used_amount" , "expired_amount" , "rolled_over_amount" , "voided_amount" , "origin_grant_block_id" , "created_at" , "modified_at" , "resource_version" , "metadata" ]; + protected static array $knownFields = [ "id" , "subscription_id" , "unit_id" , "granted_amount" , "effective_from" , "expires_at" , "balance" , "hold_amount" , "used_amount" , "expired_amount" , "rolled_over_amount" , "voided_amount" , "origin_grant_block_id" , "created_at" , "modified_at" , "resource_version" , "provisioned_block_balance" , "overdraft_block_balance" , "metadata" ]; /** * dynamic properties for resources @@ -157,10 +169,12 @@ private function __construct( ?int $created_at, ?int $modified_at, ?int $resource_version, + ?ProvisionedBlockBalance $provisioned_block_balance, + ?OverdraftBlockBalance $overdraft_block_balance, mixed $metadata, ?\Chargebee\Enums\Status $status, - ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type, ?\Chargebee\Resources\GrantBlock\Enums\UnitType $unit_type, + ?\Chargebee\Resources\GrantBlock\Enums\AccountType $account_type, ?\Chargebee\Resources\GrantBlock\Enums\GrantSource $grant_source, ) { @@ -180,10 +194,12 @@ private function __construct( $this->created_at = $created_at; $this->modified_at = $modified_at; $this->resource_version = $resource_version; + $this->provisioned_block_balance = $provisioned_block_balance; + $this->overdraft_block_balance = $overdraft_block_balance; $this->metadata = $metadata; $this->status = $status; - $this->account_type = $account_type; $this->unit_type = $unit_type; + $this->account_type = $account_type; $this->grant_source = $grant_source; } @@ -205,15 +221,17 @@ public static function from(array $resourceAttributes): self $resourceAttributes['created_at'] ?? null, $resourceAttributes['modified_at'] ?? null, $resourceAttributes['resource_version'] ?? null, + isset($resourceAttributes['provisioned_block_balance']) ? ProvisionedBlockBalance::from($resourceAttributes['provisioned_block_balance']) : null, + isset($resourceAttributes['overdraft_block_balance']) ? OverdraftBlockBalance::from($resourceAttributes['overdraft_block_balance']) : null, $resourceAttributes['metadata'] ?? null, isset($resourceAttributes['status']) ? \Chargebee\Enums\Status::tryFromValue($resourceAttributes['status']) : null, - isset($resourceAttributes['account_type']) ? \Chargebee\Resources\GrantBlock\Enums\AccountType::tryFromValue($resourceAttributes['account_type']) : null, - isset($resourceAttributes['unit_type']) ? \Chargebee\Resources\GrantBlock\Enums\UnitType::tryFromValue($resourceAttributes['unit_type']) : null, + isset($resourceAttributes['account_type']) ? \Chargebee\Resources\GrantBlock\Enums\AccountType::tryFromValue($resourceAttributes['account_type']) : null, + isset($resourceAttributes['grant_source']) ? \Chargebee\Resources\GrantBlock\Enums\GrantSource::tryFromValue($resourceAttributes['grant_source']) : null, ); @@ -240,14 +258,16 @@ public function toArray(): array 'created_at' => $this->created_at, 'modified_at' => $this->modified_at, 'resource_version' => $this->resource_version, + + 'metadata' => $this->metadata, 'status' => $this->status?->value, - 'account_type' => $this->account_type?->value, - 'unit_type' => $this->unit_type?->value, + 'account_type' => $this->account_type?->value, + 'grant_source' => $this->grant_source?->value, ], function ($value) { @@ -255,6 +275,12 @@ public function toArray(): array }); + if($this->provisioned_block_balance instanceof ProvisionedBlockBalance){ + $data['provisioned_block_balance'] = $this->provisioned_block_balance->toArray(); + } + if($this->overdraft_block_balance instanceof OverdraftBlockBalance){ + $data['overdraft_block_balance'] = $this->overdraft_block_balance->toArray(); + } diff --git a/src/Resources/GrantBlock/OverdraftBlockBalance.php b/src/Resources/GrantBlock/OverdraftBlockBalance.php new file mode 100644 index 00000000..96a5667d --- /dev/null +++ b/src/Resources/GrantBlock/OverdraftBlockBalance.php @@ -0,0 +1,96 @@ + $knownFields + */ + protected static array $knownFields = [ "is_unlimited" , "limit" , "total_balance" , "usable_balance" , "used_amount" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?bool $is_unlimited, + ?string $limit, + ?string $total_balance, + ?string $usable_balance, + ?string $used_amount, + ) + { + $this->is_unlimited = $is_unlimited; + $this->limit = $limit; + $this->total_balance = $total_balance; + $this->usable_balance = $usable_balance; + $this->used_amount = $used_amount; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['is_unlimited'] ?? null, + $resourceAttributes['limit'] ?? null, + $resourceAttributes['total_balance'] ?? null, + $resourceAttributes['usable_balance'] ?? null, + $resourceAttributes['used_amount'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['is_unlimited' => $this->is_unlimited, + 'limit' => $this->limit, + 'total_balance' => $this->total_balance, + 'usable_balance' => $this->usable_balance, + 'used_amount' => $this->used_amount, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/GrantBlock/ProvisionedBlockBalance.php b/src/Resources/GrantBlock/ProvisionedBlockBalance.php new file mode 100644 index 00000000..6ce9bfe4 --- /dev/null +++ b/src/Resources/GrantBlock/ProvisionedBlockBalance.php @@ -0,0 +1,126 @@ + $knownFields + */ + protected static array $knownFields = [ "granted_amount" , "total_balance" , "usable_balance" , "hold_amount" , "used_amount" , "expired_amount" , "rolled_over_amount" , "voided_amount" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $granted_amount, + ?string $total_balance, + ?string $usable_balance, + ?string $hold_amount, + ?string $used_amount, + ?string $expired_amount, + ?string $rolled_over_amount, + ?string $voided_amount, + ) + { + $this->granted_amount = $granted_amount; + $this->total_balance = $total_balance; + $this->usable_balance = $usable_balance; + $this->hold_amount = $hold_amount; + $this->used_amount = $used_amount; + $this->expired_amount = $expired_amount; + $this->rolled_over_amount = $rolled_over_amount; + $this->voided_amount = $voided_amount; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['granted_amount'] ?? null, + $resourceAttributes['total_balance'] ?? null, + $resourceAttributes['usable_balance'] ?? null, + $resourceAttributes['hold_amount'] ?? null, + $resourceAttributes['used_amount'] ?? null, + $resourceAttributes['expired_amount'] ?? null, + $resourceAttributes['rolled_over_amount'] ?? null, + $resourceAttributes['voided_amount'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['granted_amount' => $this->granted_amount, + 'total_balance' => $this->total_balance, + 'usable_balance' => $this->usable_balance, + 'hold_amount' => $this->hold_amount, + 'used_amount' => $this->used_amount, + 'expired_amount' => $this->expired_amount, + 'rolled_over_amount' => $this->rolled_over_amount, + 'voided_amount' => $this->voided_amount, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/HostedPage/HostedPage.php b/src/Resources/HostedPage/HostedPage.php index 3b574949..c51e48a7 100644 --- a/src/Resources/HostedPage/HostedPage.php +++ b/src/Resources/HostedPage/HostedPage.php @@ -70,6 +70,12 @@ class HostedPage { */ public ?string $business_entity_id; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?\Chargebee\Enums\Layout $layout @@ -97,7 +103,7 @@ class HostedPage { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "url" , "pass_thru_content" , "embed" , "created_at" , "expires_at" , "content" , "updated_at" , "resource_version" , "checkout_info" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "url" , "pass_thru_content" , "embed" , "created_at" , "expires_at" , "content" , "updated_at" , "resource_version" , "checkout_info" , "business_entity_id" , "brand_id" ]; /** * dynamic properties for resources @@ -117,6 +123,7 @@ private function __construct( ?int $resource_version, mixed $checkout_info, ?string $business_entity_id, + ?string $brand_id, ?\Chargebee\Enums\Layout $layout, ?\Chargebee\Resources\HostedPage\Enums\Type $type, ?\Chargebee\Resources\HostedPage\Enums\State $state, @@ -133,7 +140,8 @@ private function __construct( $this->updated_at = $updated_at; $this->resource_version = $resource_version; $this->checkout_info = $checkout_info; - $this->business_entity_id = $business_entity_id; + $this->business_entity_id = $business_entity_id; + $this->brand_id = $brand_id; $this->layout = $layout; $this->type = $type; $this->state = $state; @@ -153,6 +161,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['resource_version'] ?? null, $resourceAttributes['checkout_info'] ?? null, $resourceAttributes['business_entity_id'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['layout']) ? \Chargebee\Enums\Layout::tryFromValue($resourceAttributes['layout']) : null, @@ -182,6 +191,7 @@ public function toArray(): array 'resource_version' => $this->resource_version, 'checkout_info' => $this->checkout_info, 'business_entity_id' => $this->business_entity_id, + 'brand_id' => $this->brand_id, 'layout' => $this->layout?->value, diff --git a/src/Resources/Invoice/Invoice.php b/src/Resources/Invoice/Invoice.php index debe9300..d057e3f7 100644 --- a/src/Resources/Invoice/Invoice.php +++ b/src/Resources/Invoice/Invoice.php @@ -400,6 +400,12 @@ class Invoice extends SupportsCustomFields { */ public ?string $business_entity_id; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?SiteDetailsAtCreation $site_details_at_creation @@ -433,7 +439,7 @@ class Invoice extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "payment_owner" , "subscription_id" , "recurring" , "date" , "due_date" , "net_term_days" , "po_number" , "vat_number" , "exchange_rate" , "local_currency_exchange_rate" , "currency_code" , "local_currency_code" , "tax" , "sub_total" , "sub_total_in_local_currency" , "total" , "total_in_local_currency" , "amount_due" , "amount_adjusted" , "amount_paid" , "paid_at" , "write_off_amount" , "credits_applied" , "next_retry_at" , "voided_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "exchange_rates" , "first_invoice" , "new_sales_amount" , "has_advance_charges" , "term_finalized" , "is_gifted" , "generated_at" , "expected_payment_date" , "amount_to_collect" , "round_off_amount" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_credits" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_payments" , "reference_transactions" , "dunning_attempts" , "applied_credits" , "adjustment_credit_notes" , "issued_credit_notes" , "linked_orders" , "notes" , "shipping_address" , "billing_address" , "statement_descriptor" , "einvoice" , "void_reason_code" , "deleted" , "tax_category" , "vat_number_prefix" , "business_entity_id" , "site_details_at_creation" ]; + protected static array $knownFields = [ "id" , "customer_id" , "payment_owner" , "subscription_id" , "recurring" , "date" , "due_date" , "net_term_days" , "po_number" , "vat_number" , "exchange_rate" , "local_currency_exchange_rate" , "currency_code" , "local_currency_code" , "tax" , "sub_total" , "sub_total_in_local_currency" , "total" , "total_in_local_currency" , "amount_due" , "amount_adjusted" , "amount_paid" , "paid_at" , "write_off_amount" , "credits_applied" , "next_retry_at" , "voided_at" , "resource_version" , "updated_at" , "line_items_next_offset" , "exchange_rates" , "first_invoice" , "new_sales_amount" , "has_advance_charges" , "term_finalized" , "is_gifted" , "generated_at" , "expected_payment_date" , "amount_to_collect" , "round_off_amount" , "line_items" , "line_item_tiers" , "line_item_discounts" , "line_item_taxes" , "line_item_credits" , "line_item_addresses" , "discounts" , "taxes" , "tax_origin" , "linked_payments" , "reference_transactions" , "dunning_attempts" , "applied_credits" , "adjustment_credit_notes" , "issued_credit_notes" , "linked_orders" , "notes" , "shipping_address" , "billing_address" , "statement_descriptor" , "einvoice" , "void_reason_code" , "deleted" , "tax_category" , "vat_number_prefix" , "business_entity_id" , "brand_id" , "site_details_at_creation" ]; /** * dynamic properties for resources @@ -508,6 +514,7 @@ private function __construct( ?string $tax_category, ?string $vat_number_prefix, ?string $business_entity_id, + ?string $brand_id, ?SiteDetailsAtCreation $site_details_at_creation, ?\Chargebee\Enums\PriceType $price_type, ?\Chargebee\Enums\Channel $channel, @@ -581,6 +588,7 @@ private function __construct( $this->tax_category = $tax_category; $this->vat_number_prefix = $vat_number_prefix; $this->business_entity_id = $business_entity_id; + $this->brand_id = $brand_id; $this->site_details_at_creation = $site_details_at_creation; $this->price_type = $price_type; $this->channel = $channel; @@ -724,6 +732,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['tax_category'] ?? null, $resourceAttributes['vat_number_prefix'] ?? null, $resourceAttributes['business_entity_id'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['site_details_at_creation']) ? SiteDetailsAtCreation::from($resourceAttributes['site_details_at_creation']) : null, @@ -813,6 +822,7 @@ public function toArray(): array 'tax_category' => $this->tax_category, 'vat_number_prefix' => $this->vat_number_prefix, 'business_entity_id' => $this->business_entity_id, + 'brand_id' => $this->brand_id, 'price_type' => $this->price_type?->value, diff --git a/src/Resources/LedgerEntry/LedgerEntry.php b/src/Resources/LedgerEntry/LedgerEntry.php index a6e4c843..a03cf958 100644 --- a/src/Resources/LedgerEntry/LedgerEntry.php +++ b/src/Resources/LedgerEntry/LedgerEntry.php @@ -83,15 +83,15 @@ class LedgerEntry { /** * - * @var ?\Chargebee\Resources\LedgerEntry\Enums\AccountType $account_type + * @var ?\Chargebee\Resources\LedgerEntry\Enums\UnitType $unit_type */ - public ?\Chargebee\Resources\LedgerEntry\Enums\AccountType $account_type; + public ?\Chargebee\Resources\LedgerEntry\Enums\UnitType $unit_type; /** * - * @var ?\Chargebee\Resources\LedgerEntry\Enums\UnitType $unit_type + * @var ?\Chargebee\Resources\LedgerEntry\Enums\AccountType $account_type */ - public ?\Chargebee\Resources\LedgerEntry\Enums\UnitType $unit_type; + public ?\Chargebee\Resources\LedgerEntry\Enums\AccountType $account_type; /** * @var array $knownFields @@ -118,8 +118,8 @@ private function __construct( ?int $created_at, ?int $modified_at, ?\Chargebee\Enums\Type $type, - ?\Chargebee\Resources\LedgerEntry\Enums\AccountType $account_type, ?\Chargebee\Resources\LedgerEntry\Enums\UnitType $unit_type, + ?\Chargebee\Resources\LedgerEntry\Enums\AccountType $account_type, ) { $this->id = $id; @@ -135,8 +135,8 @@ private function __construct( $this->created_at = $created_at; $this->modified_at = $modified_at; $this->type = $type; - $this->account_type = $account_type; - $this->unit_type = $unit_type; + $this->unit_type = $unit_type; + $this->account_type = $account_type; } public static function from(array $resourceAttributes): self @@ -157,9 +157,9 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['type']) ? \Chargebee\Enums\Type::tryFromValue($resourceAttributes['type']) : null, - isset($resourceAttributes['account_type']) ? \Chargebee\Resources\LedgerEntry\Enums\AccountType::tryFromValue($resourceAttributes['account_type']) : null, - isset($resourceAttributes['unit_type']) ? \Chargebee\Resources\LedgerEntry\Enums\UnitType::tryFromValue($resourceAttributes['unit_type']) : null, + + isset($resourceAttributes['account_type']) ? \Chargebee\Resources\LedgerEntry\Enums\AccountType::tryFromValue($resourceAttributes['account_type']) : null, ); @@ -184,10 +184,10 @@ public function toArray(): array 'type' => $this->type?->value, - 'account_type' => $this->account_type?->value, - 'unit_type' => $this->unit_type?->value, + 'account_type' => $this->account_type?->value, + ], function ($value) { return $value !== null; }); diff --git a/src/Resources/LedgerOperation/Enums/Type.php b/src/Resources/LedgerOperation/Enums/Type.php index 959ed3a0..622c1c61 100644 --- a/src/Resources/LedgerOperation/Enums/Type.php +++ b/src/Resources/LedgerOperation/Enums/Type.php @@ -12,6 +12,7 @@ enum Type : string { case VOID = "void"; case ROLLOVER = "rollover"; case ADJUSTMENT = "adjustment"; + case OVERDRAFT_SETTLEMENT = "overdraft_settlement"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemExpirationReason.php b/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemExpirationReason.php index 5e63dd22..883f9d2a 100644 --- a/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemExpirationReason.php +++ b/src/Resources/OmnichannelSubscription/Enums/OmnichannelSubscriptionItemExpirationReason.php @@ -6,6 +6,7 @@ enum OmnichannelSubscriptionItemExpirationReason : string { case BILLING_ERROR = "billing_error"; case PRODUCT_NOT_AVAILABLE = "product_not_available"; case OTHER = "other"; + case SUBSCRIPTION_NOT_FOUND_IN_SOURCE = "subscription_not_found_in_source"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/OmnichannelSubscriptionItem/Enums/ExpirationReason.php b/src/Resources/OmnichannelSubscriptionItem/Enums/ExpirationReason.php index 33972d4f..b0933fbd 100644 --- a/src/Resources/OmnichannelSubscriptionItem/Enums/ExpirationReason.php +++ b/src/Resources/OmnichannelSubscriptionItem/Enums/ExpirationReason.php @@ -6,6 +6,7 @@ enum ExpirationReason : string { case BILLING_ERROR = "billing_error"; case PRODUCT_NOT_AVAILABLE = "product_not_available"; case OTHER = "other"; + case SUBSCRIPTION_NOT_FOUND_IN_SOURCE = "subscription_not_found_in_source"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentIntent/Enums/PaymentMethodType.php b/src/Resources/PaymentIntent/Enums/PaymentMethodType.php index d829500b..4dccb549 100644 --- a/src/Resources/PaymentIntent/Enums/PaymentMethodType.php +++ b/src/Resources/PaymentIntent/Enums/PaymentMethodType.php @@ -55,6 +55,19 @@ enum PaymentMethodType : string { case TOUCH_N_GO = "touch_n_go"; case TAMARA = "tamara"; case QPAY = "qpay"; + case OVO = "ovo"; + case MOMO = "momo"; + case MERCADO_PAGO = "mercado_pago"; + case NEQUI = "nequi"; + case NUPAY = "nupay"; + case PICPAY = "picpay"; + case THAI_QR = "thai_qr"; + case BLIK = "blik"; + case FPX = "fpx"; + case WERO = "wero"; + case P24 = "p24"; + case AFFIRM_PAY = "affirm_pay"; + case RAKUTEN_PAY = "rakuten_pay"; case UNKNOWN = "unknown"; public static function tryFromValue(string $value): self { diff --git a/src/Resources/PaymentIntent/PaymentIntent.php b/src/Resources/PaymentIntent/PaymentIntent.php index 006cafad..39d89a15 100644 --- a/src/Resources/PaymentIntent/PaymentIntent.php +++ b/src/Resources/PaymentIntent/PaymentIntent.php @@ -117,6 +117,12 @@ class PaymentIntent { */ public ?string $business_entity_id; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?\Chargebee\Resources\PaymentIntent\Enums\Status $status @@ -132,7 +138,7 @@ class PaymentIntent { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "currency_code" , "amount" , "gateway_account_id" , "expires_at" , "reference_id" , "success_url" , "failure_url" , "created_at" , "modified_at" , "resource_version" , "updated_at" , "payment_method_options" , "customer_id" , "gateway" , "active_payment_attempt" , "payment_attempts" , "payment_intent_metadata" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "currency_code" , "amount" , "gateway_account_id" , "expires_at" , "reference_id" , "success_url" , "failure_url" , "created_at" , "modified_at" , "resource_version" , "updated_at" , "payment_method_options" , "customer_id" , "gateway" , "active_payment_attempt" , "payment_attempts" , "payment_intent_metadata" , "business_entity_id" , "brand_id" ]; /** * dynamic properties for resources @@ -160,6 +166,7 @@ private function __construct( ?array $payment_attempts, ?PaymentIntentMetadata $payment_intent_metadata, ?string $business_entity_id, + ?string $brand_id, ?\Chargebee\Resources\PaymentIntent\Enums\Status $status, ?\Chargebee\Resources\PaymentIntent\Enums\PaymentMethodType $payment_method_type, ) @@ -182,7 +189,8 @@ private function __construct( $this->active_payment_attempt = $active_payment_attempt; $this->payment_attempts = $payment_attempts; $this->payment_intent_metadata = $payment_intent_metadata; - $this->business_entity_id = $business_entity_id; + $this->business_entity_id = $business_entity_id; + $this->brand_id = $brand_id; $this->status = $status; $this->payment_method_type = $payment_method_type; } @@ -212,6 +220,7 @@ public static function from(array $resourceAttributes): self $payment_attempts, isset($resourceAttributes['payment_intent_metadata']) ? PaymentIntentMetadata::from($resourceAttributes['payment_intent_metadata']) : null, $resourceAttributes['business_entity_id'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['status']) ? \Chargebee\Resources\PaymentIntent\Enums\Status::tryFromValue($resourceAttributes['status']) : null, @@ -245,6 +254,7 @@ public function toArray(): array 'business_entity_id' => $this->business_entity_id, + 'brand_id' => $this->brand_id, 'status' => $this->status?->value, diff --git a/src/Resources/PaymentSchedule/PaymentSchedule.php b/src/Resources/PaymentSchedule/PaymentSchedule.php index 8283b362..058b3832 100644 --- a/src/Resources/PaymentSchedule/PaymentSchedule.php +++ b/src/Resources/PaymentSchedule/PaymentSchedule.php @@ -57,6 +57,12 @@ class PaymentSchedule { */ public ?array $schedule_entries; + /** + * + * @var ?array $reference_transactions + */ + public ?array $reference_transactions; + /** * * @var ?\Chargebee\Resources\PaymentSchedule\Enums\EntityType $entity_type @@ -66,7 +72,7 @@ class PaymentSchedule { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "scheme_id" , "entity_id" , "amount" , "created_at" , "resource_version" , "updated_at" , "currency_code" , "schedule_entries" ]; + protected static array $knownFields = [ "id" , "scheme_id" , "entity_id" , "amount" , "created_at" , "resource_version" , "updated_at" , "currency_code" , "schedule_entries" , "reference_transactions" ]; /** * dynamic properties for resources @@ -84,6 +90,7 @@ private function __construct( ?int $updated_at, ?string $currency_code, ?array $schedule_entries, + ?array $reference_transactions, ?\Chargebee\Resources\PaymentSchedule\Enums\EntityType $entity_type, ) { @@ -95,7 +102,8 @@ private function __construct( $this->resource_version = $resource_version; $this->updated_at = $updated_at; $this->currency_code = $currency_code; - $this->schedule_entries = $schedule_entries; + $this->schedule_entries = $schedule_entries; + $this->reference_transactions = $reference_transactions; $this->entity_type = $entity_type; } @@ -105,6 +113,10 @@ public static function from(array $resourceAttributes): self $result ), $resourceAttributes['schedule_entries'] ?? []); + $reference_transactions = array_map(fn (array $result): ReferenceTransaction => ReferenceTransaction::from( + $result + ), $resourceAttributes['reference_transactions'] ?? []); + $returnData = new self( $resourceAttributes['id'] ?? null, $resourceAttributes['scheme_id'] ?? null, $resourceAttributes['entity_id'] ?? null, @@ -114,6 +126,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['updated_at'] ?? null, $resourceAttributes['currency_code'] ?? null, $schedule_entries, + $reference_transactions, isset($resourceAttributes['entity_type']) ? \Chargebee\Resources\PaymentSchedule\Enums\EntityType::tryFromValue($resourceAttributes['entity_type']) : null, @@ -136,6 +149,7 @@ public function toArray(): array 'currency_code' => $this->currency_code, + 'entity_type' => $this->entity_type?->value, ], function ($value) { @@ -150,6 +164,12 @@ public function toArray(): array $this->schedule_entries ); } + if($this->reference_transactions !== []){ + $data['reference_transactions'] = array_map( + fn (ReferenceTransaction $reference_transactions): array => $reference_transactions->toArray(), + $this->reference_transactions + ); + } return $data; diff --git a/src/Resources/PaymentSchedule/ReferenceTransaction.php b/src/Resources/PaymentSchedule/ReferenceTransaction.php new file mode 100644 index 00000000..30a58cc4 --- /dev/null +++ b/src/Resources/PaymentSchedule/ReferenceTransaction.php @@ -0,0 +1,106 @@ + $knownFields + */ + protected static array $knownFields = [ "schedule_entry_id" , "applied_amount" , "txn_id" , "txn_status" , "txn_date" , "txn_amount" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $schedule_entry_id, + ?int $applied_amount, + ?string $txn_id, + ?string $txn_status, + ?int $txn_date, + ?int $txn_amount, + ) + { + $this->schedule_entry_id = $schedule_entry_id; + $this->applied_amount = $applied_amount; + $this->txn_id = $txn_id; + $this->txn_status = $txn_status; + $this->txn_date = $txn_date; + $this->txn_amount = $txn_amount; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['schedule_entry_id'] ?? null, + $resourceAttributes['applied_amount'] ?? null, + $resourceAttributes['txn_id'] ?? null, + $resourceAttributes['txn_status'] ?? null, + $resourceAttributes['txn_date'] ?? null, + $resourceAttributes['txn_amount'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['schedule_entry_id' => $this->schedule_entry_id, + 'applied_amount' => $this->applied_amount, + 'txn_id' => $this->txn_id, + 'txn_status' => $this->txn_status, + 'txn_date' => $this->txn_date, + 'txn_amount' => $this->txn_amount, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PaymentSchedule/ScheduleEntry.php b/src/Resources/PaymentSchedule/ScheduleEntry.php index 03f92122..d877d3cf 100644 --- a/src/Resources/PaymentSchedule/ScheduleEntry.php +++ b/src/Resources/PaymentSchedule/ScheduleEntry.php @@ -21,6 +21,12 @@ class ScheduleEntry { */ public ?int $amount; + /** + * + * @var ?int $scheduled_amount + */ + public ?int $scheduled_amount; + /** * * @var ?string $status @@ -30,7 +36,7 @@ class ScheduleEntry { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "date" , "amount" , "status" ]; + protected static array $knownFields = [ "id" , "date" , "amount" , "scheduled_amount" , "status" ]; /** * dynamic properties for resources @@ -42,12 +48,14 @@ private function __construct( ?string $id, ?int $date, ?int $amount, + ?int $scheduled_amount, ?string $status, ) { $this->id = $id; $this->date = $date; $this->amount = $amount; + $this->scheduled_amount = $scheduled_amount; $this->status = $status; } @@ -56,6 +64,7 @@ public static function from(array $resourceAttributes): self $returnData = new self( $resourceAttributes['id'] ?? null, $resourceAttributes['date'] ?? null, $resourceAttributes['amount'] ?? null, + $resourceAttributes['scheduled_amount'] ?? null, $resourceAttributes['status'] ?? null, @@ -70,6 +79,7 @@ public function toArray(): array $data = array_filter(['id' => $this->id, 'date' => $this->date, 'amount' => $this->amount, + 'scheduled_amount' => $this->scheduled_amount, 'status' => $this->status, ], function ($value) { diff --git a/src/Resources/PaymentScheduleEstimate/ScheduleEntry.php b/src/Resources/PaymentScheduleEstimate/ScheduleEntry.php index c6b79eb8..302ff255 100644 --- a/src/Resources/PaymentScheduleEstimate/ScheduleEntry.php +++ b/src/Resources/PaymentScheduleEstimate/ScheduleEntry.php @@ -21,6 +21,12 @@ class ScheduleEntry { */ public ?int $amount; + /** + * + * @var ?int $scheduled_amount + */ + public ?int $scheduled_amount; + /** * * @var ?string $status @@ -30,7 +36,7 @@ class ScheduleEntry { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "date" , "amount" , "status" ]; + protected static array $knownFields = [ "id" , "date" , "amount" , "scheduled_amount" , "status" ]; /** * dynamic properties for resources @@ -42,12 +48,14 @@ private function __construct( ?string $id, ?int $date, ?int $amount, + ?int $scheduled_amount, ?string $status, ) { $this->id = $id; $this->date = $date; $this->amount = $amount; + $this->scheduled_amount = $scheduled_amount; $this->status = $status; } @@ -56,6 +64,7 @@ public static function from(array $resourceAttributes): self $returnData = new self( $resourceAttributes['id'] ?? null, $resourceAttributes['date'] ?? null, $resourceAttributes['amount'] ?? null, + $resourceAttributes['scheduled_amount'] ?? null, $resourceAttributes['status'] ?? null, @@ -70,6 +79,7 @@ public function toArray(): array $data = array_filter(['id' => $this->id, 'date' => $this->date, 'amount' => $this->amount, + 'scheduled_amount' => $this->scheduled_amount, 'status' => $this->status, ], function ($value) { diff --git a/src/Resources/PaymentSource/NetworkTransactionReference.php b/src/Resources/PaymentSource/NetworkTransactionReference.php new file mode 100644 index 00000000..6ab22155 --- /dev/null +++ b/src/Resources/PaymentSource/NetworkTransactionReference.php @@ -0,0 +1,56 @@ + $knownFields + */ + protected static array $knownFields = [ "original_network_transaction_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $original_network_transaction_id, + ) + { + $this->original_network_transaction_id = $original_network_transaction_id; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['original_network_transaction_id'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['original_network_transaction_id' => $this->original_network_transaction_id, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/PaymentSource/PaymentSource.php b/src/Resources/PaymentSource/PaymentSource.php index 43f04f19..111229f4 100644 --- a/src/Resources/PaymentSource/PaymentSource.php +++ b/src/Resources/PaymentSource/PaymentSource.php @@ -123,6 +123,12 @@ class PaymentSource { */ public mixed $vault_token; + /** + * + * @var ?NetworkTransactionReference $network_transaction_reference + */ + public ?NetworkTransactionReference $network_transaction_reference; + /** * * @var ?bool $deleted @@ -135,6 +141,12 @@ class PaymentSource { */ public ?string $business_entity_id; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?\Chargebee\Enums\Type $type @@ -156,7 +168,7 @@ class PaymentSource { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "resource_version" , "updated_at" , "created_at" , "customer_id" , "reference_id" , "gateway_account_id" , "ip_address" , "issuing_country" , "card" , "bank_account" , "boleto" , "billing_address" , "amazon_payment" , "upi" , "paypal" , "venmo" , "klarna_pay_now" , "mandates" , "vault_token" , "deleted" , "business_entity_id" ]; + protected static array $knownFields = [ "id" , "resource_version" , "updated_at" , "created_at" , "customer_id" , "reference_id" , "gateway_account_id" , "ip_address" , "issuing_country" , "card" , "bank_account" , "boleto" , "billing_address" , "amazon_payment" , "upi" , "paypal" , "venmo" , "klarna_pay_now" , "mandates" , "vault_token" , "network_transaction_reference" , "deleted" , "business_entity_id" , "brand_id" ]; /** * dynamic properties for resources @@ -185,8 +197,10 @@ private function __construct( ?KlarnaPayNow $klarna_pay_now, ?array $mandates, mixed $vault_token, + ?NetworkTransactionReference $network_transaction_reference, ?bool $deleted, ?string $business_entity_id, + ?string $brand_id, ?\Chargebee\Enums\Type $type, ?\Chargebee\Enums\Gateway $gateway, ?\Chargebee\Resources\PaymentSource\Enums\Status $status, @@ -212,8 +226,10 @@ private function __construct( $this->klarna_pay_now = $klarna_pay_now; $this->mandates = $mandates; $this->vault_token = $vault_token; + $this->network_transaction_reference = $network_transaction_reference; $this->deleted = $deleted; - $this->business_entity_id = $business_entity_id; + $this->business_entity_id = $business_entity_id; + $this->brand_id = $brand_id; $this->type = $type; $this->gateway = $gateway; $this->status = $status; @@ -245,8 +261,10 @@ public static function from(array $resourceAttributes): self isset($resourceAttributes['klarna_pay_now']) ? KlarnaPayNow::from($resourceAttributes['klarna_pay_now']) : null, $mandates, $resourceAttributes['vault_token'] ?? null, + isset($resourceAttributes['network_transaction_reference']) ? NetworkTransactionReference::from($resourceAttributes['network_transaction_reference']) : null, $resourceAttributes['deleted'] ?? null, $resourceAttributes['business_entity_id'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['type']) ? \Chargebee\Enums\Type::tryFromValue($resourceAttributes['type']) : null, @@ -283,8 +301,10 @@ public function toArray(): array 'vault_token' => $this->vault_token, + 'deleted' => $this->deleted, 'business_entity_id' => $this->business_entity_id, + 'brand_id' => $this->brand_id, 'type' => $this->type?->value, @@ -324,6 +344,9 @@ public function toArray(): array if($this->klarna_pay_now instanceof KlarnaPayNow){ $data['klarna_pay_now'] = $this->klarna_pay_now->toArray(); } + if($this->network_transaction_reference instanceof NetworkTransactionReference){ + $data['network_transaction_reference'] = $this->network_transaction_reference->toArray(); + } if($this->mandates !== []){ $data['mandates'] = array_map( diff --git a/src/Resources/QuotedSubscription/SubscriptionItem.php b/src/Resources/QuotedSubscription/SubscriptionItem.php index 1fa48084..5972cde0 100644 --- a/src/Resources/QuotedSubscription/SubscriptionItem.php +++ b/src/Resources/QuotedSubscription/SubscriptionItem.php @@ -153,10 +153,16 @@ class SubscriptionItem { */ public ?string $usage_accumulation_reset_frequency; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * @var array $knownFields */ - protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "last_calculated_at" , "unit_price" , "unit_price_in_decimal" , "amount" , "current_term_start" , "current_term_end" , "next_billing_at" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "trial_end" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "proration_type" , "usage_accumulation_reset_frequency" ]; + protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "last_calculated_at" , "unit_price" , "unit_price_in_decimal" , "amount" , "current_term_start" , "current_term_end" , "next_billing_at" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "trial_end" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "proration_type" , "usage_accumulation_reset_frequency" , "description" ]; /** * dynamic properties for resources @@ -190,6 +196,7 @@ private function __construct( ?string $charge_on_option, ?string $proration_type, ?string $usage_accumulation_reset_frequency, + ?string $description, ) { $this->item_price_id = $item_price_id; @@ -216,7 +223,8 @@ private function __construct( $this->charge_once = $charge_once; $this->charge_on_option = $charge_on_option; $this->proration_type = $proration_type; - $this->usage_accumulation_reset_frequency = $usage_accumulation_reset_frequency; + $this->usage_accumulation_reset_frequency = $usage_accumulation_reset_frequency; + $this->description = $description; } public static function from(array $resourceAttributes): self @@ -246,6 +254,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['charge_on_option'] ?? null, $resourceAttributes['proration_type'] ?? null, $resourceAttributes['usage_accumulation_reset_frequency'] ?? null, + $resourceAttributes['description'] ?? null, ); @@ -281,6 +290,7 @@ public function toArray(): array 'charge_on_option' => $this->charge_on_option, 'proration_type' => $this->proration_type, 'usage_accumulation_reset_frequency' => $this->usage_accumulation_reset_frequency, + 'description' => $this->description, ], function ($value) { return $value !== null; diff --git a/src/Resources/Ramp/BillingConfiguration.php b/src/Resources/Ramp/BillingConfiguration.php new file mode 100644 index 00000000..11854c85 --- /dev/null +++ b/src/Resources/Ramp/BillingConfiguration.php @@ -0,0 +1,56 @@ + $knownFields + */ + protected static array $knownFields = [ "po_number" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $po_number, + ) + { + $this->po_number = $po_number; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['po_number'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['po_number' => $this->po_number, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Ramp/Ramp.php b/src/Resources/Ramp/Ramp.php index 30771f0f..3093d578 100644 --- a/src/Resources/Ramp/Ramp.php +++ b/src/Resources/Ramp/Ramp.php @@ -99,6 +99,12 @@ class Ramp { */ public ?ContractTerm $contract_term; + /** + * + * @var ?BillingConfiguration $billing_configuration + */ + public ?BillingConfiguration $billing_configuration; + /** * * @var ?bool $deleted @@ -120,7 +126,7 @@ class Ramp { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "description" , "subscription_id" , "effective_from" , "created_at" , "resource_version" , "updated_at" , "items_to_add" , "items_to_update" , "coupons_to_add" , "discounts_to_add" , "item_tiers" , "items_to_remove" , "coupons_to_remove" , "discounts_to_remove" , "contract_term" , "deleted" , "status_transition_reason" ]; + protected static array $knownFields = [ "id" , "description" , "subscription_id" , "effective_from" , "created_at" , "resource_version" , "updated_at" , "items_to_add" , "items_to_update" , "coupons_to_add" , "discounts_to_add" , "item_tiers" , "items_to_remove" , "coupons_to_remove" , "discounts_to_remove" , "contract_term" , "billing_configuration" , "deleted" , "status_transition_reason" ]; /** * dynamic properties for resources @@ -145,6 +151,7 @@ private function __construct( ?array $coupons_to_remove, ?array $discounts_to_remove, ?ContractTerm $contract_term, + ?BillingConfiguration $billing_configuration, ?bool $deleted, ?StatusTransitionReason $status_transition_reason, ?\Chargebee\Resources\Ramp\Enums\Status $status, @@ -166,6 +173,7 @@ private function __construct( $this->coupons_to_remove = $coupons_to_remove; $this->discounts_to_remove = $discounts_to_remove; $this->contract_term = $contract_term; + $this->billing_configuration = $billing_configuration; $this->deleted = $deleted; $this->status_transition_reason = $status_transition_reason; $this->status = $status; @@ -209,6 +217,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['coupons_to_remove'] ?? null, $resourceAttributes['discounts_to_remove'] ?? null, isset($resourceAttributes['contract_term']) ? ContractTerm::from($resourceAttributes['contract_term']) : null, + isset($resourceAttributes['billing_configuration']) ? BillingConfiguration::from($resourceAttributes['billing_configuration']) : null, $resourceAttributes['deleted'] ?? null, isset($resourceAttributes['status_transition_reason']) ? StatusTransitionReason::from($resourceAttributes['status_transition_reason']) : null, @@ -239,6 +248,7 @@ public function toArray(): array 'coupons_to_remove' => $this->coupons_to_remove, 'discounts_to_remove' => $this->discounts_to_remove, + 'deleted' => $this->deleted, @@ -252,6 +262,9 @@ public function toArray(): array if($this->contract_term instanceof ContractTerm){ $data['contract_term'] = $this->contract_term->toArray(); } + if($this->billing_configuration instanceof BillingConfiguration){ + $data['billing_configuration'] = $this->billing_configuration->toArray(); + } if($this->status_transition_reason instanceof StatusTransitionReason){ $data['status_transition_reason'] = $this->status_transition_reason->toArray(); } diff --git a/src/Resources/Subscription/Subscription.php b/src/Resources/Subscription/Subscription.php index 228bebaf..4ff88e9a 100644 --- a/src/Resources/Subscription/Subscription.php +++ b/src/Resources/Subscription/Subscription.php @@ -430,6 +430,12 @@ class Subscription extends SupportsCustomFields { */ public ?bool $decommissioned; + /** + * + * @var ?string $brand_id + */ + public ?string $brand_id; + /** * * @var ?\Chargebee\Enums\AutoCollection $auto_collection @@ -481,7 +487,7 @@ class Subscription extends SupportsCustomFields { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "currency_code" , "plan_id" , "plan_quantity" , "plan_unit_price" , "setup_fee" , "billing_period" , "start_date" , "trial_end" , "remaining_billing_cycles" , "po_number" , "plan_quantity_in_decimal" , "plan_unit_price_in_decimal" , "customer_id" , "plan_amount" , "plan_free_quantity" , "trial_start" , "current_term_start" , "current_term_end" , "next_billing_at" , "created_at" , "started_at" , "activated_at" , "gift_id" , "contract_term_billing_cycle_on_renewal" , "override_relationship" , "pause_date" , "resume_date" , "cancelled_at" , "affiliate_token" , "created_from_ip" , "resource_version" , "updated_at" , "has_scheduled_advance_invoices" , "has_scheduled_changes" , "payment_source_id" , "plan_free_quantity_in_decimal" , "plan_amount_in_decimal" , "cancel_schedule_created_at" , "net_term_days" , "active_id" , "subscription_items" , "item_tiers" , "charged_items" , "due_invoices_count" , "due_since" , "total_dues" , "mrr" , "arr" , "exchange_rate" , "base_currency_code" , "addons" , "event_based_addons" , "charged_event_based_addons" , "coupon" , "coupons" , "shipping_address" , "referral_info" , "billing_override" , "invoice_notes" , "meta_data" , "deleted" , "changes_scheduled_at" , "contract_term" , "cancel_reason_code" , "free_period" , "create_pending_invoices" , "auto_close_invoices" , "discounts" , "business_entity_id" , "decommissioned" ]; + protected static array $knownFields = [ "id" , "currency_code" , "plan_id" , "plan_quantity" , "plan_unit_price" , "setup_fee" , "billing_period" , "start_date" , "trial_end" , "remaining_billing_cycles" , "po_number" , "plan_quantity_in_decimal" , "plan_unit_price_in_decimal" , "customer_id" , "plan_amount" , "plan_free_quantity" , "trial_start" , "current_term_start" , "current_term_end" , "next_billing_at" , "created_at" , "started_at" , "activated_at" , "gift_id" , "contract_term_billing_cycle_on_renewal" , "override_relationship" , "pause_date" , "resume_date" , "cancelled_at" , "affiliate_token" , "created_from_ip" , "resource_version" , "updated_at" , "has_scheduled_advance_invoices" , "has_scheduled_changes" , "payment_source_id" , "plan_free_quantity_in_decimal" , "plan_amount_in_decimal" , "cancel_schedule_created_at" , "net_term_days" , "active_id" , "subscription_items" , "item_tiers" , "charged_items" , "due_invoices_count" , "due_since" , "total_dues" , "mrr" , "arr" , "exchange_rate" , "base_currency_code" , "addons" , "event_based_addons" , "charged_event_based_addons" , "coupon" , "coupons" , "shipping_address" , "referral_info" , "billing_override" , "invoice_notes" , "meta_data" , "deleted" , "changes_scheduled_at" , "contract_term" , "cancel_reason_code" , "free_period" , "create_pending_invoices" , "auto_close_invoices" , "discounts" , "business_entity_id" , "decommissioned" , "brand_id" ]; /** * dynamic properties for resources @@ -561,6 +567,7 @@ private function __construct( ?array $discounts, ?string $business_entity_id, ?bool $decommissioned, + ?string $brand_id, ?\Chargebee\Enums\AutoCollection $auto_collection, ?\Chargebee\Enums\TrialEndAction $trial_end_action, ?\Chargebee\Enums\OfflinePaymentMethod $offline_payment_method, @@ -641,7 +648,8 @@ private function __construct( $this->auto_close_invoices = $auto_close_invoices; $this->discounts = $discounts; $this->business_entity_id = $business_entity_id; - $this->decommissioned = $decommissioned; + $this->decommissioned = $decommissioned; + $this->brand_id = $brand_id; $this->auto_collection = $auto_collection; $this->trial_end_action = $trial_end_action; $this->offline_payment_method = $offline_payment_method; @@ -757,6 +765,7 @@ public static function from(array $resourceAttributes): self $discounts, $resourceAttributes['business_entity_id'] ?? null, $resourceAttributes['decommissioned'] ?? null, + $resourceAttributes['brand_id'] ?? null, isset($resourceAttributes['auto_collection']) ? \Chargebee\Enums\AutoCollection::tryFromValue($resourceAttributes['auto_collection']) : null, @@ -858,6 +867,7 @@ public function toArray(): array 'business_entity_id' => $this->business_entity_id, 'decommissioned' => $this->decommissioned, + 'brand_id' => $this->brand_id, 'auto_collection' => $this->auto_collection?->value, diff --git a/src/Resources/Subscription/SubscriptionItem.php b/src/Resources/Subscription/SubscriptionItem.php index 2b26ac99..f4332f34 100644 --- a/src/Resources/Subscription/SubscriptionItem.php +++ b/src/Resources/Subscription/SubscriptionItem.php @@ -153,10 +153,16 @@ class SubscriptionItem { */ public ?string $usage_accumulation_reset_frequency; + /** + * + * @var ?string $description + */ + public ?string $description; + /** * @var array $knownFields */ - protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "last_calculated_at" , "unit_price" , "unit_price_in_decimal" , "amount" , "current_term_start" , "current_term_end" , "next_billing_at" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "trial_end" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "proration_type" , "usage_accumulation_reset_frequency" ]; + protected static array $knownFields = [ "item_price_id" , "item_type" , "quantity" , "quantity_in_decimal" , "metered_quantity" , "last_calculated_at" , "unit_price" , "unit_price_in_decimal" , "amount" , "current_term_start" , "current_term_end" , "next_billing_at" , "amount_in_decimal" , "billing_period" , "billing_period_unit" , "free_quantity" , "free_quantity_in_decimal" , "trial_end" , "billing_cycles" , "service_period_days" , "charge_on_event" , "charge_once" , "charge_on_option" , "proration_type" , "usage_accumulation_reset_frequency" , "description" ]; /** * dynamic properties for resources @@ -190,6 +196,7 @@ private function __construct( ?string $charge_on_option, ?string $proration_type, ?string $usage_accumulation_reset_frequency, + ?string $description, ) { $this->item_price_id = $item_price_id; @@ -216,7 +223,8 @@ private function __construct( $this->charge_once = $charge_once; $this->charge_on_option = $charge_on_option; $this->proration_type = $proration_type; - $this->usage_accumulation_reset_frequency = $usage_accumulation_reset_frequency; + $this->usage_accumulation_reset_frequency = $usage_accumulation_reset_frequency; + $this->description = $description; } public static function from(array $resourceAttributes): self @@ -246,6 +254,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['charge_on_option'] ?? null, $resourceAttributes['proration_type'] ?? null, $resourceAttributes['usage_accumulation_reset_frequency'] ?? null, + $resourceAttributes['description'] ?? null, ); @@ -281,6 +290,7 @@ public function toArray(): array 'charge_on_option' => $this->charge_on_option, 'proration_type' => $this->proration_type, 'usage_accumulation_reset_frequency' => $this->usage_accumulation_reset_frequency, + 'description' => $this->description, ], function ($value) { return $value !== null; diff --git a/src/Resources/ThirdPartyPaymentMethod/ThirdPartyPaymentMethod.php b/src/Resources/ThirdPartyPaymentMethod/ThirdPartyPaymentMethod.php index 6babda89..ec30bffb 100644 --- a/src/Resources/ThirdPartyPaymentMethod/ThirdPartyPaymentMethod.php +++ b/src/Resources/ThirdPartyPaymentMethod/ThirdPartyPaymentMethod.php @@ -15,6 +15,12 @@ class ThirdPartyPaymentMethod { */ public ?string $reference_id; + /** + * + * @var mixed $network_transaction_reference + */ + public mixed $network_transaction_reference; + /** * * @var ?\Chargebee\Enums\Type $type @@ -30,7 +36,7 @@ class ThirdPartyPaymentMethod { /** * @var array $knownFields */ - protected static array $knownFields = [ "gateway_account_id" , "reference_id" ]; + protected static array $knownFields = [ "gateway_account_id" , "reference_id" , "network_transaction_reference" ]; /** * dynamic properties for resources @@ -41,12 +47,14 @@ class ThirdPartyPaymentMethod { private function __construct( ?string $gateway_account_id, ?string $reference_id, + mixed $network_transaction_reference, ?\Chargebee\Enums\Type $type, ?\Chargebee\Enums\Gateway $gateway, ) { $this->gateway_account_id = $gateway_account_id; - $this->reference_id = $reference_id; + $this->reference_id = $reference_id; + $this->network_transaction_reference = $network_transaction_reference; $this->type = $type; $this->gateway = $gateway; } @@ -55,6 +63,7 @@ public static function from(array $resourceAttributes): self { $returnData = new self( $resourceAttributes['gateway_account_id'] ?? null, $resourceAttributes['reference_id'] ?? null, + $resourceAttributes['network_transaction_reference'] ?? null, isset($resourceAttributes['type']) ? \Chargebee\Enums\Type::tryFromValue($resourceAttributes['type']) : null, @@ -71,6 +80,7 @@ public function toArray(): array $data = array_filter(['gateway_account_id' => $this->gateway_account_id, 'reference_id' => $this->reference_id, + 'network_transaction_reference' => $this->network_transaction_reference, 'type' => $this->type?->value, diff --git a/src/Resources/Transaction/NetworkTransactionDetail.php b/src/Resources/Transaction/NetworkTransactionDetail.php new file mode 100644 index 00000000..d1ea299e --- /dev/null +++ b/src/Resources/Transaction/NetworkTransactionDetail.php @@ -0,0 +1,66 @@ + $knownFields + */ + protected static array $knownFields = [ "network_transaction_id" , "original_network_transaction_id" ]; + + /** + * dynamic properties for resources + * @var array $_data; + */ + protected $_data = []; + + private function __construct( + ?string $network_transaction_id, + ?string $original_network_transaction_id, + ) + { + $this->network_transaction_id = $network_transaction_id; + $this->original_network_transaction_id = $original_network_transaction_id; + } + + public static function from(array $resourceAttributes): self + { + $returnData = new self( $resourceAttributes['network_transaction_id'] ?? null, + $resourceAttributes['original_network_transaction_id'] ?? null, + + + ); + + return $returnData; + } + + public function toArray(): array + { + + $data = array_filter(['network_transaction_id' => $this->network_transaction_id, + 'original_network_transaction_id' => $this->original_network_transaction_id, + + ], function ($value) { + return $value !== null; + }); + + + + + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Resources/Transaction/Transaction.php b/src/Resources/Transaction/Transaction.php index da2f1667..e3321dfe 100644 --- a/src/Resources/Transaction/Transaction.php +++ b/src/Resources/Transaction/Transaction.php @@ -237,6 +237,12 @@ class Transaction { */ public ?string $custom_payment_method_name; + /** + * + * @var ?NetworkTransactionDetail $network_transaction_details + */ + public ?NetworkTransactionDetail $network_transaction_details; + /** * * @var ?\Chargebee\Enums\PaymentMethod $payment_method @@ -282,7 +288,7 @@ class Transaction { /** * @var array $knownFields */ - protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "gateway_account_id" , "payment_source_id" , "reference_number" , "date" , "settled_at" , "exchange_rate" , "currency_code" , "amount" , "id_at_gateway" , "three_d_secure" , "error_code" , "error_text" , "voided_at" , "resource_version" , "updated_at" , "fraud_reason" , "custom_payment_method_id" , "amount_unused" , "masked_card_number" , "reference_transaction_id" , "refunded_txn_id" , "reference_authorization_id" , "amount_capturable" , "reversal_transaction_id" , "linked_invoices" , "linked_credit_notes" , "linked_refunds" , "linked_payments" , "deleted" , "iin" , "last4" , "merchant_reference_id" , "business_entity_id" , "payment_method_details" , "error_detail" , "custom_payment_method_name" ]; + protected static array $knownFields = [ "id" , "customer_id" , "subscription_id" , "gateway_account_id" , "payment_source_id" , "reference_number" , "date" , "settled_at" , "exchange_rate" , "currency_code" , "amount" , "id_at_gateway" , "three_d_secure" , "error_code" , "error_text" , "voided_at" , "resource_version" , "updated_at" , "fraud_reason" , "custom_payment_method_id" , "amount_unused" , "masked_card_number" , "reference_transaction_id" , "refunded_txn_id" , "reference_authorization_id" , "amount_capturable" , "reversal_transaction_id" , "linked_invoices" , "linked_credit_notes" , "linked_refunds" , "linked_payments" , "deleted" , "iin" , "last4" , "merchant_reference_id" , "business_entity_id" , "payment_method_details" , "error_detail" , "custom_payment_method_name" , "network_transaction_details" ]; /** * dynamic properties for resources @@ -330,6 +336,7 @@ private function __construct( ?string $payment_method_details, ?GatewayErrorDetail $error_detail, ?string $custom_payment_method_name, + ?NetworkTransactionDetail $network_transaction_details, ?\Chargebee\Enums\PaymentMethod $payment_method, ?\Chargebee\Enums\Gateway $gateway, ?\Chargebee\Resources\Transaction\Enums\Type $type, @@ -377,7 +384,8 @@ private function __construct( $this->business_entity_id = $business_entity_id; $this->payment_method_details = $payment_method_details; $this->error_detail = $error_detail; - $this->custom_payment_method_name = $custom_payment_method_name; + $this->custom_payment_method_name = $custom_payment_method_name; + $this->network_transaction_details = $network_transaction_details; $this->payment_method = $payment_method; $this->gateway = $gateway; $this->type = $type; @@ -444,6 +452,7 @@ public static function from(array $resourceAttributes): self $resourceAttributes['payment_method_details'] ?? null, isset($resourceAttributes['error_detail']) ? GatewayErrorDetail::from($resourceAttributes['error_detail']) : null, $resourceAttributes['custom_payment_method_name'] ?? null, + isset($resourceAttributes['network_transaction_details']) ? NetworkTransactionDetail::from($resourceAttributes['network_transaction_details']) : null, isset($resourceAttributes['payment_method']) ? \Chargebee\Enums\PaymentMethod::tryFromValue($resourceAttributes['payment_method']) : null, @@ -508,6 +517,7 @@ public function toArray(): array 'custom_payment_method_name' => $this->custom_payment_method_name, + 'payment_method' => $this->payment_method?->value, 'gateway' => $this->gateway?->value, @@ -530,6 +540,9 @@ public function toArray(): array if($this->error_detail instanceof GatewayErrorDetail){ $data['error_detail'] = $this->error_detail->toArray(); } + if($this->network_transaction_details instanceof NetworkTransactionDetail){ + $data['network_transaction_details'] = $this->network_transaction_details->toArray(); + } if($this->linked_invoices !== []){ $data['linked_invoices'] = array_map( diff --git a/src/Responses/BusinessRuleResponse/ActivateRuleBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/ActivateRuleBusinessRuleResponse.php new file mode 100644 index 00000000..87e78310 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/ActivateRuleBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/ApplyRulesBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/ApplyRulesBusinessRuleResponse.php new file mode 100644 index 00000000..e771711c --- /dev/null +++ b/src/Responses/BusinessRuleResponse/ApplyRulesBusinessRuleResponse.php @@ -0,0 +1,45 @@ +apply_rule = $apply_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['apply_rule']) ? ApplyRule::from($resourceAttributes['apply_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->apply_rule instanceof ApplyRule){ + $data['apply_rule'] = $this->apply_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/CreateBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/CreateBusinessRuleResponse.php new file mode 100644 index 00000000..6b0e2924 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/CreateBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/DeactivateRuleBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/DeactivateRuleBusinessRuleResponse.php new file mode 100644 index 00000000..338f9001 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/DeactivateRuleBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/DeleteBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/DeleteBusinessRuleResponse.php new file mode 100644 index 00000000..7cb53a55 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/DeleteBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/DeleteDraftBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/DeleteDraftBusinessRuleResponse.php new file mode 100644 index 00000000..6371f9c8 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/DeleteDraftBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/ListBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/ListBusinessRuleResponse.php new file mode 100644 index 00000000..3278eeeb --- /dev/null +++ b/src/Responses/BusinessRuleResponse/ListBusinessRuleResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListBusinessRuleResponseListObject { + return new ListBusinessRuleResponseListObject( + isset($result['business_rule']) ? BusinessRule::from($result['business_rule']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/ListBusinessRuleResponseListObject.php b/src/Responses/BusinessRuleResponse/ListBusinessRuleResponseListObject.php new file mode 100644 index 00000000..1a24b845 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/ListBusinessRuleResponseListObject.php @@ -0,0 +1,14 @@ +business_rule = $business_rule; + } +} diff --git a/src/Responses/BusinessRuleResponse/ReleaseRuleBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/ReleaseRuleBusinessRuleResponse.php new file mode 100644 index 00000000..562efdfd --- /dev/null +++ b/src/Responses/BusinessRuleResponse/ReleaseRuleBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/RetrieveBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/RetrieveBusinessRuleResponse.php new file mode 100644 index 00000000..38fd2a58 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/RetrieveBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/RetrieveDraftBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/RetrieveDraftBusinessRuleResponse.php new file mode 100644 index 00000000..eefdf1e9 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/RetrieveDraftBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRuleResponse/UpdateDraftBusinessRuleResponse.php b/src/Responses/BusinessRuleResponse/UpdateDraftBusinessRuleResponse.php new file mode 100644 index 00000000..6352a538 --- /dev/null +++ b/src/Responses/BusinessRuleResponse/UpdateDraftBusinessRuleResponse.php @@ -0,0 +1,45 @@ +business_rule = $business_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_rule']) ? BusinessRule::from($resourceAttributes['business_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_rule instanceof BusinessRule){ + $data['business_rule'] = $this->business_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/ActivateBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/ActivateBusinessRulesetResponse.php new file mode 100644 index 00000000..f5bd75a6 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/ActivateBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/AddRulesBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/AddRulesBusinessRulesetResponse.php new file mode 100644 index 00000000..cfce45d5 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/AddRulesBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/CreateBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/CreateBusinessRulesetResponse.php new file mode 100644 index 00000000..124ed4c2 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/CreateBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/DeactivateBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/DeactivateBusinessRulesetResponse.php new file mode 100644 index 00000000..5b4b1c1d --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/DeactivateBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/DeleteBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/DeleteBusinessRulesetResponse.php new file mode 100644 index 00000000..ff816e2d --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/DeleteBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/ListBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/ListBusinessRulesetResponse.php new file mode 100644 index 00000000..5990aa0f --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/ListBusinessRulesetResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListBusinessRulesetResponseListObject { + return new ListBusinessRulesetResponseListObject( + isset($result['business_ruleset']) ? BusinessRuleset::from($result['business_ruleset']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/ListBusinessRulesetResponseListObject.php b/src/Responses/BusinessRulesetResponse/ListBusinessRulesetResponseListObject.php new file mode 100644 index 00000000..f3917d89 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/ListBusinessRulesetResponseListObject.php @@ -0,0 +1,14 @@ +business_ruleset = $business_ruleset; + } +} diff --git a/src/Responses/BusinessRulesetResponse/ListRulesBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/ListRulesBusinessRulesetResponse.php new file mode 100644 index 00000000..56bca017 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/ListRulesBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset_rule = $business_ruleset_rule; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset_rule']) ? BusinessRulesetRule::from($resourceAttributes['business_ruleset_rule']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset_rule instanceof BusinessRulesetRule){ + $data['business_ruleset_rule'] = $this->business_ruleset_rule->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/RemoveRulesBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/RemoveRulesBusinessRulesetResponse.php new file mode 100644 index 00000000..6c2849b7 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/RemoveRulesBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/RetrieveBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/RetrieveBusinessRulesetResponse.php new file mode 100644 index 00000000..a2143350 --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/RetrieveBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/BusinessRulesetResponse/UpdateBusinessRulesetResponse.php b/src/Responses/BusinessRulesetResponse/UpdateBusinessRulesetResponse.php new file mode 100644 index 00000000..1f0b520d --- /dev/null +++ b/src/Responses/BusinessRulesetResponse/UpdateBusinessRulesetResponse.php @@ -0,0 +1,45 @@ +business_ruleset = $business_ruleset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['business_ruleset']) ? BusinessRuleset::from($resourceAttributes['business_ruleset']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->business_ruleset instanceof BusinessRuleset){ + $data['business_ruleset'] = $this->business_ruleset->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CreditNoteResponse/SendEmailCreditNoteResponse.php b/src/Responses/CreditNoteResponse/SendEmailCreditNoteResponse.php new file mode 100644 index 00000000..46054e18 --- /dev/null +++ b/src/Responses/CreditNoteResponse/SendEmailCreditNoteResponse.php @@ -0,0 +1,50 @@ + $email_logs + */ + public ?array $email_logs; + + + private function __construct( + ?array $email_logs, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->email_logs = $email_logs; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $email_logs = array_map(fn (array $result): EmailLog => EmailLog::from( + $result + ), $resourceAttributes['email_logs'] ?? []); + + return new self($email_logs, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + + if($this->email_logs !== []) { + $data['email_logs'] = array_map( + fn (EmailLog $email_logs): array => $email_logs->toArray(), + $this->email_logs + ); + } + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/CustomerResponse/SendPaymentRequestCustomerResponse.php b/src/Responses/CustomerResponse/SendPaymentRequestCustomerResponse.php new file mode 100644 index 00000000..3c8b0515 --- /dev/null +++ b/src/Responses/CustomerResponse/SendPaymentRequestCustomerResponse.php @@ -0,0 +1,50 @@ + $email_logs + */ + public ?array $email_logs; + + + private function __construct( + ?array $email_logs, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->email_logs = $email_logs; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $email_logs = array_map(fn (array $result): EmailLog => EmailLog::from( + $result + ), $resourceAttributes['email_logs'] ?? []); + + return new self($email_logs, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + + if($this->email_logs !== []) { + $data['email_logs'] = array_map( + fn (EmailLog $email_logs): array => $email_logs->toArray(), + $this->email_logs + ); + } + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DisputeResponse/ListDisputeResponse.php b/src/Responses/DisputeResponse/ListDisputeResponse.php new file mode 100644 index 00000000..2fad73f9 --- /dev/null +++ b/src/Responses/DisputeResponse/ListDisputeResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListDisputeResponseListObject { + return new ListDisputeResponseListObject( + isset($result['dispute']) ? Dispute::from($result['dispute']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/DisputeResponse/ListDisputeResponseListObject.php b/src/Responses/DisputeResponse/ListDisputeResponseListObject.php new file mode 100644 index 00000000..4509719f --- /dev/null +++ b/src/Responses/DisputeResponse/ListDisputeResponseListObject.php @@ -0,0 +1,14 @@ +dispute = $dispute; + } +} diff --git a/src/Responses/DisputeResponse/RetrieveDisputeResponse.php b/src/Responses/DisputeResponse/RetrieveDisputeResponse.php new file mode 100644 index 00000000..c818e3ac --- /dev/null +++ b/src/Responses/DisputeResponse/RetrieveDisputeResponse.php @@ -0,0 +1,45 @@ +dispute = $dispute; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['dispute']) ? Dispute::from($resourceAttributes['dispute']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->dispute instanceof Dispute){ + $data['dispute'] = $this->dispute->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/EinvoiceResponse/ListEinvoicesEinvoiceResponse.php b/src/Responses/EinvoiceResponse/ListEinvoicesEinvoiceResponse.php new file mode 100644 index 00000000..0b692e90 --- /dev/null +++ b/src/Responses/EinvoiceResponse/ListEinvoicesEinvoiceResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListEinvoicesEinvoiceResponseListObject { + return new ListEinvoicesEinvoiceResponseListObject( + isset($result['einvoice']) ? Einvoice::from($result['einvoice']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/EinvoiceResponse/ListEinvoicesEinvoiceResponseListObject.php b/src/Responses/EinvoiceResponse/ListEinvoicesEinvoiceResponseListObject.php new file mode 100644 index 00000000..d20bfcde --- /dev/null +++ b/src/Responses/EinvoiceResponse/ListEinvoicesEinvoiceResponseListObject.php @@ -0,0 +1,14 @@ +einvoice = $einvoice; + } +} diff --git a/src/Responses/EinvoiceResponse/RetrieveEinvoiceResponse.php b/src/Responses/EinvoiceResponse/RetrieveEinvoiceResponse.php new file mode 100644 index 00000000..4e6314eb --- /dev/null +++ b/src/Responses/EinvoiceResponse/RetrieveEinvoiceResponse.php @@ -0,0 +1,45 @@ +einvoice = $einvoice; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + return new self( + isset($resourceAttributes['einvoice']) ? Einvoice::from($resourceAttributes['einvoice']) : null, + $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + if($this->einvoice instanceof Einvoice){ + $data['einvoice'] = $this->einvoice->toArray(); + } + + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/EmailLogResponse/EmailLogsForCustomerEmailLogResponse.php b/src/Responses/EmailLogResponse/EmailLogsForCustomerEmailLogResponse.php new file mode 100644 index 00000000..00985fa7 --- /dev/null +++ b/src/Responses/EmailLogResponse/EmailLogsForCustomerEmailLogResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): EmailLogsForCustomerEmailLogResponseListObject { + return new EmailLogsForCustomerEmailLogResponseListObject( + isset($result['email_log']) ? EmailLog::from($result['email_log']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/EmailLogResponse/EmailLogsForCustomerEmailLogResponseListObject.php b/src/Responses/EmailLogResponse/EmailLogsForCustomerEmailLogResponseListObject.php new file mode 100644 index 00000000..72c79310 --- /dev/null +++ b/src/Responses/EmailLogResponse/EmailLogsForCustomerEmailLogResponseListObject.php @@ -0,0 +1,14 @@ +email_log = $email_log; + } +} diff --git a/src/Responses/InvoiceResponse/SendEmailInvoiceResponse.php b/src/Responses/InvoiceResponse/SendEmailInvoiceResponse.php new file mode 100644 index 00000000..efbd3109 --- /dev/null +++ b/src/Responses/InvoiceResponse/SendEmailInvoiceResponse.php @@ -0,0 +1,50 @@ + $email_logs + */ + public ?array $email_logs; + + + private function __construct( + ?array $email_logs, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->email_logs = $email_logs; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $email_logs = array_map(fn (array $result): EmailLog => EmailLog::from( + $result + ), $resourceAttributes['email_logs'] ?? []); + + return new self($email_logs, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + ]); + + + if($this->email_logs !== []) { + $data['email_logs'] = array_map( + fn (EmailLog $email_logs): array => $email_logs->toArray(), + $this->email_logs + ); + } + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php index 4cdfbaed..182bb554 100644 --- a/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php +++ b/src/Responses/LedgerOperationResponse/AuthorizeLedgerOperationResponse.php @@ -15,6 +15,12 @@ class AuthorizeLedgerOperationResponse extends ResponseBase { */ public ?LedgerOperation $ledger_operation; + /** + * + * @var ?array $ledger_operations + */ + public ?array $ledger_operations; + /** * * @var ?LedgerAccountBalance $ledger_account_balance @@ -36,6 +42,7 @@ class AuthorizeLedgerOperationResponse extends ResponseBase { private function __construct( ?LedgerOperation $ledger_operation, + ?array $ledger_operations, ?LedgerAccountBalance $ledger_account_balance, ?array $grant_blocks, ?array $ledger_entries, @@ -45,6 +52,7 @@ private function __construct( { parent::__construct($responseHeaders, $rawResponse); $this->ledger_operation = $ledger_operation; + $this->ledger_operations = $ledger_operations; $this->ledger_account_balance = $ledger_account_balance; $this->grant_blocks = $grant_blocks; $this->ledger_entries = $ledger_entries; @@ -52,6 +60,10 @@ private function __construct( } public static function from(array $resourceAttributes, array $headers = []): self { + $ledger_operations = array_map(fn (array $result): LedgerOperation => LedgerOperation::from( + $result + ), $resourceAttributes['ledger_operations'] ?? []); + $grant_blocks = array_map(fn (array $result): GrantBlock => GrantBlock::from( $result ), $resourceAttributes['grant_blocks'] ?? []); @@ -62,23 +74,29 @@ public static function from(array $resourceAttributes, array $headers = []): sel return new self( isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, - + $ledger_operations, isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, $grant_blocks,$ledger_entries, $headers, $resourceAttributes); } public function toArray(): array { - $data = array_filter([ + $data = array_filter([ ]); if($this->ledger_operation instanceof LedgerOperation){ $data['ledger_operation'] = $this->ledger_operation->toArray(); - } + } if($this->ledger_account_balance instanceof LedgerAccountBalance){ $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); } + if($this->ledger_operations !== []) { + $data['ledger_operations'] = array_map( + fn (LedgerOperation $ledger_operations): array => $ledger_operations->toArray(), + $this->ledger_operations + ); + } if($this->grant_blocks !== []) { $data['grant_blocks'] = array_map( fn (GrantBlock $grant_blocks): array => $grant_blocks->toArray(), diff --git a/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php index f32a3976..3dc59867 100644 --- a/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php +++ b/src/Responses/LedgerOperationResponse/CaptureAuthorizationLedgerOperationResponse.php @@ -15,6 +15,12 @@ class CaptureAuthorizationLedgerOperationResponse extends ResponseBase { */ public ?LedgerOperation $ledger_operation; + /** + * + * @var ?array $ledger_operations + */ + public ?array $ledger_operations; + /** * * @var ?LedgerAccountBalance $ledger_account_balance @@ -36,6 +42,7 @@ class CaptureAuthorizationLedgerOperationResponse extends ResponseBase { private function __construct( ?LedgerOperation $ledger_operation, + ?array $ledger_operations, ?LedgerAccountBalance $ledger_account_balance, ?array $grant_blocks, ?array $ledger_entries, @@ -45,6 +52,7 @@ private function __construct( { parent::__construct($responseHeaders, $rawResponse); $this->ledger_operation = $ledger_operation; + $this->ledger_operations = $ledger_operations; $this->ledger_account_balance = $ledger_account_balance; $this->grant_blocks = $grant_blocks; $this->ledger_entries = $ledger_entries; @@ -52,6 +60,10 @@ private function __construct( } public static function from(array $resourceAttributes, array $headers = []): self { + $ledger_operations = array_map(fn (array $result): LedgerOperation => LedgerOperation::from( + $result + ), $resourceAttributes['ledger_operations'] ?? []); + $grant_blocks = array_map(fn (array $result): GrantBlock => GrantBlock::from( $result ), $resourceAttributes['grant_blocks'] ?? []); @@ -62,23 +74,29 @@ public static function from(array $resourceAttributes, array $headers = []): sel return new self( isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, - + $ledger_operations, isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, $grant_blocks,$ledger_entries, $headers, $resourceAttributes); } public function toArray(): array { - $data = array_filter([ + $data = array_filter([ ]); if($this->ledger_operation instanceof LedgerOperation){ $data['ledger_operation'] = $this->ledger_operation->toArray(); - } + } if($this->ledger_account_balance instanceof LedgerAccountBalance){ $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); } + if($this->ledger_operations !== []) { + $data['ledger_operations'] = array_map( + fn (LedgerOperation $ledger_operations): array => $ledger_operations->toArray(), + $this->ledger_operations + ); + } if($this->grant_blocks !== []) { $data['grant_blocks'] = array_map( fn (GrantBlock $grant_blocks): array => $grant_blocks->toArray(), diff --git a/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php index e7fc56bc..82505652 100644 --- a/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php +++ b/src/Responses/LedgerOperationResponse/CaptureLedgerOperationResponse.php @@ -15,6 +15,12 @@ class CaptureLedgerOperationResponse extends ResponseBase { */ public ?LedgerOperation $ledger_operation; + /** + * + * @var ?array $ledger_operations + */ + public ?array $ledger_operations; + /** * * @var ?LedgerAccountBalance $ledger_account_balance @@ -36,6 +42,7 @@ class CaptureLedgerOperationResponse extends ResponseBase { private function __construct( ?LedgerOperation $ledger_operation, + ?array $ledger_operations, ?LedgerAccountBalance $ledger_account_balance, ?array $grant_blocks, ?array $ledger_entries, @@ -45,6 +52,7 @@ private function __construct( { parent::__construct($responseHeaders, $rawResponse); $this->ledger_operation = $ledger_operation; + $this->ledger_operations = $ledger_operations; $this->ledger_account_balance = $ledger_account_balance; $this->grant_blocks = $grant_blocks; $this->ledger_entries = $ledger_entries; @@ -52,6 +60,10 @@ private function __construct( } public static function from(array $resourceAttributes, array $headers = []): self { + $ledger_operations = array_map(fn (array $result): LedgerOperation => LedgerOperation::from( + $result + ), $resourceAttributes['ledger_operations'] ?? []); + $grant_blocks = array_map(fn (array $result): GrantBlock => GrantBlock::from( $result ), $resourceAttributes['grant_blocks'] ?? []); @@ -62,23 +74,29 @@ public static function from(array $resourceAttributes, array $headers = []): sel return new self( isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, - + $ledger_operations, isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, $grant_blocks,$ledger_entries, $headers, $resourceAttributes); } public function toArray(): array { - $data = array_filter([ + $data = array_filter([ ]); if($this->ledger_operation instanceof LedgerOperation){ $data['ledger_operation'] = $this->ledger_operation->toArray(); - } + } if($this->ledger_account_balance instanceof LedgerAccountBalance){ $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); } + if($this->ledger_operations !== []) { + $data['ledger_operations'] = array_map( + fn (LedgerOperation $ledger_operations): array => $ledger_operations->toArray(), + $this->ledger_operations + ); + } if($this->grant_blocks !== []) { $data['grant_blocks'] = array_map( fn (GrantBlock $grant_blocks): array => $grant_blocks->toArray(), diff --git a/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php b/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php index e173ea18..f6e687ba 100644 --- a/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php +++ b/src/Responses/LedgerOperationResponse/ReleaseAuthorizationLedgerOperationResponse.php @@ -15,6 +15,12 @@ class ReleaseAuthorizationLedgerOperationResponse extends ResponseBase { */ public ?LedgerOperation $ledger_operation; + /** + * + * @var ?array $ledger_operations + */ + public ?array $ledger_operations; + /** * * @var ?LedgerAccountBalance $ledger_account_balance @@ -36,6 +42,7 @@ class ReleaseAuthorizationLedgerOperationResponse extends ResponseBase { private function __construct( ?LedgerOperation $ledger_operation, + ?array $ledger_operations, ?LedgerAccountBalance $ledger_account_balance, ?array $grant_blocks, ?array $ledger_entries, @@ -45,6 +52,7 @@ private function __construct( { parent::__construct($responseHeaders, $rawResponse); $this->ledger_operation = $ledger_operation; + $this->ledger_operations = $ledger_operations; $this->ledger_account_balance = $ledger_account_balance; $this->grant_blocks = $grant_blocks; $this->ledger_entries = $ledger_entries; @@ -52,6 +60,10 @@ private function __construct( } public static function from(array $resourceAttributes, array $headers = []): self { + $ledger_operations = array_map(fn (array $result): LedgerOperation => LedgerOperation::from( + $result + ), $resourceAttributes['ledger_operations'] ?? []); + $grant_blocks = array_map(fn (array $result): GrantBlock => GrantBlock::from( $result ), $resourceAttributes['grant_blocks'] ?? []); @@ -62,23 +74,29 @@ public static function from(array $resourceAttributes, array $headers = []): sel return new self( isset($resourceAttributes['ledger_operation']) ? LedgerOperation::from($resourceAttributes['ledger_operation']) : null, - + $ledger_operations, isset($resourceAttributes['ledger_account_balance']) ? LedgerAccountBalance::from($resourceAttributes['ledger_account_balance']) : null, $grant_blocks,$ledger_entries, $headers, $resourceAttributes); } public function toArray(): array { - $data = array_filter([ + $data = array_filter([ ]); if($this->ledger_operation instanceof LedgerOperation){ $data['ledger_operation'] = $this->ledger_operation->toArray(); - } + } if($this->ledger_account_balance instanceof LedgerAccountBalance){ $data['ledger_account_balance'] = $this->ledger_account_balance->toArray(); } + if($this->ledger_operations !== []) { + $data['ledger_operations'] = array_map( + fn (LedgerOperation $ledger_operations): array => $ledger_operations->toArray(), + $this->ledger_operations + ); + } if($this->grant_blocks !== []) { $data['grant_blocks'] = array_map( fn (GrantBlock $grant_blocks): array => $grant_blocks->toArray(), diff --git a/src/Responses/PaymentScheduleResponse/ListPaymentScheduleResponse.php b/src/Responses/PaymentScheduleResponse/ListPaymentScheduleResponse.php new file mode 100644 index 00000000..16416505 --- /dev/null +++ b/src/Responses/PaymentScheduleResponse/ListPaymentScheduleResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListPaymentScheduleResponseListObject { + return new ListPaymentScheduleResponseListObject( + isset($result['payment_schedule']) ? PaymentSchedule::from($result['payment_schedule']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PaymentScheduleResponse/ListPaymentScheduleResponseListObject.php b/src/Responses/PaymentScheduleResponse/ListPaymentScheduleResponseListObject.php new file mode 100644 index 00000000..f108576f --- /dev/null +++ b/src/Responses/PaymentScheduleResponse/ListPaymentScheduleResponseListObject.php @@ -0,0 +1,14 @@ +payment_schedule = $payment_schedule; + } +} diff --git a/src/Responses/PaymentScheduleSchemeResponse/ListPaymentScheduleSchemeResponse.php b/src/Responses/PaymentScheduleSchemeResponse/ListPaymentScheduleSchemeResponse.php new file mode 100644 index 00000000..4de6c182 --- /dev/null +++ b/src/Responses/PaymentScheduleSchemeResponse/ListPaymentScheduleSchemeResponse.php @@ -0,0 +1,54 @@ + $list + */ + public array $list; + + /** + * + * @var ?string $next_offset + */ + public ?string $next_offset; + + + private function __construct( + array $list, + ?string $next_offset, + array $responseHeaders=[], + array $rawResponse=[] + ) + { + parent::__construct($responseHeaders, $rawResponse); + $this->list = $list; + $this->next_offset = $next_offset; + + } + public static function from(array $resourceAttributes, array $headers = []): self + { + $list = array_map(function (array $result): ListPaymentScheduleSchemeResponseListObject { + return new ListPaymentScheduleSchemeResponseListObject( + isset($result['payment_schedule_scheme']) ? PaymentScheduleScheme::from($result['payment_schedule_scheme']) : null, + );}, $resourceAttributes['list'] ?? []); + + return new self($list, + $resourceAttributes['next_offset'] ?? null, $headers, $resourceAttributes); + } + + public function toArray(): array + { + $data = array_filter([ + 'list' => $this->list, + 'next_offset' => $this->next_offset, + ]); + return $data; + } +} +?> \ No newline at end of file diff --git a/src/Responses/PaymentScheduleSchemeResponse/ListPaymentScheduleSchemeResponseListObject.php b/src/Responses/PaymentScheduleSchemeResponse/ListPaymentScheduleSchemeResponseListObject.php new file mode 100644 index 00000000..020ddb2c --- /dev/null +++ b/src/Responses/PaymentScheduleSchemeResponse/ListPaymentScheduleSchemeResponseListObject.php @@ -0,0 +1,14 @@ +payment_schedule_scheme = $payment_schedule_scheme; + } +} diff --git a/src/Version.php b/src/Version.php index fa9c78f3..523dd102 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,7 +4,7 @@ final class Version { - const VERSION = '4.26.0'; + const VERSION = '4.27.0'; } ?> \ No newline at end of file