• Resolved yevhenst

    (@yevhenst)


    PayPal payment does not work when creating a product with a test period. Stripe works, there are no problems with it. After I created a product without test period, in this case there are no problems.
    Paypal log:

    Request path/v2/checkout/orders
    Status 422
    Debug IDf1000682f6bae
    Issue CANNOT_BE_ZERO_OR_NEGATIVE
    – Request

    {
    "additional_properties": {},
    "body": {
    "intent": "CAPTURE",
    "purchase_units": [
    {
    "reference_id": "wps-paypal-66e5b92b2d3cf2.70424913",
    "payee_payment_method_preference": "xxxxxx",
    "shipping": {
    "name": {
    "full_name": "*****"
    },
    "type": "SHIPPING",
    "address": {
    "address_line_1": "*****",
    "address_line_2": "*****",
    "admin_area_2": "sdv",
    "admin_area_1": "NL",
    "postal_code": "A1B 2C3",
    "country_code": "CA"
    }
    },
    "amount": {
    "value": "0.00",
    "currency_code": "USD"
    }
    }
    ],
    "application_context": {
    "brand_name": "JNG",
    "return_url": "https://link.com/checkout/order-received/1427/?key=wc_order_hAfwMn5ScvQgD",
    "cancel_url": "https://link.com/checkout/",
    "landing_page": "NO_PREFERENCE",
    "shipping_preference": "SET_PROVIDED_ADDRESS",
    "user_action": "PAY_NOW"
    },
    "payment_method": {
    "payee_preferred": "UNRESTRICTED",
    "payer_selected": "xxxxxx"
    },
    "payer": {
    "name": {
    "given_name": "*****",
    "surname": "*****"
    },
    "email_address": "*****",
    "address": {
    "country_code": "CA",
    "address_line_1": "*****",
    "address_line_2": "*****",
    "postal_code": "A1B 2C3"
    }
    },
    "payment_source": {
    "paypal": {
    "attributes": {
    "customer": {
    "id": "wps_paypal_77"
    },
    "vault": {
    "confirm_payment_token": "xxxxxx",
    "usage_type": "MERCHANT",
    "customer_type": "CONSUMER"
    }
    }
    }
    }
    },
    "header": {
    "accept": "*/*",
    "accept-encoding": "gzip",
    "ak-client-info": "xxxxxx",
    "akamai-x-forwarded-for-7": "xxxxxx",
    "authorization": "xxxxx",
    "cdn-loop": "xxxxxx",
    "client-auth": "xxxxx",
    "client_info": "xxxxxx",
    "content-length": "1249",
    "content-type": "application/json",
    "correlation-id": "f1000682f6bae",
    "fastly-client": "xxxxxx",
    "fastly-ff": "xxxxxx",
    "host": "api-m.sandbox.paypal.com",
    "paypal-partner-attribution-id": "Woo-wps_paypal",
    "paypal-request-id": "wps-paypal-66e5b92b2d3a86.96879093",
    "paypal-routing-metadata": "xxxxxx",
    "pp_geo_loc": "LT",
    "pp_remote_addr": "195.35.59.1",
    "pp_vip": "34.106.238.133",
    "prefer": "return=representation",
    "rl-count-10s": "xxxxxx",
    "rl-count-60s": "xxxxxx",
    "rl-rate-10s": "xxxxxx",
    "rl-rate-60s": "xxxxxx",
    "traceparent": "xxxxxx",
    "true-client-ip": "xxxxxx",
    "user-agent": "WordPress/6.6.2; https://link.com",
    "x-akamai-edgescape": "xxxxxx",
    "x-b3-spanid": "xxxxxx",
    "x-edge-security-info": "xxxxxx",
    "x-fastly-uuid": "xxxxxx",
    "x-forwarded-for": "10.96.10.196",
    "x-forwarded-host": "xxxxxx",
    "x-forwarded-proto": "xxxxxx",
    "x-forwarded-server": "xxxxxx",
    "x-limit-exceeded-v2": "xxxxxx",
    "x-paypal-correlation-id": "f1000682f6bae",
    "x-pp-ads-performed": "true",
    "x-pp-corrid": "f1000682f6bae",
    "x-pp-idempotencyid": "f1000682f6bae_1726331179",
    "x-pp-slingshot-targetapp": "apiplatformproxyserv",
    "x-sigsci-agentresponse": "xxxxxx",
    "x-sigsci-edgemodule": "xxxxxx",
    "x-sigsci-mac": "xxxxxx",
    "x-sigsci-requestid": "xxxxxx",
    "x-sigsci-tags": "xxxxxx",
    "x-slr-orig-script_uri": "https://api-m.sandbox.paypal.com/v2/checkout/orders"
    },
    "method": "POST"
    }

      – Response

      {
      "additional_properties": {},
      "body": {
      "name": "UNPROCESSABLE_ENTITY",
      "details": [
      {
      "field": "/purchase_units/@reference_id=='wps-paypal-66e5b92b2d3cf2.70424913'/amount/value",
      "value": "xxxxxx",
      "issue": "CANNOT_BE_ZERO_OR_NEGATIVE",
      "description": "Must be greater than zero. If the currency supports decimals, only two decimal place precision is supported."
      }
      ],
      "message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
      "debug_id": "f1000682f6bae",
      "links": [
      {
      "href": "https://developer.paypal.com/docs/api/orders/v2/#error-CANNOT_BE_ZERO_OR_NEGATIVE",
      "rel": "information_link",
      "method": "GET"
      }
      ]
      },
      "duration_time": 275,
      "header": {
      "APPLICATION_ID": "APP-80W284485P519543T",
      "Access-Control-Expose-Headers": "xxxxxx",
      "BORDER-IP": "xxxxxx",
      "CALLER_ACCT_NUM": "QLQZC2GEYVQCN",
      "Date": "Sat, 14 Sep 2024 16:26:19 GMT",
      "Keep-Alive": "xxxxxx",
      "PROCESSING-IP": "xxxxxx",
      "SERVER_INFO": "xxxxxx",
      "Server-Timing": "xxxxxx",
      "paypal-debug-id": "f1000682f6bae"
      },
      "status": 422
      }

      I understand that the amount can not be 0, but for what reason the plugin allows this or at least in this case would set not 0 amount, but 0.01$?

      And the plugin causes a 401 error. There is no such problem with the paypal plugin from woocommerce itself.
      Log:

      {
      "id": "WH-88Y403877S3312713-8F429320EH315223E",
      "create_time": "2024-09-14T19:25:08.934Z",
      "resource_type": "capture",
      "event_type": "PAYMENT.CAPTURE.COMPLETED",
      "summary": "Payment completed for $ 5.0 USD",
      "resource": {
      "payee": {
      "email_address": "[email protected]",
      "merchant_id": "QLQZC2GEYVQCN"
      },
      "amount": {
      "value": "5.00",
      "currency_code": "USD"
      },
      "seller_protection": {
      "dispute_categories": [
      "ITEM_NOT_RECEIVED",
      "UNAUTHORIZED_TRANSACTION"
      ],
      "status": "ELIGIBLE"
      },
      "supplementary_data": {
      "related_ids": {
      "order_id": "7RY07568ET867361E"
      }
      },
      "update_time": "2024-09-14T19:25:04Z",
      "create_time": "2024-09-14T19:25:04Z",
      "final_capture": true,
      "seller_receivable_breakdown": {
      "paypal_fee": {
      "value": "0.66",
      "currency_code": "USD"
      },
      "gross_amount": {
      "value": "5.00",
      "currency_code": "USD"
      },
      "net_amount": {
      "value": "4.34",
      "currency_code": "USD"
      }
      },
      "links": [
      {
      "method": "GET",
      "rel": "self",
      "href": "https://api.sandbox.paypal.com/v2/payments/captures/6X551074J8458392P"
      },
      {
      "method": "POST",
      "rel": "refund",
      "href": "https://api.sandbox.paypal.com/v2/payments/captures/6X551074J8458392P/refund"
      },
      {
      "method": "GET",
      "rel": "up",
      "href": "https://api.sandbox.paypal.com/v2/checkout/orders/7RY07568ET867361E"
      }
      ],
      "id": "6X551074J8458392P",
      "status": "COMPLETED"
      },
      "status": "FAILURE",
      "transmissions": [
      {
      "webhook_url": "https://link.com/wp-json/paypal/v1/incoming",
      "http_status": 401,
      "reason_phrase": "HTTP/1.1 200 Connection established",
      "response_headers": {
      "Transfer-Encoding": "chunked",
      "Server": "hcdn",
      "access-control-allow-headers": "Authorization, X-WP-Nonce, Content-Disposition, Content-MD5, Content-Type",
      "link": "<https://link.com/wp-json/>; rel=\"https://api.w.org/\"",
      "Connection": "keep-alive",
      "platform": "hostinger",
      "Date": "Sat, 14 Sep 2024 19:26:26 GMT",
      "access-control-expose-headers": "X-WP-Total, X-WP-TotalPages, Link",
      "content-security-policy": "upgrade-insecure-requests",
      "x-hcdn-request-id": "d8ba252e49c68551e1289cbfae8d8d42-phx-edge6",
      "x-content-type-options": "nosniff",
      "x-robots-tag": "noindex",
      "x-powered-by": "PHP/8.1.27",
      "Vary": "Accept-Encoding",
      "alt-svc": "h3=\":443\"; ma=86400",
      "panel": "hpanel",
      "Content-Type": "application/json; charset=UTF-8"
      },
      "transmission_id": "104c3040-72cf-11ef-99cd-11d9863db8be",
      "status": "FAILURE",
      "timestamp": "2024-09-14T19:25:12Z"
      }
      ],
      "links": [
      {
      "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-88Y403877S3312713-8F429320EH315223E",
      "rel": "self",
      "method": "GET",
      "encType": "application/json"
      },
      {
      "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-88Y403877S3312713-8F429320EH315223E/resend",
      "rel": "resend",
      "method": "POST",
      "encType": "application/json"
      }
      ],
      "event_version": "1.0",
      "resource_version": "2.0"
      }
    Viewing 2 replies - 1 through 2 (of 2 total)
    • Thread Starter yevhenst

      (@yevhenst)

      To partially fix the first problem I specified Initial Signup fee($) – 0.01$, but I would like to hear comments from support or developer about this situation. Thanks

      Plugin Author WP Swings

      (@wpswings)

      Hello,

      We need to create same scenario than check, so if it’s possible for you to connect with support team it will be quick and easy way to help on this

      Regards,

    Viewing 2 replies - 1 through 2 (of 2 total)
    • You must be logged in to reply to this topic.