PosiPay v.109

PosiPay v.109

Post Config

  • New Stripe Webhook listener:

    • Customer:

      • Customer Created → customer.created

      • Customer Updated → customer.updated

    • Payment Method:

      • Payment Method Attached → payment_method.attached

      • Payment Method Updated Automatically → payment_method.automatically_updated

      • Payment Method Updated → payment_method.updated

    • charge.dispute.funds_withdrawn

What’s New

The following are the updates and fixes that has been included in this package.

  • Canceled Gateway Invoice records will now update correctly.

  • Duplicate Gateway Settlement Records are no longer created.

  • The Stripe on the Process Payment correctly checks for a Default Gateway Account in PosiPay Settings. If no default account is configured, the Stripe Payment Form will no longer displayed, preventing user confusion and potential errors during payment processing.

  • A recent enhancement to the record-triggered flow of the Gateway Event automates the creation and updating of Gateway Customer, Payment Source/Instrument, and Gateway Transaction records based on specific Stripe webhook events.
    Key updates include conditional mapping for fields such as Customer ID, Email, and Payment Method ID. The Default Payment Source/Instrument will only be populated if matching records exist.
    Additionally, validation improvements specify that only credit card and BECS debit types are supported, and certain events, like charge.updated, will not be processed.

  • The Apex Trigger has been updated to monitor Gateway Transaction records. If the criteria are met, a future method is invoked to call the method that retrieves the Balance Transaction ID for successful charges, passing the Gateway Transaction, if not no action is taken.

Criteria:

Record Type: Transaction.
Charge ID: Not empty.
Balance Transaction ID: Empty.
Created Date: Today.

  • A new global invocable Apex class that allows you to easily generate Idempotency Keys using a UUID (Version 4) format.

    • You can now generate a unique Idempotency Key (e.g., 0562263b-360d-4223-b3c1-049f58a390a7)

    • Available as a global invocable method — usable in Flows and Process Builder

    • Helps ensure safe, non-duplicate API transactions and external calls.

  • In the Generate Bank Slip page the Return button is renamed to OK for imporved clarity and user interaction.

  • New app is created called PosiPay and the app logo is set.

  • The following tabs are available for navigation within the PosiPay App and the user profile can access the PosiPay App is the System Administrator and Standard User.

    • Home

    • Account

    • Gateway Account

    • Gateway Customer

    • Gateway Transaction

    • Gateway Invoice

    • Gateway Settlement

    • Bank Deposit Batch

    • Bank Statement

    • Bank Account

    • PosiPay Log

    • Gateway Event

    • PosiPay Settings

Below is another set of updates that has been included in the package.

1. Object and Fields Update

There are several important updates to improve data structure, accuracy, and usability across objects and fields.

  • Payment Source Object:

Removed: Default Payment Source
Added: Payment Method ID and Card BIN fields

  • Gateway Customer Object:

Replaced Customer field with a lookup to Account
Replaced Customer Address field with a formula that pulls the Account’s billing address
Added: Manage Payment Method action button

  • Contact Object: Removed the Default Gateway Customer field

  • Account Object: Added Default Gateway Customer lookup field

  • PosiPay Permission Set: Updated to support field changes

  • Bank Statement Line Object:

Clarified description for Amount field
Added: Total Transaction Amount, Total Transaction Amount, Total Fees,Adjustments
Difference Amount (formula to identify discrepancies)

2. Stripe Customer Form Component Enhancement

We’ve updated the Lightning Web Component for the Stripe Customer Form to improve flexibility, streamline user input, and better align with Stripe’s API behavior. These changes are now live and enhance control, validation, and integration reliability.

  • Payment Source/Instrument Record Creation Removed: The component no longer automatically creates or updates Payment Source or Payment Instrument records.

  • New Input/Output Attributes:

    • Gateway Customer – links to the Stripe customer record.

    • Account – associates the customer with an Account.

    • Update Payment Source/Instrument – used to update an existing record (credit card only).

  • Validations: Updates are only supported for credit cards. An error is shown if another payment method type is used.

  • UI Enhancements:

    • New checkbox: Set as Default Payment Method.

    • Auto-filled fields based on the Gateway Customer or Payment Source/Instrument.

    • When updating, certain fields (e.g., Cardholder Name, Card Number) are read-only.

  • API Behavior Changes:

    • Improved logic for when to create, update, or attach payment methods.

    • Default payment methods are set based on user selection.

    • The use of existing customer and account metadata ensures accurate Stripe integration.

3. A New Lightning Web Component for Managing Payment Source and Payment Instrument

A new Lightning Web Component (LWC) is introduced for managing Payment Source and Payment Instrument records on the Gateway Customer record via a Manage Payment Method page. The component provides:

  • Dynamic tables to display and manage Credit Card and BECS Debit records for both Payment Sources and (conditionally) Payment Instruments.

  • Record filtering by type and sorting by Created Date (newest first).

  • Field mapping for each table (Name, Status, Default, Last 4, Expiry, etc.).

  • A second-screen form integrated with Stripe for creating or editing records.

  • Button controls for activating, deactivating, editing, and setting a payment method as default—with logic to enable/disable based on record selection.

  • Stripe API callout to set the default payment method (invoice_settings.default_payment_method) when applicable.

  • Toast notifications for user feedback on successful actions.

  • Error logging through the creation of PosiPay Log records for any failures.

4. Enhancements to the Global Invocable Apex Class for Invoice API Integration

We’ve enhanced the existing global invocable Apex class used for Invoice API operations to improve control and reliability during payment processing.

New Invocable Variables Introduced

  • Payment Method ID (Input): Accepts a Payment Method ID (e.g., for a credit card or BECS Debit).

  • Idempotency Key (Input/Output): Supports both providing a custom key or auto-generating one if left empty.

Functional Changes:

  • "Pay an Invoice" API Callout : For Credit Card payments, the value of the Payment Method ID is passed directly as the payment method.

  • "Confirm a PaymentIntent" API Callout : For BECS Debit payments, the same Payment Method ID is passed as the payment method.

  • "Create an Invoice" API Callout

    • The Idempotency Key is now passed in the request header to ensure safe and repeatable API transactions.

    • If the Idempotency Key input is blank, the class:

      • Automatically generates a UUID using the Idempotency Key Generator class

      • Uses the generated key for the API callout

    • If the Idempotency Key is provided, it is used directly in the request.