// Set values
let customerName = "Customer name";
let customerId = "customer identification number";
let amount:Double = 100;
let currency = "CRC | USD";
let pdescription = "Bus ticket - 0001";
let orderReference = "xyz-001";
let product: GreenPayProduct = GreenPayProduct(description: "ticket electronico", skuId: "001", quantity: 1, price: 100, type: "Digital");
var products : [GreenPayProduct] = [GreenPayProduct]();
products.append(product);
let address:GreenPayAddress = GreenPayAddress (country: "CR", street1: "Cartago");
// Creates the order object.
let gpOrderInfo:GreenPayOrderInfo = GreenPayOrderInfo(customerName: customerName, customerEmail: customerEmail,
customerId: customerId,shippingAddress: address, billingAddress: address, amount: amount, currency: currency,
description: pdescription, orderReference: orderReference, products: products)
// Calling the create order service
GreenPay.shared.createNewGreenPayOrder(greenPayOrderInfo: gpOrderInfo).done { (greenPayOrderResult) in
let message: String = "createNewGreenPayOrder Success: Session: " + greenPayOrderResult.securityInfo.session + " , Token: " +
greenPayOrderResult.securityInfo.token;
print(message);
}.catch { (error) in
let message: String = "Error creating the order for making the payment: " + error.localizedDescription
print(message);
}