PayPal integration: payments, refunds and webhooks

VulCode connects your store or app with PayPal through the API. The customer pays, and the payment result lands on the order in your system. PayPal events come back as webhooks, so the order status changes by itself, without manual checking. You make a refund from the same place where you handle the order. A PayPal integration costs from PLN 999 (about EUR 220), usually takes 2-3 days, and we send a free quote within an hour.

From the cart to a refund

A payment goes through several steps. Each one has its place in your system. When something stops matching, you see it at a specific step, not only in a report at the end of the month.

  1. Checkout PayPal button at the order approval
  2. Order your order number on the store side capture
  3. PayPal approval and capture of the payment notification
  4. Webhook the event comes back to your system refund
  5. Refund refund of a captured payment
When it works
The order gets a paid status and goes to fulfilment
When it fails
A failed or cancelled payment returns to the order with a reason

What the integration calls in the PayPal API

The main calls that the handling of refunds and statuses relies on.

OperationEndpoint or resourceWhy
Refund of a captured paymentPOST /v2/payments/captures/{capture_id}/refundYou make the refund from the store panel, without logging in to PayPal.
Refund detailsGET /v2/payments/refunds/{refund_id}The refund status returns to the order.
Webhook subscriptionWebhooks Management v1 APIWe set which events reach your system.
Signature verificationPOST /v1/notifications/verify-webhook-signatureWe check the signature of each event before we change a status.
Webhook event listGET /v1/notifications/webhooks-event-typesWe check which events can be subscribed to before we plan the status handling.

Names from the official PayPal documentation.

03

Before the first payment goes through PayPal

Things on your side that delay the launch if missing. The list does not replace the PayPal documentation.

  1. 01

    Account and access

    API access data from your PayPal account

    Without them no call can be made. We pass them outside the chat and do not store them in the code.

  2. 02

    A public address for events

    PayPal sends events there, so it must be reachable from the internet.

  3. 03

    Refund rules in your store

    A refund through the API does not decide for you who gets money and when. You set the rules, and we build them into order handling.

  4. 04

    Mapping events to order statuses

    PayPal events have their own names, and your store has its own statuses. We settle which event changes which status before sales start.

  5. 05

    A test before switching on

    We test payments on the provider test environment or on a copy of your store, and only then switch them on in production. We also check refunds and failed payments.

PayPal next to other gateways or on its own

The choice depends on how your customers pay and where the store operates. Both options can run side by side if some customers pay differently than others.

PayPal next to domestic gateways

  • Customers want to pay with a PayPal account.
  • You also want transfers and BLIK in the same checkout.
  • Traffic from several countries, and you want one method for all customers.

PayPal as one of the payment methods, with webhooks writing the result to the order.

Online payments

Your own payment handling

  • The store or app is custom-built.
  • The payment status should live in your client panel.
  • Refunds should follow your own rules.

A PayPal API integration in your code, with webhooks and refund handling in the panel.

Selling abroad

Selling abroad is more than the payment itself. We settle the currency, the checkout language and the prices before launch.

A payment from another country goes through the same steps as a domestic one: order, approval, capture and webhook. What the customer sees in the cart and the refund rules you apply differ. Differences in taxes and settlements stay with your accountant, and we make sure the payment data reaches the order without manual copying.

Before we show the cart to a foreign customer, we settle four things with you: which currencies the customer pays in, which currency you are paid out in, which language the cart is in and what the customer sees in the email after payment.

For sales abroad we also watch what the customer sees after the payment: the order confirmation, the email and the status in the client panel. The message must be in the customer language and must not reveal technical details. We agree it with you at the start, so it does not have to be rewritten after sales begin.

Common questions about PayPal integration

The main questions about PayPal: who builds it, refunds, statuses, cost and code.

Who builds the PayPal integration?
VulCode, a software house from Cracow, Poland, builds the integration in your store or app and hands it over as a repository with run instructions. Before launch we agree the scope with you, and once the work is accepted and paid in full, the code is yours.
How long does it take?
Usually 2-3 days. The exact dated schedule comes with the free quote, and if anything is going to move, you know in advance.
How much does a PayPal integration cost?
A PayPal integration costs from PLN 999 (about EUR 220) under our API and integrations service, and the rollout usually takes 2-3 days. The figure depends on whether refunds from the panel, several currencies and a mobile app are included. We give it after a short call, once we know your store and its processes. The quote is free and comes back within an hour.
Can a refund be made from the store panel?
Yes. You make the refund through the PayPal API for a captured payment, and the refund status returns to the order. You set the rules for who gets a refund and when. A refund can only be made for a captured payment, so we check the payment status before the refund is sent.
How does the store know the payment went through?
From a webhook. PayPal sends the event to your system, and we check its signature before we change the order status. We do not rely only on the customer returning to the page. If the event does not arrive or the signature does not match, the order status does not change and the error goes to the log.
Can customers pay with PayPal in a mobile app?
Yes. In a mobile app the customer pays through the PayPal SDK or in a browser window, and the result returns to the order through the same webhook as in the store. We agree which variant to use before quoting, because it changes how the order flows.
Does selling abroad need a separate integration?
No, the same integration handles domestic and foreign payments. We settle currencies, languages and cart prices together with you. If you sell in several countries, we also check whether settlements and refunds can be run in one system.
Will the PayPal integration code be mine?
Yes. Once the work is accepted and paid in full, the economic copyright in the PayPal integration code passes to you and you get the repository with run instructions. Open source libraries keep their own licences.
What if PayPal changes its API?
We adjust the integration to PayPal's changes: within the 90 days of support included after launch, later under a maintenance plan or as a separate short order. We follow PayPal's change notices and tell you in advance what needs fixing.

Sources

Endpoint and webhook names come from the PayPal developer documentation.

Related pages

Other payment methods and places where a payment meets the order.

  1. 4 Stripe
  2. 3 Tpay
  3. 2 PayU
  4. 1 BLIK
  5. 0 Online payments
  1. 00

    Online payments

    A comparison of online payment gateways.

  2. 01

    BLIK

    BLIK in the store checkout.

  3. 02

    PayU

    PayU payments in the store.

  4. 03

    Tpay

    Tpay payments in the store.

  5. 04

    Stripe

    Card payments through Stripe.

Describe your project.

A free quote comes back within an hour during working hours.