Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get more clarity on what to do after order create #32

Open
ponasromas opened this issue Feb 28, 2023 · 2 comments
Open

Get more clarity on what to do after order create #32

ponasromas opened this issue Feb 28, 2023 · 2 comments

Comments

@ponasromas
Copy link

ponasromas commented Feb 28, 2023

After I create order, what next step should I do? Isn't it should generate approval_link? After order create step I get this:

{
  "create_time": "2023-02-28T07:46:30Z",
  "id": "18545950ND137401U",
  "intent": "CAPTURE",
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v2/checkout/orders/18545950ND137401U",
      "method": "GET",
      "rel": "self"
    },
    {
      "href": "https://www.sandbox.paypal.com/checkoutnow?token=18545950ND137401U",
      "method": "GET",
      "rel": "approve"
    },
    {
      "href": "https://api.sandbox.paypal.com/v2/checkout/orders/18545950ND137401U",
      "method": "PATCH",
      "rel": "update"
    },
    {
      "href": "https://api.sandbox.paypal.com/v2/checkout/orders/18545950ND137401U/capture",
      "method": "POST",
      "rel": "capture"
    }
  ],
  "purchase_units": [
    {
      "amount": {
        "breakdown": {
          "item_total": {
            "currency_code": "EUR",
            "value": "10.00"
          }
        },
        "currency_code": "EUR",
        "value": "10.00"
      },
      "items": [
        {
          "category": "DIGITAL_GOODS",
          "description": "",
          "name": "Invoice PRF-15",
          "quantity": "1",
          "unit_amount": {
            "currency_code": "EUR",
            "value": "10.00"
          }
        }
      ],
      "payee": {
        "email_address": "*****",
        "merchant_id": "AZUR3*******"
      },
      "reference_id": "default"
    }
  ],
  "status": "CREATED"
}

Where else to go? "Capture an Order" step possible only after customer approves payment. But where is the link for approval?

@1337haxx0r
Copy link

1337haxx0r commented Mar 1, 2023

@ponasromas I think, you'd need to redirect user to

{
      "href": "https://www.sandbox.paypal.com/checkoutnow?token=18545950ND137401U",
      "method": "GET",
      "rel": "approve"
    }

that's where they approve purchase on PayPal's side.
After which PayPal is gonna send you response that you ned to work with. (either purchase complete or not)

@the-dijkstra
Copy link
Member

the-dijkstra commented Mar 4, 2023

Yes correct you should redirect user to the approval link so they can approve your created order. Thanks @1337haxx0r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants