strapi-plugin-payone-provider 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-payone-provider",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "description": "Strapi plugin for Payone payment gateway integration",
5
5
  "license": "MIT",
6
6
  "maintainers": [
@@ -126,6 +126,9 @@ const initializeApplePaySession = async (strapi, params) => {
126
126
 
127
127
  strapi.log.info("[Apple Pay] Session initialization response:", JSON.stringify(responseData, null, 2));
128
128
  strapi.log.info("[Apple Pay] Response status:", responseData.status || responseData.Status);
129
+ strapi.log.info("[Apple Pay] Response errorcode:", responseData.errorcode || responseData.ErrorCode || "none");
130
+ strapi.log.info("[Apple Pay] Response errormessage:", responseData.errormessage || responseData.ErrorMessage || responseData.errortxt || responseData.ErrorTxt || "none");
131
+ strapi.log.info("[Apple Pay] All response keys:", Object.keys(responseData));
129
132
 
130
133
  if (responseData.errorcode || responseData.ErrorCode) {
131
134
  strapi.log.warn("[Apple Pay] Response contains error:", {
@@ -205,10 +208,12 @@ const validateApplePayMerchant = async (strapi, params) => {
205
208
  strapi.log.error("[Apple Pay] Failed to initialize session with Payone:", {
206
209
  message: error.message,
207
210
  status: error.response?.status,
208
- data: error.response?.data
211
+ data: error.response?.data,
212
+ stack: error.stack
209
213
  });
210
- // Return empty object on error - Payment Request API will handle it
211
- return {};
214
+ // DO NOT return empty object - throw error instead
215
+ // Empty object causes Apple Pay to close dialog without proper error message
216
+ throw new Error(`Failed to initialize Apple Pay session with Payone: ${error.message}. Please check your Payone configuration and ensure Apple Pay is properly set up in PMI.`);
212
217
  }
213
218
 
214
219
  strapi.log.info("[Apple Pay] Session initialization result:", {
@@ -395,9 +400,28 @@ const validateApplePayMerchant = async (strapi, params) => {
395
400
  // If initialization failed, we cannot proceed
396
401
  // Payment Request API requires a valid merchant session
397
402
  strapi.log.error("[Apple Pay] Session initialization failed - status:", responseStatus);
403
+ strapi.log.error("[Apple Pay] Full Payone response:", JSON.stringify(sessionResponse, null, 2));
398
404
  strapi.log.error("[Apple Pay] This means merchant validation will fail.");
399
- strapi.log.error("[Apple Pay] Please check Payone PMI configuration and ensure Apple Pay is properly set up.");
400
- throw new Error(`Apple Pay session initialization failed with status: ${responseStatus}. Please check your Payone Apple Pay configuration in PMI.`);
405
+ strapi.log.error("[Apple Pay] Possible causes:");
406
+ strapi.log.error("[Apple Pay] 1. Payone returned ERROR status - check errorcode and errormessage in response");
407
+ strapi.log.error("[Apple Pay] 2. Apple Pay not configured in Payone PMI");
408
+ strapi.log.error("[Apple Pay] 3. Domain not verified in Payone PMI");
409
+ strapi.log.error("[Apple Pay] 4. Merchant identifier not configured correctly");
410
+ strapi.log.error("[Apple Pay] 5. Apple Pay onboarding not completed");
411
+
412
+ // Extract error details from Payone response
413
+ const errorCode = sessionResponse.errorcode || sessionResponse.ErrorCode;
414
+ const errorMessage = sessionResponse.errormessage || sessionResponse.ErrorMessage || sessionResponse.errortxt || sessionResponse.ErrorTxt;
415
+
416
+ if (errorCode || errorMessage) {
417
+ strapi.log.error("[Apple Pay] Payone error details:", {
418
+ errorCode: errorCode,
419
+ errorMessage: errorMessage
420
+ });
421
+ throw new Error(`Payone Apple Pay initialization failed: ${errorCode ? `Error ${errorCode}` : ''} ${errorMessage || 'Unknown error'}. Please check your Payone Apple Pay configuration in PMI (CONFIGURATION → PAYMENT PORTALS → [Your Portal] → Apple Pay).`);
422
+ } else {
423
+ throw new Error(`Apple Pay session initialization failed with status: ${responseStatus || 'UNKNOWN'}. Please check your Payone Apple Pay configuration in PMI (CONFIGURATION → PAYMENT PORTALS → [Your Portal] → Apple Pay).`);
424
+ }
401
425
  } catch (error) {
402
426
  strapi.log.error("[Apple Pay] Merchant validation error:", {
403
427
  message: error.message,