Skip to content

Commit f22fc7a

Browse files
authored
Merge branch 'master' into issue-13809
2 parents 115031f + 7432e03 commit f22fc7a

File tree

83 files changed

+4454
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4454
-51
lines changed

components/adyen/adyen.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/autoblogger/autoblogger.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import chargify from "../../chargify.app.mjs";
2+
3+
export default {
4+
key: "chargify-create-customer",
5+
name: "Create Customer",
6+
description: "Creates a new customer in Chargify. [See the documentation](https://developers.maxio.com/http/advanced-billing-api/api-endpoints/customers/create-customer)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
chargify,
11+
firstName: {
12+
type: "string",
13+
label: "First Name",
14+
description: "The first name of the customer",
15+
},
16+
lastName: {
17+
type: "string",
18+
label: "Last Name",
19+
description: "The last name of the customer",
20+
},
21+
email: {
22+
type: "string",
23+
label: "Email",
24+
description: "The email of the customer",
25+
},
26+
organization: {
27+
type: "string",
28+
label: "Organization",
29+
description: "The organization of the customer",
30+
optional: true,
31+
},
32+
address: {
33+
type: "string",
34+
label: "Street Address",
35+
description: "Street address of the customer (line 1)",
36+
optional: true,
37+
},
38+
address2: {
39+
type: "string",
40+
label: "Street Address (line 2)",
41+
description: "Street address of the customer (line 2)",
42+
optional: true,
43+
},
44+
city: {
45+
type: "string",
46+
label: "City",
47+
description: "City of the customer",
48+
optional: true,
49+
},
50+
state: {
51+
type: "string",
52+
label: "State",
53+
description: "State/Region of the customer",
54+
optional: true,
55+
},
56+
zip: {
57+
type: "string",
58+
label: "Zip",
59+
description: "Zip code of the customer",
60+
optional: true,
61+
},
62+
country: {
63+
type: "string",
64+
label: "Country",
65+
description: "The country code of the customer. Example: `US`",
66+
optional: true,
67+
},
68+
phone: {
69+
type: "string",
70+
label: "Phone",
71+
description: "Phone number of the customer",
72+
optional: true,
73+
},
74+
taxExempt: {
75+
type: "boolean",
76+
label: "Tax Exempt",
77+
description: "Set to `true` if the customer is tax exempt.",
78+
optional: true,
79+
},
80+
},
81+
async run({ $ }) {
82+
const { customer } = await this.chargify.createCustomer({
83+
$,
84+
data: {
85+
customer: {
86+
first_name: this.firstName,
87+
last_name: this.lastName,
88+
email: this.email,
89+
organization: this.organization,
90+
address: this.address,
91+
address_2: this.address2,
92+
city: this.city,
93+
state: this.state,
94+
zip: this.zip,
95+
country: this.country,
96+
phone: this.phone,
97+
tax_exempt: this.taxExempt,
98+
},
99+
},
100+
});
101+
$.export("$summary", `Successfully created customer with ID ${customer.id}`);
102+
return customer;
103+
},
104+
};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import chargify from "../../chargify.app.mjs";
2+
3+
export default {
4+
key: "chargify-create-subscription",
5+
name: "Create Subscription",
6+
description: "Establishes a new subscription for a given customer in Chargify. [See the documentation](https://developers.maxio.com/http/advanced-billing-api/api-endpoints/subscriptions/create-subscription)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
chargify,
11+
customerId: {
12+
propDefinition: [
13+
chargify,
14+
"customerId",
15+
],
16+
},
17+
productId: {
18+
propDefinition: [
19+
chargify,
20+
"productId",
21+
],
22+
},
23+
couponCode: {
24+
propDefinition: [
25+
chargify,
26+
"couponCode",
27+
],
28+
},
29+
nextBillingAt: {
30+
propDefinition: [
31+
chargify,
32+
"nextBillingAt",
33+
],
34+
},
35+
paymentCollectionMethod: {
36+
propDefinition: [
37+
chargify,
38+
"paymentCollectionMethod",
39+
],
40+
},
41+
},
42+
async run({ $ }) {
43+
const response = await this.chargify.createSubscription({
44+
$,
45+
data: {
46+
subscription: {
47+
customer_id: this.customerId,
48+
product_id: this.productId,
49+
coupon_code: this.couponCode,
50+
next_billing_at: this.nextBillingAt,
51+
payment_collection_method: this.paymentCollectionMethod,
52+
},
53+
},
54+
});
55+
$.export("$summary", `Successfully created subscription with ID: ${response.subscription.id}`);
56+
return response;
57+
},
58+
};
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import chargify from "../../chargify.app.mjs";
2+
3+
export default {
4+
key: "chargify-update-subscription",
5+
name: "Update Subscription",
6+
description: "Modifies an existing subscription in Chargify. [See the documentation](https://developers.maxio.com/http/advanced-billing-api/api-endpoints/subscriptions/update-subscription)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
chargify,
11+
subscriptionId: {
12+
propDefinition: [
13+
chargify,
14+
"subscriptionId",
15+
],
16+
},
17+
productId: {
18+
propDefinition: [
19+
chargify,
20+
"productId",
21+
],
22+
optional: true,
23+
},
24+
couponCode: {
25+
propDefinition: [
26+
chargify,
27+
"couponCode",
28+
],
29+
},
30+
nextBillingAt: {
31+
propDefinition: [
32+
chargify,
33+
"nextBillingAt",
34+
],
35+
},
36+
paymentCollectionMethod: {
37+
propDefinition: [
38+
chargify,
39+
"paymentCollectionMethod",
40+
],
41+
},
42+
},
43+
async run({ $ }) {
44+
const response = await this.chargify.updateSubscription({
45+
$,
46+
subscriptionId: this.subscriptionId,
47+
data: {
48+
subscription: {
49+
product_id: this.productId,
50+
coupon_code: this.couponCode,
51+
next_billing_at: this.nextBillingAt,
52+
payment_collection_method: this.paymentCollectionMethod,
53+
},
54+
},
55+
});
56+
$.export("$summary", `Successfully updated subscription ${this.subscriptionId}`);
57+
return response;
58+
},
59+
};

0 commit comments

Comments
 (0)