Skip to content

Instantly share code, notes, and snippets.

Created August 2, 2016 20:11
Show Gist options
  • Save anonymous/51f1397f1d09f6e41657ef0b590b9c89 to your computer and use it in GitHub Desktop.
Save anonymous/51f1397f1d09f6e41657ef0b590b9c89 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Aug 2, 2016.
    43 changes: 43 additions & 0 deletions kyc_js_tokenize
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    WePay.set_endpoint("stage"); // change to "production" when live
    WePay.tags.insert();
    WePay.kyc.create({
    "client_id": "9876",
    "account_id": "1234",
    "individual": {
    "account_owner": {
    "name": {
    "first": "Foo",
    "last": "Bar"
    },
    "address": {
    "address1": "123 Fake Street",
    "city": "Montreal",
    "postal_code": "H32 2YZ",
    "region": "QC",
    "country": "CA"
    },
    "phone": {
    "country_code": "+1",
    "phone_number": "5556667777"
    },
    "date_of_birth": {
    "year": 1900,
    "month": 1,
    "day": 1
    },
    "email": "[email protected]",
    "ca_owner_compliance": {
    "social_insurance_number": "046 454 286"
    }
    },
    "mcc": "7999"
    }
    }, function(data) {
    if (data.error) {
    //do something
    } else {
    //Success!
    //data.account_kyc_id will be set with the corresponding id which
    //needs to be authorized
    }
    });