Search...
onOrderResumed( )
Developer Preview
Triggered when a paused order is resumed.
Syntax
function wixPricingPlans_onOrderResumed(event: OrderResumedEvent): void
onOrderResumed Parameters
NAME
TYPE
DESCRIPTION
event
Optional
OrderResumedEvent
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
onOrderResumed example
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.3// Add the file if it doesn't exist.45export function wixPricingPlans_onOrderResumed(event) {6 const orderId = event.data.order._id;7 const planId = event.data.planId;8 const eventTime = event.metadata.eventTime;910 console.log(`Order ID ${orderId} was resumed for plan ID ${planId} at ${eventTime}. Full event object:`, event);11}1213/* Full event object:14 * {15 * "data": {16 * "order": {17 * "_createdDate": "2024-02-11T09:11:13.012Z",18 * "_id": "3feb1cf5-bf38-47c4-81cb-06b61ca11c8a",19 * "_updatedDate": "2024-02-11T09:14:57.750Z",20 * "buyer": {21 * "contactId": "3fc889f6-18e8-4fd9-a509-27db9f037f26",22 * "memberId": "3fc889f6-18e8-4fd9-a509-27db9f037f26"23 * },24 * "currentCycle": {25 * "index": 1,26 * "startedDate": "2024-02-11T09:11:13.012Z"27 * },28 * "cycles": [29 * {30 * "index": 1,31 * "startedDate": "2024-02-11T09:11:13.012Z"32 * }33 * ],34 * "formData": {35 * "submissionData": {}36 * },37 * "lastPaymentStatus": "PAID",38 * "orderMethod": "UNKNOWN",39 * "pausePeriods": [40 * {41 * "pauseDate": "2024-02-11T09:14:57.750Z",42 * "resumeDate": "2024-02-11T09:28:13.186Z",43 * "status": "ENDED"44 * }45 * ],46 * "planDescription": "Full feature enablement - lifetime plan",47 * "planId": "e901222b-c137-4bc7-adc3-c1efa3c880a2",48 * "planName": "Quality Plan - Lifetime",49 * "planPrice": "1500",50 * "priceDetails": {51 * "coupon": {52 * "_id": "07de4c3a-536b-4c30-adb9-991935da1681",53 * "amount": "1500.00",54 * "code": "sale-day"55 * },56 * "currency": "USD",57 * "discount": "1500.00",58 * "planPrice": "1500",59 * "subtotal": "1500.00",60 * "tax": {61 * "amount": "0",62 * "includedInPrice": false,63 * "name": "Tax",64 * "rate": "6.5"65 * },66 * "total": "0"67 * },68 * "pricing": {69 * "prices": [70 * {71 * "duration": {72 * "cycleFrom": 1,73 * "numberOfCycles": 174 * },75 * "price": {76 * "currency": "USD",77 * "discount": "1500.00",78 * "fees": [],79 * "proration": "0",80 * "subtotal": "1500.00",81 * "tax": {82 * "amount": "0",83 * "includedInPrice": false,84 * "name": "Tax",85 * "rate": "6.5"86 * },87 * "total": "0"88 * }89 * }90 * ],91 * "singlePaymentUnlimited": true92 * },93 * "startDate": "2024-02-11T09:11:13.012Z",94 * "status": "ACTIVE",95 * "statusNew": "ACTIVE",96 * "subscriptionId": "d3290015-f808-4f08-a4a0-6732acbf2a43",97 * "type": "ONLINE",98 * "wixPayOrderId": "36a79fab-c436-4bf0-b3be-14e9f75cf263"99 * }100 * },101 * "metadata": {102 * "entityId": "3feb1cf5-bf38-47c4-81cb-06b61ca11c8a",103 * "eventTime": "2024-02-11T09:28:13.343708694Z",104 * "id": "c020a4af-1647-4301-b821-d6ee72b7a462",105 * "triggeredByAnonymizeRequest": false106 * }107 * }108 */109