mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update api.websms.js
This commit is contained in:
parent
c6d7d21b4c
commit
0eb1924406
|
@ -7,7 +7,7 @@ var WebSMSObject = function() {
|
|||
this.country = "any";
|
||||
this.operator = "any";
|
||||
this.product = "";
|
||||
this.profiles = [];
|
||||
this.profiles = [];
|
||||
|
||||
this.setHost = function(host) {
|
||||
this.host = host;
|
||||
|
@ -33,24 +33,24 @@ var WebSMSObject = function() {
|
|||
this.product = product;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.addProfile = function(product, country, operator) {
|
||||
this.profiles.push({
|
||||
"product": product,
|
||||
"country": country,
|
||||
"operator": operator
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
this.addProfile = function(product, country, operator) {
|
||||
this.profiles.push({
|
||||
"product": product,
|
||||
"country": country,
|
||||
"operator": operator
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
this.buy = function() {
|
||||
try {
|
||||
if (this.profiles.length > 0) {
|
||||
var pf = RAND.one(this.profiles);
|
||||
this.setProduct(pf.product);
|
||||
this.setOperator(pf.operator);
|
||||
this.setCountry(pf.country);
|
||||
}
|
||||
if (this.profiles.length > 0) {
|
||||
var pf = RAND.one(this.profiles);
|
||||
this.setProduct(pf.product);
|
||||
this.setOperator(pf.operator);
|
||||
this.setCountry(pf.country);
|
||||
}
|
||||
|
||||
var response = HTTP.create()
|
||||
.setBearerAuth(this.token)
|
||||
|
|
Loading…
Reference in New Issue
Block a user