Paymentwall website uses cookies to store your browsing preferences on your device. However, cookies do not collect personal information.

For more information about how we use cookies, check our cookie policy

Close

Documentation

New Documentation Getting Started API Libraries APIs Checklists Flows Integrations Mobile SDKs Reference Smart TV SDK SpiderPipe Testing Payments
Contacts
If you still have questions regarding integration, please email us at devsupport@paymentwall.com

Unity

If you do not have a merchant account registered at Paymentwall, please sign up by completing the steps below:

  • If you don't have a Paymentwall Merchant Account yet, please Sign up.
  • Fill out the Sign Up Form.

Sign up form

  • Please enter your Company Name and website URL.

Sign up company

  • Press the Continue button. Your Paymentwall Merchant Account has been created.

If you already have a Merchant account registered at Paymentwall, following the steps below:

  • After you login, please go to My Projects tab. You will see your first project already created. Please take note of the Project Key and Secret Key. You will need them later to finish the project setup.

My Projects tab

  • Press the Settings button. Please select "Digital Goods" (or other API) under "Your API".
  • Set the Pingback URL to: http://[your-domain].com/paymentwall_pingback .
  • In Custom Pingback parameters, add currencyCode as parameter, OWN as value. Add amount as parameter, OWN as value.
  • Set the Signature Version to 3.
  • Click Save Changes .

My Projects tab

  • Press the Widgets button, then the "Add New Widget", scroll down and select the Paymentwall Multi widget.

Import Paymentwall plugins

  • In the attachments, you will find our plugin in paymentwall-for-unity.zip. Extract and import all files from this folder. Or you can use our demo from paymentwall-demo-for-unity.zip with database included.

Integrate payment widget

  • Create a new Unity MonoBehaviour class, add the following code to it. Modify API type and other custom parameters as you like.
using Paymentwall;
public class TestPlugin : MonoBehaviour {

    // Use this for initialization
    void Start () {
        PWBase.SetApiType(Paymentwall_Base.API_VC);
        PWBase.SetAppKey("9fa5245253f742e50e705f65b9b02d66"); // your Project Public key - available in your Paymentwall merchant area
        PWBase.SetSecretKey("3918c61450ab7aaa62760036f03eb947"); // your Project Private key - available in your Paymentwall merchant area

        List<PWProduct> productList = new List<PWProduct>();
        PWProduct product = new PWProduct(
            "product301", // id of the product in your system
            9.99f, // price
            "USD", // currency code
            "Gold Membership", // product name
            PWProduct.TYPE_SUBSCRIPTION, // this is a time-based product; for one-time products, use Paymentwall_Product.TYPE_FIXED and omit the following 3 parameters
            1, // time duration
            PWProduct.PERIOD_TYPE_YEAR, // year
            true // recurring
            );
        productList.Add(product);
        PWWidget widget = new PWWidget(
            "user40012", // id of the end-user who's making the payment
            "p1_1", // widget code, e.g. p1; can be picked inside of your merchant account
            productList,
            new Dictionary<string, string>() {{"email", "user@hostname.com"}} // additional parameters
        );

        PWUnityWidget unity = new PWUnityWidget (widget);
        StartCoroutine (unity.callWidgetWebView (gameObject,canvas)); // call this function to display widget
    }
}
  • You can modify the size and behaviour of payment's widget in PWUnityWidget.cs
  • Run Unity Editor (support only on OSX ) or build it to mobile and see your result.

Widget result

Integrate Brick (built-in UI)

  • Grab your public key and private key inside your merchant account.

Brick key

  • Create a new Unity MonoBehaviour class, and add the following namespace.
    using Paymentwall;
  • Remember to switch SDK to Live Mode.
    PWBase.SetApiMode(API_MODE);
  • Add the following code and modify parameters based on your demand.
PWBrick brick = new PWBrick (3.0f, "USD", "Your Awesome Game", "Small pack");
PWBase.SetAppKey ("YOUR PUBLIC KEY");
PWBase.SetSecretKey ("YOUR PRIVATE KEY");
brick.ShowPaymentForm ();
  • Result

Brick result

Integrate Brick (code only)

  • Or you can use your custom UI, request token and charge credit card with this code.
PWBase.SetAppKey ("YOUR PUBLIC KEY");
PWBase.SetSecretKey ("YOUR PRIVATE KEY");

PWOneTimeToken tokenModel = new PWOneTimeToken ();
tokenModel.Create (PWBase.GetAppKey (), 
                "4000000000000002", // card number
                "12", // expire month
                "16", // expire year
                "123"); // CVV number
PWCharge charge = gameObject.AddComponent<PWCharge> ();
yield return StartCoroutine(charge.create (tokenModel, 
                    "test@email.com", // Paymentwall will send receipt to this address.
                    "USD",  // Currency code
                    "9.99", // Amount of charge
                    "fingerprint", // Fingerprint
                    "this is description")); // Description of payment

Submit the project for approval

Once all the settings have been properly configured, go back to your Paymentwall Merchant Area -> My Projects and submit the project for approval by pressing the Submit For Review button.

Your project will be approved shortly once we have reviewed the integration and made sure that everything is running smoothly for your users.

Note

This module is provided as is. You can download the module in the attachment or from our Paymentwall github

This page needs JavaScript
Your browser is
not supported anymore.
Please update to the more recent one.
This page needs JavaScript
This page needs JavaScript.
Please enable it in your browser settings and try again.
페이먼트월은 보다 나은 사용자 환경 개선을 위해 동의된 페이먼트월 쿠키정책에 한하여 쿠키를 사용합니다. 쿠키 정책 보기.