Checking if reference transactions are enabled for normal purchases
-
Hello, our client is reporting issues accepting Paypal Payments via your plugin after finding the logging feature and trying to put in a small dummy product we logged the following error.
However, the products in question are single purchase and so have no idea whery this error is occurring.
Any help much appreciated thank you.
2022-01-11T13:09:20+00:00 DEBUG POST https://api.paypal.com/v1/billing-agreements/agreement-tokens
Request Body: {“description”:”Checking if reference transactions are enabled”,”payer”:{“payment_method”:”PAYPAL”},”plan”:{“type”:”MERCHANT_INITIATED_BILLING”,”merchant_preferences”:{“return_url”:”https:\/\/example.com\/return”,”cancel_url”:”https:\/\/example.com\/cancel”,”skip_shipping_address”:true}}}
Response Debug ID: 5cd081af54564
Response: Array
(
[code] => 403
[message] => Forbidden
)Response Body: {"name":"AUTHORIZATION_ERROR","debug_id":"5cd081af54564","message":"Authorization error","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#AUTHORIZATION_ERROR","details":[{"name":"REFUSED_MARK_REF_TXN_NOT_ENABLED","message":"This merchant account is not permitted to create Merchant Initiated Billing Agreement"}]}
The page I need help with: [log in to see the link]
-
Hi @djrikki,
This error is no reason to be concerned as the check is not restricted to only subscription product purchases.
In the last update, we added a feature to check whether or not Reference Transactions are enabled for the merchant account. When enabled, it will display a success, otherwise anAUTHORIZATION_ERROR
.
Subscriptions are the most obvious applications, but there are also other use cases where PayPal would require the user to have this feature enabled.
Anyway, the message will be removed from the logs in our next update as the result will be displayed in the WooCommerce system report either way.I did not notice any immediate irregularities on the site, but if you could provide more details about the nature of the reported issues, then we are happy to assist further.
Thanks!Kind regards,
NiklasEarlier this afternoon I tried to purchase the product, you log into PayPal, confirm the purchase and then it returns to the site with a red error message appearing at the top of the page saying “Something went wrong etc…” – basically the transaction failed.
Can you find the order number from the failed order within the PayPal Payments logs?
We would like to have a look at your complete PayPal Payments log file either way to learn more about this behavior.
You can share the full log either here in the forums or better privately with us from here: https://paypal.inpsyde.com/docs/request-support/
If you send us a private message, then please include a link to this thread so we can keep it updated.
Thanks!Kind regards,
NiklasHere is one such log from this morning, no order was created.
2022-01-14T08:03:48+00:00 DEBUG POST https://api.paypal.com/v1/oauth2/token?grant_type=client_credentials Response Debug ID: 65bdc5b0109e2 Response: Array ( [code] => 200 [message] => OK ) 2022-01-14T08:03:49+00:00 DEBUG POST https://connect.woocommerce.com/ppcsandbox/v2/customer/partner-referrals Request Body: {"partner_config_override":{"partner_logo_url":"https:\/\/connect.woocommerce.com\/images\/woocommerce_logo.png","return_url":"https:\/\/ecotreelithium.co.uk\/wp-admin\/admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway","return_url_description":"Return to your shop.","show_add_credit_card":true},"products":["PPCP"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}],"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","FUTURE_PAYMENT","REFUND","ADVANCED_TRANSACTIONS_SEARCH","VAULT"],"seller_nonce":"a1233wtergfsdt4365tzrshgfbaewa36AGa1233wtergfsdt4365tzrshgfbaewa36AG"}}}}]} Response Debug ID: 4a1a51f333d69 Response: Array ( [code] => 201 [message] => Created ) 2022-01-14T08:04:18+00:00 DEBUG POST https://api.paypal.com/v1/billing-agreements/agreement-tokens Request Body: {"description":"Checking if reference transactions are enabled","payer":{"payment_method":"PAYPAL"},"plan":{"type":"MERCHANT_INITIATED_BILLING","merchant_preferences":{"return_url":"https:\/\/example.com\/return","cancel_url":"https:\/\/example.com\/cancel","skip_shipping_address":true}}} Response Debug ID: af8e24387677e Response: Array ( [code] => 403 [message] => Forbidden ) Response Body: {"name":"AUTHORIZATION_ERROR","debug_id":"af8e24387677e","message":"Authorization error","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#AUTHORIZATION_ERROR","details":[{"name":"REFUSED_MARK_REF_TXN_NOT_ENABLED","message":"This merchant account is not permitted to create Merchant Initiated Billing Agreement"}]}
-
This reply was modified 3 years, 2 months ago by
djrikki.
And here is another which did become an order, not entirely sure what I am copying here in regard to start and end point, but heres a fragment of a failed order.
2022-01-11T13:06:52+00:00 DEBUG POST https://api.paypal.com/v1/notifications/verify-webhook-signature Request Body: {"transmission_id":"49115970-72df-11ec-954b-f78123f2bc00","transmission_time":"2022-01-11T13:06:27Z","cert_url":"https:\/\/api.paypal.com\/v1\/notifications\/certs\/CERT-360caa42-fca2a594-2f1e8d33","auth_algo":"SHA256withRSA","transmission_sig":"Nt6xryq6h+6Pa3lMWTyHlJN+XIdyxIhHH33B5iyBHgzFipNvy\/v6CtS86nvhOkZUR0xXNo2bcXwa3+vX8nWgW3wBMdq2Tkpuqlmq9LdFBiuU5\/RUOu2YwYlGXLngmvUqhPi8obdEdMEkRYamZApm16STCp323tivHbWnFet2rQ1wuzqK\/eCHqTmq8cTQ0711Xof9zrpEvCp1GoWiR6ngYOmE+8\/QPFIzO5K3DKgGGw7Di551e0B3RqZto3CKi11NzFRpqlacu2Dn9galERu5\/5gGr5dwCeAUsxJBdNXyQaAET\/w4v43E+QKwaMMUatzonL\/sj2SrqtIDOJNNL1\/G+w==","webhook_id":"4G003336SA636962A","webhook_event":{"id":"WH-6UH522183P237322B-1DE75260CA897760B","event_version":"1.0","create_time":"2022-01-11T13:06:23.415Z","resource_type":"checkout-order","resource_version":"2.0","event_type":"CHECKOUT.ORDER.APPROVED","summary":"An order has been approved by buyer","resource":{"create_time":"2022-01-11T13:05:24Z","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"0.01","breakdown":{"item_total":{"currency_code":"GBP","value":"0.01"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"payee":{"merchant_id":"L6PZVJPK3NWE8","display_data":{"brand_name":"Eco Tree Lithium"}},"description":"","items":[{"name":"Free","unit_amount":{"currency_code":"GBP","value":"0.01"},"tax":{"currency_code":"GBP","value":"0.00"},"quantity":"1","description":"","category":"PHYSICAL_GOODS"}],"shipping":{"name":{"full_name":"Richard Lake"},"address":{"address_line_1":"Unit 3B & 3C Pattern Store","address_line_2":"Station Approach","admin_area_2":"Gainsborough","admin_area_1":"Lincolnshire","postal_code":"DN21 2AU","country_code":"GB"}}}],"links":[{"href":"https:\/\/api.paypal.com\/v2\/checkout\/orders\/96D642976H328025T","rel":"self","method":"GET"},{"href":"https:\/\/api.paypal.com\/v2\/checkout\/orders\/96D642976H328025T","rel":"update","method":"PATCH"},{"href":"https:\/\/api.paypal.com\/v2\/checkout\/orders\/96D642976H328025T\/capture","rel":"capture","method":"POST"}],"id":"96D642976H328025T","intent":"CAPTURE","payer":{"name":{"given_name":"Richard","surname":"Lake"},"email_address":"[email protected]","payer_id":"8VUU3YXMEC33A","address":{"address_line_1":"Unit 3B & 3C Pattern Store","address_line_2":"Station Approach","admin_area_2":"Gainsborough","admin_area_1":"Lincolnshire","postal_code":"DN21 2AU","country_code":"GB"}},"status":"APPROVED"},"links":[{"href":"https:\/\/api.paypal.com\/v1\/notifications\/webhooks-events\/WH-6UH522183P237322B-1DE75260CA897760B","rel":"self","method":"GET"},{"href":"https:\/\/api.paypal.com\/v1\/notifications\/webhooks-events\/WH-6UH522183P237322B-1DE75260CA897760B\/resend","rel":"resend","method":"POST"}]}} Response Debug ID: 7472df0121aaa Response: Array ( [code] => 200 [message] => OK ) 2022-01-11T13:06:52+00:00 WARNING No order for webhook event WH-6UH522183P237322B-1DE75260CA897760B was found. 2022-01-11T13:06:52+00:00 INFO Webhook has been handled by CHECKOUT.ORDER.APPROVED 2022-01-11T13:06:53+00:00 DEBUG POST https://api.paypal.com/v1/notifications/verify-webhook-signature Request Body: {"transmission_id":"49115970-72df-11ec-954b-f78123f2bc00","transmission_time":"2022-01-11T13:06:27Z","cert_url":"https:\/\/api.paypal.com\/v1\/notifications\/certs\/CERT-360caa42-fca2a594-2f1e8d33","auth_algo":"SHA256withRSA","transmission_sig":"Nt6xryq6h+6Pa3lMWTyHlJN+XIdyxIhHH33B5iyBHgzFipNvy\/v6CtS86nvhOkZUR0xXNo2bcXwa3+vX8nWgW3wBMdq2Tkpuqlmq9LdFBiuU5\/RUOu2YwYlGXLngmvUqhPi8obdEdMEkRYamZApm16STCp323tivHbWnFet2rQ1wuzqK\/eCHqTmq8cTQ0711Xof9zrpEvCp1GoWiR6ngYOmE+8\/QPFIzO5K3DKgGGw7Di551e0B3RqZto3CKi11NzFRpqlacu2Dn9galERu5\/5gGr5dwCeAUsxJBdNXyQaAET\/w4v43E+QKwaMMUatzonL\/sj2SrqtIDOJNNL1\/G+w==","webhook_id":"4G003336SA636962A","webhook_event":{"id":"WH-6UH522183P237322B-1DE75260CA897760B","event_version":"1.0","create_time":"2022-01-11T13:06:23.415Z","resource_type":"checkout-order","resource_version":"2.0","event_type":"CHECKOUT.ORDER.APPROVED","summary":"An order has been approved by buyer","resource":{"create_time":"2022-01-11T13:05:24Z","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"0.01","breakdown":{"item_total":{"currency_code":"GBP","value":"0.01"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"payee":{"merchant_id":"L6PZVJPK3NWE8","display_data":{"brand_name":"Eco Tree Lithium"}},"description":"","items":[{"name":"Free","unit_amount":{"currency_code":"GBP","value":"0.01"},"tax":{"currency_code":"GBP","value":"0.00"},"quantity":"1","description":"","category":"PHYSICAL_GOODS"}],"shipping":{"name":{"full_name":"Richard Lake"},"address":{"address_line_1":"Unit 3B & 3C Pattern Store","address_line_2":"Station Approach","admin_area_2":"Gainsborough","admin_area_1":"Lincolnshire","postal_code":"DN21 2AU","country_code":"GB"}}}],"links":[{"href":"https:\/\/api.paypal.com\/v2\/checkout\/orders\/96D642976H328025T","rel":"self","method":"GET"},{"href":"https:\/\/api.paypal.com\/v2\/checkout\/orders\/96D642976H328025T","rel":"update","method":"PATCH"},{"href":"https:\/\/api.paypal.com\/v2\/checkout\/orders\/96D642976H328025T\/capture","rel":"capture","method":"POST"}],"id":"96D642976H328025T","intent":"CAPTURE","payer":{"name":{"given_name":"Richard","surname":"Lake"},"email_address":"[email protected]","payer_id":"8VUU3YXMEC33A","address":{"address_line_1":"Unit 3B & 3C Pattern Store","address_line_2":"Station Approach","admin_area_2":"Gainsborough","admin_area_1":"Lincolnshire","postal_code":"DN21 2AU","country_code":"GB"}},"status":"APPROVED"},"links":[{"href":"https:\/\/api.paypal.com\/v1\/notifications\/webhooks-events\/WH-6UH522183P237322B-1DE75260CA897760B","rel":"self","method":"GET"},{"href":"https:\/\/api.paypal.com\/v1\/notifications\/webhooks-events\/WH-6UH522183P237322B-1DE75260CA897760B\/resend","rel":"resend","method":"POST"}]}} Response Debug ID: 65130f18b1d48 Response: Array ( [code] => 200 [message] => OK ) 2022-01-11T13:09:20+00:00 DEBUG POST https://api.paypal.com/v1/billing-agreements/agreement-tokens Request Body: {"description":"Checking if reference transactions are enabled","payer":{"payment_method":"PAYPAL"},"plan":{"type":"MERCHANT_INITIATED_BILLING","merchant_preferences":{"return_url":"https:\/\/example.com\/return","cancel_url":"https:\/\/example.com\/cancel","skip_shipping_address":true}}} Response Debug ID: 5cd081af54564 Response: Array ( [code] => 403 [message] => Forbidden ) Response Body: {"name":"AUTHORIZATION_ERROR","debug_id":"5cd081af54564","message":"Authorization error","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#AUTHORIZATION_ERROR","details":[{"name":"REFUSED_MARK_REF_TXN_NOT_ENABLED","message":"This merchant account is not permitted to create Merchant Initiated Billing Agreement"}]} 2022-01-11T13:17:07+00:00 DEBUG POST https://connect.woocommerce.com/ppcsandbox/v2/customer/partner-referrals Request Body: {"partner_config_override":{"partner_logo_url":"https:\/\/connect.woocommerce.com\/images\/woocommerce_logo.png","return_url":"https:\/\/ecotreelithium.co.uk\/wp-admin\/admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway","return_url_description":"Return to your shop.","show_add_credit_card":true},"products":["PPCP"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}],"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","FUTURE_PAYMENT","REFUND","ADVANCED_TRANSACTIONS_SEARCH","VAULT"],"seller_nonce":"a1233wtergfsdt4365tzrshgfbaewa36AGa1233wtergfsdt4365tzrshgfbaewa36AG"}}}}]} Response Debug ID: 938c1e1bb253d Response: Array ( [code] => 201 [message] => Created ) 2022-01-11T16:19:32+00:00 DEBUG POST https://connect.woocommerce.com/ppcsandbox/v2/customer/partner-referrals Request Body: {"partner_config_override":{"partner_logo_url":"https:\/\/connect.woocommerce.com\/images\/woocommerce_logo.png","return_url":"https:\/\/ecotreelithium.co.uk\/wp-admin\/admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway","return_url_description":"Return to your shop.","show_add_credit_card":true},"products":["PPCP"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}],"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","FUTURE_PAYMENT","REFUND","ADVANCED_TRANSACTIONS_SEARCH","VAULT"],"seller_nonce":"a1233wtergfsdt4365tzrshgfbaewa36AGa1233wtergfsdt4365tzrshgfbaewa36AG"}}}}]} Response Debug ID: f0723ea4cb615 Response: Array ( [code] => 201 [message] => Created ) 2022-01-11T17:05:18+00:00 DEBUG POST https://api.paypal.com/v2/checkout/orders Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"2165.00","breakdown":{"item_total":{"currency_code":"GBP","value":"2165.00"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"description":"","items":[{"name":"24V 150AH","unit_amount":{"currency_code":"GBP","value":"2165.00"},"quantity":1,"description":"Over double the power and less than half the weight of your Lead Acid or AGM battery.\r\n\r\nPowered by the latest and safest Lithi","sku":"","category":"PHYSICAL_GOODS","tax":{"currency_code":"GBP","value":"0.00"}}],"payee":{"merchant_id":"L6PZVJPK3NWE8"}}],"application_context":{"user_action":"CONTINUE","shipping_preference":"NO_SHIPPING","landing_page":"BILLING","locale":"en-GB","brand_name":"Eco Tree Lithium","return_url":"https:\/\/ecotreelithium.co.uk\/?wc-ajax=ppc-return-url","cancel_url":"https:\/\/ecotreelithium.co.uk\/checkout\/"},"payment_method":{"payee_preferred":"IMMEDIATE_PAYMENT_REQUIRED","payer_selected":"PAYPAL"}} Response Debug ID: 257ab3cb3c461 Response: Array ( [code] => 201 [message] => Created ) 2022-01-11T17:05:19+00:00 DEBUG POST https://api.paypal.com/v2/checkout/orders Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"2165.00","breakdown":{"item_total":{"currency_code":"GBP","value":"2165.00"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"description":"","items":[{"name":"24V 150AH","unit_amount":{"currency_code":"GBP","value":"2165.00"},"quantity":1,"description":"Over double the power and less than half the weight of your Lead Acid or AGM battery.\r\n\r\nPowered by the latest and safest Lithi","sku":"","category":"PHYSICAL_GOODS","tax":{"currency_code":"GBP","value":"0.00"}}],"payee":{"merchant_id":"L6PZVJPK3NWE8"}}],"application_context":{"user_action":"CONTINUE","shipping_preference":"NO_SHIPPING","landing_page":"BILLING","locale":"en-GB","brand_name":"Eco Tree Lithium","return_url":"https:\/\/ecotreelithium.co.uk\/?wc-ajax=ppc-return-url","cancel_url":"https:\/\/ecotreelithium.co.uk\/checkout\/"},"payment_method":{"payee_preferred":"IMMEDIATE_PAYMENT_REQUIRED","payer_selected":"PAYPAL"}} Response Debug ID: 40ba2e1e0cb6d Response: Array ( [code] => 201 [message] => Created ) 2022-01-11T22:09:08+00:00 DEBUG POST https://api.paypal.com/v1/oauth2/token?grant_type=client_credentials Response Debug ID: a57576caf4827 Response: Array ( [code] => 200 [message] => OK ) 2022-01-11T22:09:08+00:00 DEBUG POST https://api.paypal.com/v2/checkout/orders Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"1699.00","breakdown":{"item_total":{"currency_code":"GBP","value":"1699.00"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"description":"","items":[{"name":"12V 320AH","unit_amount":{"currency_code":"GBP","value":"1699.00"},"quantity":1,"description":"Over double the power and less than half the weight of your Lead Acid or AGM battery.\r\n\r\nPowered by the latest and safest Lithi","sku":"EL12.8-324","category":"PHYSICAL_GOODS","tax":{"currency_code":"GBP","value":"0.00"}}],"payee":{"merchant_id":"L6PZVJPK3NWE8"}}],"application_context":{"user_action":"CONTINUE","shipping_preference":"NO_SHIPPING","landing_page":"BILLING","locale":"en-GB","brand_name":"Eco Tree Lithium","return_url":"https:\/\/ecotreelithium.co.uk\/?wc-ajax=ppc-return-url","cancel_url":"https:\/\/ecotreelithium.co.uk\/checkout\/"},"payment_method":{"payee_preferred":"IMMEDIATE_PAYMENT_REQUIRED","payer_selected":"PAYPAL"}} Response Debug ID: f649acb43f837 Response: Array ( [code] => 201 [message] => Created ) 2022-01-11T22:09:09+00:00 DEBUG POST https://api.paypal.com/v2/checkout/orders Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"1699.00","breakdown":{"item_total":{"currency_code":"GBP","value":"1699.00"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"description":"","items":[{"name":"12V 320AH","unit_amount":{"currency_code":"GBP","value":"1699.00"},"quantity":1,"description":"Over double the power and less than half the weight of your Lead Acid or AGM battery.\r\n\r\nPowered by the latest and safest Lithi","sku":"EL12.8-324","category":"PHYSICAL_GOODS","tax":{"currency_code":"GBP","value":"0.00"}}],"payee":{"merchant_id":"L6PZVJPK3NWE8"}}],"application_context":{"user_action":"CONTINUE","shipping_preference":"NO_SHIPPING","landing_page":"BILLING","locale":"en-GB","brand_name":"Eco Tree Lithium","return_url":"https:\/\/ecotreelithium.co.uk\/?wc-ajax=ppc-return-url","cancel_url":"https:\/\/ecotreelithium.co.uk\/checkout\/"},"payment_method":{"payee_preferred":"IMMEDIATE_PAYMENT_REQUIRED","payer_selected":"PAYPAL"}} Response Debug ID: e56ab961c7117 Response: Array ( [code] => 201 [message] => Created ) 2022-01-11T23:22:25+00:00 ERROR Order creation failed: Could not validate nonce.
Hi @djrikki,
Thanks for sharing the logs.
According to the last log, there seems to be a problem with the webhooks which could potentially cause theOrder creation failed: Could not validate nonce.
error.To make sure the webhooks are registered correctly, please visit the “Webhooks Status” dashboard from the settings.
Then click onResubscribe
and afterwardSimulate
to verify that the webhooks are received. If there are any errors in the log after this process, then we would like to take a look at it as well. Otherwise, there are not too many clues about what could be wrong. Our next plugin update will extend the logging a bit though so that more relevant information is stored.
Making sure the webhooks are registered correctly is always a good thing to do though. Thanks!Kind regards,
Niklas -
This reply was modified 3 years, 2 months ago by
- The topic ‘Checking if reference transactions are enabled for normal purchases’ is closed to new replies.