Overview of Pledg payment types
Pledg provides merchants with two primary payment types to offer customers:
- Installment: The payment is split into several installments.
- Deferred: The payment is completed only after a specific delay.
website·Indexed 34 days ago
https://docs.pledg.co/Developer documentation for integrating Pledg's payment solution. Includes guides on API authentication, purchase management, payment schedule simulation, and various integration modes such as CMS modules (Magento v2), plugins, redirections, and purchase links. Covers technical principles including IPN notifications, environment settings (staging and production), and refund processes.
Pledg provides merchants with two primary payment types to offer customers:
Manage the visibility of Pledg informational widgets by navigating to Settings > PledgBySofinco. Available options include:
To be notified of errors occurring after the payment screen, provide the optional errorNotificationUrl parameter during purchase creation. Pledg sends a POST request with a JSON body when the purchase state transitions to specific error or abandonment statuses.
Key Behaviors:
SCORING_KO, ABORTED, *_CANCELLED) are terminal, meaning the purchase is permanently closed.PRIMARY_KO and IDENTIFICATION_KO trigger notifications but keep the checkout session active, allowing the customer to potentially recover the flow.acceptance_state is REJECTED, the acceptance_rejection_type and acceptance_rejection_subtypes fields will contain details. If acceptance_state is ABANDONED, these fields remain empty.{
"reference" : "purchase_reference",
"state" : "REVENUE_KO",
"acceptance_state": "REJECTED",
"acceptance_rejection_type": "NOT_ELIGIBLE",
"acceptance_rejection_subtypes": ["Insufficient revenue"],
"uid" : "pur_6c48d42b-f29b-4f84-bee8-3cb2b964b600",
"loan_short_id": "1UW7Z0F5D21"
}To verify the installation and configuration is working correctly:
paymentNotificationUrl parameter when creating the purchase. Pledg will send a POST request with a JSON body to this URL. The specific fields in the JSON body vary depending on the payment mode used (e.g., back mode or transfer mode).In Transfer mode, wire transfers are routed via Pledg's back office based on the merchant's IBAN. Settlement and operation monitoring can be handled in two ways:
Depending on whether a virtual card has been debited, refunds are handled differently:
To prevent tampering, settings must be transmitted as a JSON Web Token (JWT) signature. The token is generated on the merchant's backend using a shared secret key.
Payload Requirements: The JWT payload must contain all settings except:
signature parameter itselfcontainerElement parameter (for plugin integrations)Workflow:
signature field when calling Pledg.const jwt = require('jsonwebtoken');
function generateSignature(data) {
// The secret key to sign the JWT (Store in private area/env var)
const secret = process.env.SECRET;
// Generate the signature
const signature = jwt.sign(
{ data: data }, // signed data
secret, // Secret Key
{ expiresIn: '1d' } // Options: signature expires in 1 day
);
return signature;
}
// Use case
const settings = {
merchantUid: 'mer_efjhik1234567',
amountCents: 10000,
email: 'toto@dev.fr',
title: 'My Order',
reference: 'abcd',
phoneNumber: '0664667788'
};
const signature = generateSignature(settings);
console.log('generated signature:', signature);Pledg uses a classical Instant Payment Notification (IPN) mechanism to notify merchant backends of payment events. To ensure successful delivery of these webhooks, merchants must adhere to the following requirements:
python-requests as the User Agent; this may need to be authorized in the merchant's firewall or security settings.https (secure) URLs are supported; http URLs will not be used.The staging environment is a sandbox where certain platform behaviors are mocked. Note the following constraints and requirements during testing:
Behavioral Differences:
Testing Requirements: