Page 7 of 9 FirstFirst ... 56789 LastLast
Results 61 to 70 of 85
  1. #61
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,531
    Plugin Contributions
    88

    Default Re: PayPal RESTful API Payment Module

    That's not helpful, I'm looking for a "pattern" for the failure so I need specifics.

  2. #62
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,531
    Plugin Contributions
    88

    Default Re: PayPal RESTful API Payment Module

    My best guess is that, for the sites that are auto-disabling after successfully retrieving the PayPal OAuth token, the required changes to the order_totals.php class were not applied: https://github.com/lat9/paypalr/wiki...r_total.php%60

  3. #63
    Join Date
    Sep 2013
    Location
    Devon, UK
    Posts
    76
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    I just installed Paypal Restful 1.01 on our test server and came up against an issue with card processing.

    Code:
    2024-03-09 14:04:23: (checkout_process) ==> Start createOrder
    TokenCache::get, using saved access-token; expires in 32362 seconds.
    The curlPost (v2/checkout/orders) request was unsuccessful.
    {
        "errNum": 400,
        "errMsg": "",
        "curlErrno": 0,
        "name": "INVALID_REQUEST",
        "message": "Request is not well-formed, syntactically incorrect, or violates schema.",
        "details": [
            {
                "field": "\/purchase_units\/@reference_id=='default'\/supplementary_data\/card\/level3\/ships_from_postal_code",
                "value": "TQ12 5TZ",
                "location": "body",
                "issue": "must match \"^[a-zA-Z0-9_'.-]*$\""
            }
        ],
        "debug_id": "8a641239069c5"
    }
    
    ...
    
    2024-03-09 14:04:23: (checkout_process) ==> End createOrderAn error occurred when we tried to process your credit card. Please try again, select an alternate payment method or contact us for assistance.
    A correctly-formatted UK postcode has a space in it, as above. Paypal appears to have rejected it because it isn't expecting a space. This is not necessarily the fault of the Zen Cart payment module but I managed to get around it by editing includes/modules/payment/paypal/PayPalRestful/Zc2Pp/CreatePayPalOrderRequest.php, changing:

    Code:
            if (SHIPPING_ORIGIN_ZIP !== '') {
                $level_3['ships_from_postal_code'] = SHIPPING_ORIGIN_ZIP;
            }
    to:

    Code:
            if (SHIPPING_ORIGIN_ZIP !== '') {
                $level_3['ships_from_postal_code'] = str_replace(' ', '', SHIPPING_ORIGIN_ZIP);
            }
    at line 466 to remove the space.

    After that, the card payment went through fine. It might be worth looking into this further as the workaround might not be the right way to fix it.
    Last edited by BillJ; 9 Mar 2024 at 04:06 PM.

  4. #64
    Join Date
    Sep 2013
    Location
    Devon, UK
    Posts
    76
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    I couldn't find anything in the Paypal API docs that specifies the format of the ships_from_postal_code field. Only that it shoudl be 1-60 characters long.

  5. #65
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,531
    Plugin Contributions
    88

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by BillJ View Post
    I just installed Paypal Restful 1.01 on our test server and came up against an issue with card processing.

    Code:
    2024-03-09 14:04:23: (checkout_process) ==> Start createOrder
    TokenCache::get, using saved access-token; expires in 32362 seconds.
    The curlPost (v2/checkout/orders) request was unsuccessful.
    {
        "errNum": 400,
        "errMsg": "",
        "curlErrno": 0,
        "name": "INVALID_REQUEST",
        "message": "Request is not well-formed, syntactically incorrect, or violates schema.",
        "details": [
            {
                "field": "\/purchase_units\/@reference_id=='default'\/supplementary_data\/card\/level3\/ships_from_postal_code",
                "value": "TQ12 5TZ",
                "location": "body",
                "issue": "must match \"^[a-zA-Z0-9_'.-]*$\""
            }
        ],
        "debug_id": "8a641239069c5"
    }
    
    ...
    
    2024-03-09 14:04:23: (checkout_process) ==> End createOrderAn error occurred when we tried to process your credit card. Please try again, select an alternate payment method or contact us for assistance.
    A correctly-formatted UK postcode has a space in it, as above. Paypal appears to have rejected it because it isn't expecting a space. This is not necessarily the fault of the Zen Cart payment module but I managed to get around it by editing includes/modules/payment/paypal/PayPalRestful/Zc2Pp/CreatePayPalOrderRequest.php, changing:

    Code:
            if (SHIPPING_ORIGIN_ZIP !== '') {
                $level_3['ships_from_postal_code'] = SHIPPING_ORIGIN_ZIP;
            }
    to:

    Code:
            if (SHIPPING_ORIGIN_ZIP !== '') {
                $level_3['ships_from_postal_code'] = str_replace(' ', '', SHIPPING_ORIGIN_ZIP);
            }
    at line 466 to remove the space.

    After that, the card payment went through fine. It might be worth looking into this further as the workaround might not be the right way to fix it.
    Quote Originally Posted by BillJ View Post
    I couldn't find anything in the Paypal API docs that specifies the format of the ships_from_postal_code field. Only that it shoudl be 1-60 characters long.
    Thanks for sussing that out; I've opened a GitHub issue to track the change (https://github.com/lat9/paypalr/issues/14) and use your suggested correction.

  6. #66
    Join Date
    Sep 2013
    Location
    Devon, UK
    Posts
    76
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by lat9 View Post
    Thanks for sussing that out; I've opened a GitHub issue to track the change (https://github.com/lat9/paypalr/issues/14) and use your suggested correction.
    Thanks. Other than that it looks great and I'm going to install it on our production server. Since it replaces Paypal Express, are there any plans to implement the Paypal Express Checkout button?

  7. #67
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,531
    Plugin Contributions
    88

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by BillJ View Post
    Thanks. Other than that it looks great and I'm going to install it on our production server. Since it replaces Paypal Express, are there any plans to implement the Paypal Express Checkout button?
    I've got no plans for a PayPal Express Checkout button at this time; the best I can offer is that the payment module works with the guest-checkout feature of One-Page Checkout.

  8. #68
    Join Date
    Sep 2013
    Location
    Devon, UK
    Posts
    76
    Plugin Contributions
    0

    Default Re: PayPal RESTful API Payment Module

    Quote Originally Posted by lat9 View Post
    I've got no plans for a PayPal Express Checkout button at this time; the best I can offer is that the payment module works with the guest-checkout feature of One-Page Checkout.
    That's a fair trade. I always thought the Express Checkout button added a lot of complexity to the checkout code.

  9. #69
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,531
    Plugin Contributions
    88

    Default Re: PayPal RESTful API Payment Module


  10. #70
    Join Date
    Nov 2007
    Location
    USA
    Posts
    881
    Plugin Contributions
    5

    Default Re: PayPal RESTful API Payment Module

    Will this be part of the ZC 2.0 release?
    Cheers!
    v2.0+

 

 
Page 7 of 9 FirstFirst ... 56789 LastLast

Similar Threads

  1. v158 UPS Shipping using RESTful/OAuth API [Support Thread]
    By lat9 in forum Addon Shipping Modules
    Replies: 122
    Last Post: 26 Apr 2024, 05:15 PM
  2. IPower & FirstData API Payment Module
    By spence in forum Addon Payment Modules
    Replies: 6
    Last Post: 7 Jul 2011, 06:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR