Skip to content

Commit

Permalink
Releasing v2.22.0. Please refer changelog for the updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-khushbubibay committed Jun 30, 2023
1 parent 0ebc03a commit 3918514
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 5 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,40 @@
### v2.22.0 (2023-06-30)
* * *

#### New endpoints:
* ViewVoucher#ViewVoucherRequest has been added to the HostedPage resource.
* InvoiceListPaymentReferenceNumbers#InvoiceListPaymentReferenceNumbersRequest has been added to the Invoice resource.

#### New Resource:
* PaymentReferenceNumber has been added.

#### New attributes:
* local_currency_exchange_rate has been added to the CreditNote and Invoice resource.

#### New Enum values:
* view_voucher has been added to Type enum in HostedPage resource.
* paused has been added in StoreStatus enum in InAppSubscription resource.
* metrics_global and windcave has been added in Gateway enum.


#### New Input parameters:
* payment_initiator has been added to Customers#CollectPaymentRequest.
* payment_initiator has been added to Invoice#CreateRequest.
* payment_initiator has been added to Invoice#ChargeRequest.
* payment_initiator has been added to Invoice#ChargeAddonRequest.
* payment_initiator has been added to Invoice#CollectPaymentRequest.
* payment_initiator has been added to Subscription#CreateRequest.
* payment_initiator has been added to Invoice#CreateForChargeItemRequest.
* payment_initiator has been added to Subscription#CreateForCustomerRequest.
* payment_initiator has been added to Subscription#CreateWithItemsRequest.
* payment_initiator has been added to Subscription#UpdateForItemsRequest.
* payment_initiator has been added to Subscription#ReactivateRequest.
* payment_initiator has been added to Subscription#ResumeRequest.
* payment_reference_numbers[id] has been added to Invoice#ImportInvoiceRequest.
* payment_reference_numbers[type] has been added to Invoice#ImportInvoiceRequest.
* payment_reference_numbers[number] has been added to Invoice#ImportInvoiceRequest.


### v2.21.0 (2023-05-31)
* * *

Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,7 +1,7 @@
# Chargebee Typescript Client Library - API V2

[![npm](https://img.shields.io/npm/v/chargebee-typescript.svg?maxAge=25920000)](https://www.npmjs.com/package/chargebee-typescript)
[![npm](https://img.shields.io/npm/dt/chargebee-typescript.svg?maxAge=25920000)](https://www.npmjs.com/package/chargebee-typescript)
[![npm](https://img.shields.io/npm/v/chargebee-typescript.svg?maxAge=2)](https://www.npmjs.com/package/chargebee-typescript)
[![npm](https://img.shields.io/npm/dt/chargebee-typescript.svg?maxAge=2)](https://www.npmjs.com/package/chargebee-typescript)

This is a server-side [typescript](https://www.typescriptlang.org/) library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com).

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "chargebee-typescript",
"version": "2.21.0",
"version": "2.22.0",
"description": "A library in typescript for integrating with Chargebee.",
"keywords": [
"payments",
Expand Down
4 changes: 4 additions & 0 deletions src/chargebee.ts
Expand Up @@ -14,6 +14,7 @@ export {_virtual_bank_account} from "./resources/virtual_bank_account";
export {_card} from "./resources/card";
export {_promotional_credit} from "./resources/promotional_credit";
export {_invoice} from "./resources/invoice";
export {_payment_reference_number} from "./resources/payment_reference_number";
export {_tax_withheld} from "./resources/tax_withheld";
export {_credit_note} from "./resources/credit_note";
export {_unbilled_charge} from "./resources/unbilled_charge";
Expand Down Expand Up @@ -116,6 +117,9 @@ export class ChargeBee {
get invoice() {
return resources.Invoice;
}
get payment_reference_number() {
return resources.PaymentReferenceNumber;
}
get tax_withheld() {
return resources.TaxWithheld;
}
Expand Down
2 changes: 1 addition & 1 deletion src/environment.ts
Expand Up @@ -3,7 +3,7 @@ let environment = {
hostSuffix: '.chargebee.com',
apiPath: '/api/v2',
timeout: 80000,
clientVersion: 'v2.21.0',
clientVersion: 'v2.22.0',
port: 443,
timemachineWaitInMillis: 3000,
exportWaitInMillis: 3000
Expand Down
3 changes: 2 additions & 1 deletion src/resources/credit_note.ts
Expand Up @@ -43,6 +43,7 @@ export class CreditNote extends Model {
public linked_refunds?: Array<LinkedRefund>;
public allocations?: Array<Allocation>;
public deleted: boolean;
public local_currency_exchange_rate?: number;
public create_reason_code?: string;
public vat_number_prefix?: string;
public business_entity_id: string;
Expand Down Expand Up @@ -417,7 +418,7 @@ export namespace _credit_note {
type: string;
currency_code?: string;
create_reason_code: string;
date?: number;
date: number;
status?: string;
total?: number;
refunded_at?: number;
Expand Down
1 change: 1 addition & 0 deletions src/resources/customer.ts
Expand Up @@ -596,6 +596,7 @@ export namespace _customer {
token_id?: string;
replace_primary_payment_source?: boolean;
retain_payment_source?: boolean;
payment_initiator?: string;
payment_method?: payment_method_collect_payment_params;
card?: card_collect_payment_params;
payment_intent?: payment_intent_collect_payment_params;
Expand Down
21 changes: 21 additions & 0 deletions src/resources/hosted_page.ts
Expand Up @@ -256,6 +256,17 @@ export class HostedPage extends Model {
}, ChargeBee._env)
}

public static view_voucher(params?: _hosted_page.view_voucher_params):RequestWrapper {
return new RequestWrapper([params], {
'methodName': 'view_voucher',
'httpMethod': 'POST',
'urlPrefix': '/hosted_pages',
'urlSuffix': '/view_voucher',
'hasIdInUrl': false,
'isListReq': false,
}, ChargeBee._env)
}

} // ~HostedPage


Expand Down Expand Up @@ -481,6 +492,10 @@ export namespace _hosted_page {
occurred_at?: number;
event_data: any;
}
export interface view_voucher_params {
payment_voucher?: payment_voucher_view_voucher_params;
customer?: customer_view_voucher_params;
}
export interface subscription_checkout_new_params {
id?: string;
}
Expand Down Expand Up @@ -1822,4 +1837,10 @@ export namespace _hosted_page {
export interface subscription_pre_cancel_params {
id: string;
}
export interface payment_voucher_view_voucher_params {
id: string;
}
export interface customer_view_voucher_params {
locale?: string;
}
}
1 change: 1 addition & 0 deletions src/resources/index.ts
Expand Up @@ -59,6 +59,7 @@ export {Note as InvoiceNote} from "./invoice";
export {ShippingAddress as InvoiceShippingAddress} from "./invoice";
export {BillingAddress as InvoiceBillingAddress} from "./invoice";
export {Einvoice as InvoiceEinvoice} from "./invoice";
export {PaymentReferenceNumber} from "./payment_reference_number";
export {TaxWithheld} from "./tax_withheld";
export {CreditNote} from "./credit_note";
export {Einvoice as CreditNoteEinvoice} from "./credit_note";
Expand Down
36 changes: 36 additions & 0 deletions src/resources/invoice.ts
Expand Up @@ -36,6 +36,7 @@ export class Invoice extends Model {
public total_in_local_currency?: number;
public local_currency_code?: string;
public tax: number;
public local_currency_exchange_rate?: number;
public first_invoice?: boolean;
public new_sales_amount?: number;
public has_advance_charges?: boolean;
Expand Down Expand Up @@ -260,6 +261,17 @@ export class Invoice extends Model {
}, ChargeBee._env)
}

public static list_payment_reference_numbers(params?: _invoice.invoice_list_payment_reference_numbers_params):RequestWrapper<ListResult> {
return new RequestWrapper([params], {
'methodName': 'list_payment_reference_numbers',
'httpMethod': 'GET',
'urlPrefix': '/invoices',
'urlSuffix': '/payment_reference_numbers',
'hasIdInUrl': false,
'isListReq': true,
}, ChargeBee._env)
}

public static add_charge(invoice_id: string, params?: _invoice.add_charge_params):RequestWrapper {
return new RequestWrapper([invoice_id, params], {
'methodName': 'add_charge',
Expand Down Expand Up @@ -665,6 +677,7 @@ export namespace _invoice {
token_id?: string;
replace_primary_payment_source?: boolean;
retain_payment_source?: boolean;
payment_initiator?: string;
shipping_address?: shipping_address_create_params;
card?: card_create_params;
bank_account?: bank_account_create_params;
Expand Down Expand Up @@ -724,6 +737,7 @@ export namespace _invoice {
po_number?: string;
invoice_date?: number;
payment_source_id?: string;
payment_initiator?: string;
}
export interface charge_addon_params {
customer_id?: string;
Expand All @@ -743,13 +757,15 @@ export namespace _invoice {
po_number?: string;
invoice_date?: number;
payment_source_id?: string;
payment_initiator?: string;
}
export interface create_for_charge_item_params {
customer_id?: string;
subscription_id?: string;
po_number?: string;
coupon?: string;
payment_source_id?: string;
payment_initiator?: string;
invoice_date?: number;
item_price?: item_price_create_for_charge_item_params;
item_tiers?: Array<item_tiers_create_for_charge_item_params>;
Expand Down Expand Up @@ -784,6 +800,7 @@ export namespace _invoice {
billing_address?: billing_address_import_invoice_params;
shipping_address?: shipping_address_import_invoice_params;
line_items?: Array<line_items_import_invoice_params>;
payment_reference_numbers?: Array<payment_reference_numbers_import_invoice_params>;
line_item_tiers?: Array<line_item_tiers_import_invoice_params>;
discounts?: Array<discounts_import_invoice_params>;
taxes?: Array<taxes_import_invoice_params>;
Expand Down Expand Up @@ -835,6 +852,12 @@ export namespace _invoice {
export interface pdf_params {
disposition_type?: string;
}
export interface invoice_list_payment_reference_numbers_params {
limit?: number;
offset?: string;
id?: filter._string;
payment_reference_number?: payment_reference_number_invoice_list_payment_reference_numbers_params;
}
export interface add_charge_params {
amount: number;
description: string;
Expand Down Expand Up @@ -873,6 +896,7 @@ export namespace _invoice {
authorization_transaction_id?: string;
payment_source_id?: string;
comment?: string;
payment_initiator?: string;
}
export interface record_payment_params {
comment?: string;
Expand Down Expand Up @@ -1735,6 +1759,15 @@ export namespace _invoice {
export interface line_items_import_invoice_params {
tax10_amount?: number;
}
export interface payment_reference_numbers_import_invoice_params {
id?: string;
}
export interface payment_reference_numbers_import_invoice_params {
type: string;
}
export interface payment_reference_numbers_import_invoice_params {
number: string;
}
export interface line_item_tiers_import_invoice_params {
line_item_id: string;
}
Expand Down Expand Up @@ -1831,6 +1864,9 @@ export namespace _invoice {
export interface einvoice_invoice_list_params {
status?: filter._enum;
}
export interface payment_reference_number_invoice_list_payment_reference_numbers_params {
number?: filter._string;
}
export interface line_item_add_charge_params {
date_from?: number;
}
Expand Down
26 changes: 26 additions & 0 deletions src/resources/payment_reference_number.ts
@@ -0,0 +1,26 @@
import * as resources from ".";
import {RequestWrapper} from "../request_wrapper";
import {Model} from "./model";
import {ChargeBee} from "../chargebee";
import {filter} from "../filter";

export class PaymentReferenceNumber extends Model {
public id: string;
public type: string;
public number: string;
public invoice_id?: string;



// OPERATIONS
//-----------

} // ~PaymentReferenceNumber



// REQUEST PARAMS
//---------------

export namespace _payment_reference_number {
}
6 changes: 6 additions & 0 deletions src/resources/subscription.ts
Expand Up @@ -672,6 +672,7 @@ export namespace _subscription {
contract_term_billing_cycle_on_renewal?: number;
trial_end_action?: string;
client_profile_id?: string;
payment_initiator?: string;
customer?: customer_create_params;
card?: card_create_params;
bank_account?: bank_account_create_params;
Expand Down Expand Up @@ -718,6 +719,7 @@ export namespace _subscription {
free_period_unit?: string;
contract_term_billing_cycle_on_renewal?: number;
trial_end_action?: string;
payment_initiator?: string;
shipping_address?: shipping_address_create_for_customer_params;
payment_intent?: payment_intent_create_for_customer_params;
contract_term?: contract_term_create_for_customer_params;
Expand Down Expand Up @@ -760,6 +762,7 @@ export namespace _subscription {
auto_close_invoices?: boolean;
first_invoice_pending?: boolean;
trial_end_action?: string;
payment_initiator?: string;
shipping_address?: shipping_address_create_with_items_params;
payment_intent?: payment_intent_create_with_items_params;
contract_term?: contract_term_create_with_items_params;
Expand Down Expand Up @@ -891,6 +894,7 @@ export namespace _subscription {
create_pending_invoices?: boolean;
auto_close_invoices?: boolean;
trial_end_action?: string;
payment_initiator?: string;
card?: card_update_for_items_params;
payment_method?: payment_method_update_for_items_params;
payment_intent?: payment_intent_update_for_items_params;
Expand Down Expand Up @@ -920,6 +924,7 @@ export namespace _subscription {
terms_to_charge?: number;
invoice_date?: number;
contract_term_billing_cycle_on_renewal?: number;
payment_initiator?: string;
contract_term?: contract_term_reactivate_params;
payment_intent?: payment_intent_reactivate_params;
}
Expand Down Expand Up @@ -1126,6 +1131,7 @@ export namespace _subscription {
resume_date?: number;
charges_handling?: string;
unpaid_invoices_handling?: string;
payment_initiator?: string;
payment_intent?: payment_intent_resume_params;
}
export interface customer_create_params {
Expand Down
7 changes: 7 additions & 0 deletions src/result.ts
Expand Up @@ -109,6 +109,13 @@ export class Result {
);
return _invoice;
}
get payment_reference_number(): resources.PaymentReferenceNumber {
let _payment_reference_number = this.get(
'payment_reference_number',
'PaymentReferenceNumber'
);
return _payment_reference_number;
}
get tax_withheld(): resources.TaxWithheld {
let _tax_withheld = this.get(
'tax_withheld',
Expand Down

0 comments on commit 3918514

Please sign in to comment.