Recurly.js allows you to easily embed a PCI compliant order
form within your website. Recurly.js is a Javascript library designed to be
easily embedded and customized to match your website. The library performs
in-line validation, real-time total calculations, and gracefully handles
errors. Your customer stays on your website while their billing information is
securely sent to Recurly for approval. Because the cardholder data is sent
directly to Recurly, your PCI compliance scope is dramatically reduced.
Before using Recurly.js, you must set your private
key. Recurly uses the private key to create an HMAC-SHA1 hash,
which is used to prevent users from tampering with sensitive data during the
request.
The request does not need to be signed to create a new subscription when
using Recurly.js v1. For v2, the account_code and
plan_code must be signed in your request.
$recurly_js=newRecurly_js($_POST['recurly_result']);try{$result=$recurly_js->verifySubscription();}catch(Recurly_ForgedQueryStringError$e){// Private key is invalid or the result was tampered with}
beginRecurly.js.verify_subscription!params[:recurly_result]rescueRecurly::JS::RequestForgery=>e# Private key is invalid or the result was tampered withend
try:recurly.js.verify_subscription(params['recurly_result'])exceptRequestForgeryError:# Private key is invalid or the result was tampered with
$recurly_js=newRecurly_js($_POST['recurly_result']);try{$result=$recurly_js->verifyTransaction();}catch(Recurly_ForgedQueryStringError$e){// Private key is invalid or the result was tampered with}
beginRecurly.js.verify_transaction!params[:recurly_result]rescueRecurly::JS::RequestForgery=>e# Private key is invalid or the result was tampered withend
try:recurly.js.verify_transaction(params['recurly_result'])exceptRequestForgeryError:# Private key is invalid or the result was tampered with
$recurly_js=newRecurly_js($_POST['recurly_result']);try{$result=$recurly_js->verifyBillingInfoUpdated();}catch(Recurly_ForgedQueryStringError$e){// Private key is invalid or the result was tampered with}
beginRecurly.js.verify_billing_info!params[:recurly_result]rescueRecurly::JS::RequestForgery=>e# Private key is invalid or the result was tampered withend
try:recurly.js.verify_billing_info_update(params['recurly_result'])exceptRequestForgeryError:# Private key is invalid or the result was tampered with