מסמך לכל רכישה שהושלמה ב-EDD (גרסאות 2.x ו-3.x), וחשבונית זיכוי לכל החזר.
התקנה (5 דקות)#
- התקינו את התוסף לפי ההוראות הכלליות והדביקו את מפתח ה-API בלשונית חיבור.
- פתחו את הלשונית Easy Digital Downloads.
- סמנו הפעלת האינטגרציה, בחרו סוג מסמך (ברירת מחדל: חשבונית מס קבלה) ושמרו.
- אם החנות לא מחשבת מס, בחרו ב-מע"מ כשהמקור לא מדווח מס אם המחיר כולל מע"מ או פטור.
- בצעו רכישת בדיקה. המסמך מופק בסיום הרכישה, ובשורות שלו פריטי העגלה, העמלות וההנחות.
החזר ב-EDD (מלא או חלקי) מפיק חשבונית זיכוי שמפנה למסמך המקורי. אם המסמך המקורי לא הופק, הזיכוי מדולג ונרשם ביומן.
Developer reference#
| Item | Value |
|---|---|
| Plugin class | includes/integrations/class-slk-integration-edd.php |
| Host guard | class_exists('Easy_Digital_Downloads') || function_exists('EDD') |
| Issue hook | edd_complete_purchase( $order_id, $payment, $customer ) — https://github.com/awesomemotive/easy-digital-downloads/blob/main/includes/payments/actions.php |
| Refund hooks | edd_refund_order( $order_id, $refund_id, $all_refunded ) (https://easydigitaldownloads.com/development/2021/05/20/edd-3-0-beta2/) and edd_post_refund_order (same arguments; a re-fire is harmless) |
| Data (3.x) | edd_get_order(), order items and fee adjustments (https://easydigitaldownloads.com/docs/database-table-structures/); 2.x: EDD_Payment::cart_details and fees |
| apiIdentifier | edd-<host>-<payment id>; credit note edd-<host>-<payment id>-refund-<refund id> |
| Idempotency | option slk_invoices_issued_edd, keyed by payment id (and <id>|refund:<refund id>) |
Mapping: each order item becomes a line (quantityMilli, net unit price = (subtotal − discount) / quantity,
per-line vatBp from the item's tax when the store charges tax); each fee becomes a line. The payment
row is the computed document total, payment type from the EDD gateway id (paypal* 10, stripe 1,
manual cash, default card). When EDD reports no tax the tab's VAT mode decides: included
(taxIncluded: true, default rate) or exempt (vatBp: 0).
Credit note: docType: 4, referenceDocIds: [<original document id>], one line "זיכוי" for the refund
amount, following the original document's VAT mode.
Troubleshooting#
- אין מסמך אחרי רכישה: ודאו שהאינטגרציה מסומנת, ושהרכישה הגיעה לסטטוס Complete (לא Pending).
- ביומן "סכום הרכישה אפס": רכישה חינמית לא מפיקה מסמך.
- ביומן "לא נמצא מסמך מקור": החזר על רכישה שהופקה לפני שהאינטגרציה הופעלה לא מזוכה אוטומטית. הפיקו זיכוי ידני ב-SLK Invoices.
- כשל 401/403: ראו פתרון תקלות כלליות.