react-native-moyasar-sdk
Version:
Official React Native Moyasar SDK - Integrate Credit Cards, Apple Pay, Samsung Pay, and STC Pay with simple interfaces for a seamless payment experience in your React Native app
64 lines (62 loc) • 1.37 kB
JavaScript
"use strict";
/**
Moyasar API response for processing a token request.
*/
export class TokenResponse {
constructor({
id,
status,
brand,
funding,
country,
month,
year,
name,
lastFour,
metadata,
message,
verificationUrl,
createdAt,
updatedAt,
expiresAt
}) {
this.id = id;
this.status = status;
this.brand = brand;
this.funding = funding;
this.country = country;
this.month = month;
this.year = year;
this.name = name;
this.lastFour = lastFour;
this.metadata = metadata;
this.message = message;
this.verificationUrl = verificationUrl;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
this.expiresAt = expiresAt;
}
/**
* Creates a new TokenResponse instance from a JSON object.
*/
static fromJson(json) {
return new TokenResponse({
id: json.id,
status: json.status,
brand: json.brand,
funding: json.funding,
country: json.country,
month: json.month,
year: json.year,
name: json.name,
lastFour: json.last_four,
metadata: json.metadata,
message: json.message,
verificationUrl: json.verification_url,
createdAt: json.created_at,
updatedAt: json.updated_at,
expiresAt: json.expires_at
});
}
}
//# sourceMappingURL=token_response.js.map