מסמך לכל תשלום מנוי, חברות או Stripe, וחשבונית זיכוי לכל החזר.
התקנה (5 דקות)#
- התקינו את התוסף לפי ההוראות הכלליות והדביקו את מפתח ה-API בלשונית חיבור.
- פתחו את הלשונית של התוסף שלכם: MemberPress, Paid Memberships Pro או WP Simple Pay.
- סמנו הפעלת האינטגרציה, בחרו סוג מסמך ושמרו.
- אם התוסף לא מדווח מס, בחרו ב-מע"מ כשהמקור לא מדווח מס אם הסכום כולל מע"מ או פטור.
- בצעו תשלום בדיקה. חיובים חוזרים של מנוי מפיקים מסמך בכל חיוב.
- MemberPress: כל עסקה שהושלמה מפיקה מסמך, בשם המוצר. עסקה בסכום אפס (ניסיון חינם) לא מפיקה. החזר עסקה מפיק זיכוי.
- Paid Memberships Pro: הזמנה בסטטוס success מפיקה מסמך בשם רמת החברות. הזמנה שהוחזרה מפיקה זיכוי.
- WP Simple Pay: כל תשלום Stripe שהצליח (חד-פעמי, Checkout ומנוי) מפיק מסמך בשם הטופס. ב-Simple Pay אין זיכוי אוטומטי.
Developer reference#
| Integration | Hooks | Source |
|---|---|---|
| MemberPress | mepr-event-transaction-completed( $event ), mepr-event-transaction-refunded( $event ); $event->get_data() is a MeprTransaction (id, user_id, product_id, amount, total, tax_amount, trans_num, gateway) | https://memberpress.com/docs/action-hooks-in-memberpress/ |
| Paid Memberships Pro | pmpro_added_order( $MemberOrder ) (status must be success), pmpro_order_status_success( $order, $old_status ), pmpro_order_status_refunded( $order, $old_status ) | https://www.paidmembershipspro.com/hook/pmpro_added_order/ , https://www.paidmembershipspro.com/hook/pmpro_order_status_statusname/ |
| WP Simple Pay | simpay_webhook_payment_intent_succeeded( $event, $paymentintent ), simpay_webhook_invoice_payment_succeeded( $event, $invoice, $subscription ), simpay_webhook_checkout_session_completed | https://wpsimplepay.com/doc/webhooks/ |
Plugin classes: class-slk-integration-memberpress.php, -pmpro.php, -simplepay.php.
- Amounts: MemberPress
amount(before tax) +tax_amount; PMProsubtotal+tax; when tax > 0 the line'svatBpis derived from it, otherwise the VAT mode setting applies. Simple Pay amounts are Stripe minor units (cents = agorot for ILS) with no VAT split. - apiIdentifier / idempotency key:
memberpress-<host>-<txn id>,pmpro-<host>-<order id>,simplepay-<host>-<payment_intent or invoice id>. Credit notes add-refund. - Simple Pay dedupe: payment intents that belong to an invoice are skipped (the invoice hook owns them);
a Checkout session and its payment intent share the intent id, so a one-time purchase issues once.
The argument list of
simpay_webhook_checkout_session_completedis not documented; the handler reads the Stripe session defensively. - Credit note:
docType: 4,referenceDocIds: [<original>], one line "זיכוי", following the original document's VAT mode.
Troubleshooting#
- MemberPress לא מפיק: ודאו שהעסקה בסטטוס Complete ושהסכום גדול מאפס.
- PMPro לא מפיק: בדקו שסטטוס ההזמנה success. הזמנה ב-pending תופק כשתאושר.
- Simple Pay לא מפיק: ודאו ש-webhook של Stripe מוגדר ב-WP Simple Pay ופעיל. בלי webhook התוסף לא מקבל אירוע.
- כשל 401/403: ראו פתרון תקלות כלליות.