Enabling payments via payment processors in smart contracts (Part 1 of 2)
Accepting card payments in smart contracts using Silent Data [Oracle]
As organisations in the Web3 space, we often want to accept multiple payment methods for on-chain assets to attract both Web2 and Web3 native buyers. For crypto payments to smart contracts we have a clean swap protocol with no buyer risk, but for FIAT payments we are often left implementing an “issuer” or ”admin” role in a smart contract with unlimited power to issue new assets. This makes the issuer key a tempting prize for hackers, even worse as we want our sale and issuance to be automated, this key often ends up sitting on a web server.
Using Silent Data [Oracle] we can connect your smart contracts to Stripe or any other trusted Web2 payment processor to connect off-chain payments to our smart contracts. This allows the smart contract to execute based on every successful payment charge rather than relying on a hot key for instruction.
How does Silent Data [Oracle] enable smart contracts to act on Stripe payments?
Here is a brief overview of how to connect the Stripe API to your smart contracts using Silent Data [Oracle]:
Step 1: Configure the job and trigger
Establish the starting point of the job, here it is a stripe payment.
A job is a set of steps that users assign [Oracle] to complete. Here we will define a job to call stripe to retrieve a payment event, check the details. The result of a job is always posted on-chain.
Step 2: Configure the steps
Specify the kind of job you require, setup [Oracle] to retrieve details of the payment, and define which details of the response you want to verify
Step 2(b): Configure the secrets
In order to actually call the Stripe API, you must create a secret inside [Oracle] with your Stripe API Key.
Step 3: Configure the result
Connect your Callback contract to Silent Data [Oracle] in order to publish the results of the job back on-chain.
Step 4: Publish and fund your job
Finally, publish the job to get your job trigger URL which can be used by Stripe. Then set up funding to trigger the job itself, [Oracle] jobs need funding to run.
Check out Part 2 for step-by-step details!
Additional Resources
To understand how Silent Data [Oracle] keeps your data and API keys private, read the Intro to Silent Data [Oracle].
Don't forget to Sign up on Silent Data [Oracle] (no credit card required) .