Accepting payments is one of those moments when an advertising system suddenly becomes very real. Until now, you may have been creating Zones, setting prices, building Packages, and deciding how advertisers will spend their Tokens. Once a payment gateway is connected, somebody can hand over actual money.
That is why WaypointAds provides a Sandbox for testing payment gateways before they are placed into live operation.
Before setting up Stripe or PayPal, it helps to understand a few of the terms you will encounter. Payment providers sometimes use different names for similar things, but the basic principles are much the same.
What Is a Payment Gateway?
A payment gateway connects WaypointAds with the company that actually processes the advertiser's payment.
WaypointAds does not need to become a bank, store credit card numbers, or attempt to perform payment processing itself. Instead, it sends the advertiser through the appropriate payment process provided by Stripe or PayPal.
Once payment has been successfully completed and confirmed, WaypointAds can record the transaction and credit the appropriate Token Package to the advertiser's Wallet.
In simple terms:
WaypointAds sells the Package. The payment provider handles the money. The Wallet receives the Tokens.
There are, however, several pieces that allow those systems to communicate securely.
Publishable Keys, Secret Keys, and Credentials
When you connect a website to a payment provider, the provider needs a way to identify the account making the request.
With Stripe, you will encounter Publishable Keys and Secret Keys.
The Publishable Key is designed for situations where Stripe permits the key to be exposed to the browser. It identifies the Stripe account but does not provide the powerful account access associated with the Secret Key.
The Secret Key is exactly what its name suggests. It is private and should never be published, included in an article, displayed on a public page, or casually handed to somebody who promises that he is "pretty good with computers."
WayPointAds stores the credentials it needs so that the payment gateway can communicate securely with the appropriate payment provider.
PayPal uses its own credential system and terminology, but the purpose is similar: WaypointAds must be authorized to communicate with the PayPal account receiving the payment.
What Is a Webhook?
A webhook is a way for the payment provider to contact WaypointAds when something happens.
That distinction is important.
When an advertiser completes a purchase, the browser may return the advertiser to WaypointAds. That return is useful for the advertiser, but it should not be the only evidence that a payment was completed.
Browsers can be closed. Connections can fail. People can click Back. Pages can be refreshed at exactly the wrong moment because apparently the Internet enjoys practical jokes.
A webhook provides communication directly from the payment provider to WaypointAds.
For example, Stripe may notify WaypointAds that a Checkout payment was successfully completed. WaypointAds can then identify the associated transaction and process it appropriately.
Webhooks can also report other events, including failed, cancelled, or expired transactions, depending upon the payment provider and the events supported by the WaypointAds gateway.
Think of the difference this way:
The browser tells the advertiser where to go next.
The webhook tells WaypointAds what actually happened.
For payment processing, that second conversation is extremely important.
Why WaypointAds Has a Sandbox
WaypointAds includes a Sandbox so that an Administrator can configure and test payment gateways without immediately risking real transactions.
Stripe and PayPal both provide testing facilities. These allow developers and website Administrators to simulate purchases using test accounts, test payment methods, or other tools supplied by the payment provider.
WaypointAds brings those testing capabilities into the gateway configuration process.
While operating in the Sandbox, the objective is not simply to see whether a payment page appears. A proper test should confirm the entire journey:
Package Selected → Checkout Started → Test Payment Completed → Payment Confirmed → Transaction Recorded → Tokens Added to Wallet
That complete journey matters.
A beautiful payment screen is not particularly useful if the advertiser pays successfully and his Wallet remains as empty as it was five minutes earlier.
Test Credentials and Live Credentials
Payment providers normally separate their testing environment from their live payment environment.
This means you may have one set of credentials for testing and another set for accepting real payments.
That separation is deliberate.
Test credentials allow you to experiment without creating real charges. Live credentials authorize real transactions involving real customers and real money.
WaypointAds therefore treats testing as a distinct part of gateway setup.
An Administrator should configure the Sandbox first, perform successful transactions, verify the Wallet and transaction records, and confirm that the webhook communication is working properly.
Only after the complete process has been tested should the live gateway credentials be entered and enabled.
Before You Go Live
Do not use the first successful Checkout screen as proof that everything works. Test the complete transaction.
Confirm that the payment provider reports success. Confirm that WaypointAds receives the expected notification. Confirm that the transaction appears where it should. Confirm that the correct advertiser receives the correct number of Tokens.
It is also worth deliberately testing things that do not go according to plan.
Cancel a test Checkout. Allow one to expire where the provider's testing tools permit it. Use an unsuccessful test payment. Return to WaypointAds using the browser's Back button. Refresh a page.
The Sandbox is the place to be troublesome.
Your advertisers are remarkably capable of doing these things later without any encouragement whatsoever.
Once the payment system has survived your testing, you can move from the Sandbox to live operation.

Looking Ahead
WaypointAds is being built to grow. Additional Payment Gateway Plugins will be introduced over time, giving Administrators more choices for accepting payments from their advertisers. As each new Gateway Plugin becomes available, these articles will be expanded with the information needed to configure, test, and place that gateway into live operation.