Update api.websms.js

This commit is contained in:
Namhyeon Go 2022-02-10 11:32:28 +09:00 committed by GitHub
parent c6d7d21b4c
commit 0eb1924406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)