Category Archives: life hack

a usually simple and clever tip or technique for accomplishing some familiar task more easily and efficiently “Life hacks,” as they are known, are all about eliminating life’s manifold frustrations in simple and deliciously clever ways.

Google Pay

This is how to make Buy with Google Pay. by only html code. Step by step you need to register the application first to google for the production side. Until February 2020 the google pay is still on Alpha Test.

1. This is the div button for the payment

<div id="container"></div>
<script async
  src="https://pay.google.com/gp/p/js/pay.js"
  onload="onGooglePayLoaded()"></script>

2. Javascript file or embeded below the html div code.

<script>
/**
 * Define the version of the Google Pay API referenced when creating your
 * configuration
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|apiVersion in PaymentDataRequest}
 */
const baseRequest = {
  apiVersion: 2,
  apiVersionMinor: 0
};

/**
 * Card networks supported by your site and your gateway
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
 * @todo confirm card networks supported by your site and gateway
 */
const allowedCardNetworks = ["AMEX", "DISCOVER", "INTERAC", "JCB", "MASTERCARD", "VISA"];

/**
 * Card authentication methods supported by your site and your gateway
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
 * @todo confirm your processor supports Android device tokens for your
 * supported card networks
 */
const allowedCardAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"];

/**
 * Identify your gateway and your site's gateway merchant identifier
 *
 * The Google Pay API response will return an encrypted payment method capable
 * of being charged by a supported gateway after payer authorization
 *
 * @todo check with your gateway on the parameters to pass
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#gateway|PaymentMethodTokenizationSpecification}
 */
const tokenizationSpecification = {
  type: 'PAYMENT_GATEWAY',
  parameters: {
    'gateway': 'example',
    'gatewayMerchantId': 'exampleGatewayMerchantId'
  }
};

/**
 * Describe your site's support for the CARD payment method and its required
 * fields
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
 */
const baseCardPaymentMethod = {
  type: 'CARD',
  parameters: {
    allowedAuthMethods: allowedCardAuthMethods,
    allowedCardNetworks: allowedCardNetworks
  }
};

/**
 * Describe your site's support for the CARD payment method including optional
 * fields
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#CardParameters|CardParameters}
 */
const cardPaymentMethod = Object.assign(
  {},
  baseCardPaymentMethod,
  {
    tokenizationSpecification: tokenizationSpecification
  }
);

/**
 * An initialized google.payments.api.PaymentsClient object or null if not yet set
 *
 * @see {@link getGooglePaymentsClient}
 */
let paymentsClient = null;

/**
 * Configure your site's support for payment methods supported by the Google Pay
 * API.
 *
 * Each member of allowedPaymentMethods should contain only the required fields,
 * allowing reuse of this base request when determining a viewer's ability
 * to pay and later requesting a supported payment method
 *
 * @returns {object} Google Pay API version, payment methods supported by the site
 */
function getGoogleIsReadyToPayRequest() {
  return Object.assign(
      {},
      baseRequest,
      {
        allowedPaymentMethods: [baseCardPaymentMethod]
      }
  );
}

/**
 * Configure support for the Google Pay API
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#PaymentDataRequest|PaymentDataRequest}
 * @returns {object} PaymentDataRequest fields
 */
function getGooglePaymentDataRequest() {
  const paymentDataRequest = Object.assign({}, baseRequest);
  paymentDataRequest.allowedPaymentMethods = [cardPaymentMethod];
  paymentDataRequest.transactionInfo = getGoogleTransactionInfo();
  paymentDataRequest.merchantInfo = {
    // @todo a merchant ID is available for a production environment after approval by Google
    // See {@link https://developers.google.com/pay/api/web/guides/test-and-deploy/integration-checklist|Integration checklist}
    // merchantId: '01234567890123456789',
    merchantName: 'Example Merchant'
  };

  paymentDataRequest.callbackIntents = ["PAYMENT_AUTHORIZATION"];

  return paymentDataRequest;
}

/**
 * Return an active PaymentsClient or initialize
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/client#PaymentsClient|PaymentsClient constructor}
 * @returns {google.payments.api.PaymentsClient} Google Pay API client
 */
function getGooglePaymentsClient() {
  if ( paymentsClient === null ) {
    paymentsClient = new google.payments.api.PaymentsClient({
        environment: 'TEST',
      paymentDataCallbacks: {
        onPaymentAuthorized: onPaymentAuthorized
      }
    });
  }
  return paymentsClient;
}

/**
 * Handles authorize payments callback intents.
 *
 * @param {object} paymentData response from Google Pay API after a payer approves payment through user gesture.
 * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData object reference}
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentAuthorizationResult}
 * @returns Promise<{object}> Promise of PaymentAuthorizationResult object to acknowledge the payment authorization status.
 */
function onPaymentAuthorized(paymentData) {
  return new Promise(function(resolve, reject){
    // handle the response
    processPayment(paymentData)
      .then(function() {
        resolve({transactionState: 'SUCCESS'});
      })
      .catch(function() {
        resolve({
          transactionState: 'ERROR',
          error: {
            intent: 'PAYMENT_AUTHORIZATION',
            message: 'Insufficient funds, try again. Next attempt should work.',
            reason: 'PAYMENT_DATA_INVALID'
          }
        });
	    });
  });
}

/**
 * Initialize Google PaymentsClient after Google-hosted JavaScript has loaded
 *
 * Display a Google Pay payment button after confirmation of the viewer's
 * ability to pay.
 */
function onGooglePayLoaded() {
  const paymentsClient = getGooglePaymentsClient();
  paymentsClient.isReadyToPay(getGoogleIsReadyToPayRequest())
    .then(function(response) {
      if (response.result) {
        addGooglePayButton();
      }
    })
    .catch(function(err) {
      // show error in developer console for debugging
      console.error(err);
    });
}

/**
 * Add a Google Pay purchase button alongside an existing checkout button
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#ButtonOptions|Button options}
 * @see {@link https://developers.google.com/pay/api/web/guides/brand-guidelines|Google Pay brand guidelines}
 */
function addGooglePayButton() {
  const paymentsClient = getGooglePaymentsClient();
  const button =
      paymentsClient.createButton({onClick: onGooglePaymentButtonClicked});
  document.getElementById('container').appendChild(button);
}

/**
 * Provide Google Pay API with a payment amount, currency, and amount status
 *
 * @see {@link https://developers.google.com/pay/api/web/reference/request-objects#TransactionInfo|TransactionInfo}
 * @returns {object} transaction info, suitable for use as transactionInfo property of PaymentDataRequest
 */
function getGoogleTransactionInfo() {
  return {
        displayItems: [
        {
          label: "Subtotal",
          type: "SUBTOTAL",
          price: "11.00",
        },
      {
          label: "Tax",
          type: "TAX",
          price: "1.00",
        }
    ],
    countryCode: 'US',
    currencyCode: "USD",
    totalPriceStatus: "FINAL",
    totalPrice: "12.00",
    totalPriceLabel: "Total"
  };
}


/**
 * Show Google Pay payment sheet when Google Pay payment button is clicked
 */
function onGooglePaymentButtonClicked() {
  const paymentDataRequest = getGooglePaymentDataRequest();
  paymentDataRequest.transactionInfo = getGoogleTransactionInfo();

  const paymentsClient = getGooglePaymentsClient();
  paymentsClient.loadPaymentData(paymentDataRequest);
}

let attempts = 0;
/**
 * Process payment data returned by the Google Pay API
 *
 * @param {object} paymentData response from Google Pay API after user approves payment
 * @see {@link https://developers.google.com/pay/api/web/reference/response-objects#PaymentData|PaymentData object reference}
 */
function processPayment(paymentData) {
  return new Promise(function(resolve, reject) {
    setTimeout(function() {
      // @todo pass payment token to your gateway to process payment
      paymentToken = paymentData.paymentMethodData.tokenizationData.token;

			if (attempts++ % 2 == 0) {
	      reject(new Error('Every other attempt fails, next one should succeed'));      
      } else {
	      resolve({});      
      }
    }, 500);
  });
}
</script>

Steam Profile

Here is the Steam Id for Akew, also known as josuamarcelc. Use our custom tools to build a Steam profile badge, calculate collection value, find Steam friends and discover the Pile of Shame.

steamID STEAM_1:0:72502129
steamID3 [U:1:145004258]
steamID64 76561198105269986
customURL https://steamcommunity.com/id/josuamarcelc
profile https://steamcommunity.com/profiles/76561198105269986
profile state public
profile created 2013-08-31 10:10:34
name Akew
real name Akew
location Indonesia

Dotabuff: https://www.dotabuff.com/players/145004258

Japan Visa Requirements for Expats in Philippines as a Tourist

TOURISM
A. PURPOSE
Applicant himself/herself made the arrangements for the travel/tour in Japan
If applicant request a multiple-entry visa for short-term stay, please refer to the requirement at the home page.

B. REQUIREMENTS
All documents must be original unless otherwise stated.

  1. Philippine Passport
    • Broken passport is not accepted. Passports must be signed and must have at least two (2) blank visa pages.
  2. Visa Application Form
    • Available at the Embassy website, at the entrance of the Embassy or at any of the accredited travel agencies.
    • Application form should be filled out all items correctly, If item is not applicable, please fill in [N/A]. Embassy may not accept application with blank item, no signature or no date in the form; may deny the application that is filled out incorrectly or wrong information.
  3. Photo
    • Specs: 4.5cm x 4.5cm, with white background.
    • Photo must be taken within 6 months.
    • Please write applicant’s name and birthdate on back side of the photo.
    • Photo must be pasted on the application form.
  4. Birth Certificate
    • IT must be issued within one year from PSA Main Office/Serbilis Outlet Center (Nationwide).
    • If the birth certificate from Philippine Statistics Office (PSA) is unreadable, or has incomplete information, please submit the birth certificate issued by PSA together with a birth certificate issued by the Local Civil Registrar.
    • If the birth certificate is “late registration”, please submit in addition, a baptismal certificate and school record (Form 137) from high school or elementary and School Yearbook (if possible).
    • If there is no record in PSA, please submit a “Certificate of Non-Record” from PSA together with a birth certificate from the Local Civil Registrar.
  5. Marriage Certificate (if the applicant is married)
    • IT must be issued within one year from PSA Main Office/Serbilis Outlet Center (Nationwide).
    • In case there is no record in PSA, please submit a “Certificate of Non-Record” from PSA together with the Marriage Certificate from the Local Civil Registrar.
  6. Daily Schedule in Japan (TAIZAI YOTEIHYO )
    [If applicant will shoulder part or all of his/her travel expenses]
  7. Bank Certificate
    Validity of Bank Certificate is three (3) month from the date of issue
  8. Applicant’s Income Tax Return (Form 2316) clear Photocopy (latest)
    [If Guarantor who lives in the Philippines will shoulder part or all of the applicant’s travel
    expenses]
  9. Guarantee Letter
  10. Proof of relationship between applicant and guarantor (e.g. Birth Certificates etc.)
  11. Bank Certificate (original) and Income Tax Return (ITR Form 2316) (clear Photocopy) of
    Guarantor
    [If Applicant is not Philippines nationality ]
  12. Foreign residents with long-term or permanent status in the Philippines applying for a visa must submit, in addition to the above requirements (except birth and marriage certificates), a copy of their Alien Certificate of Registration (ACR) issued by the Philippine government.
    Visa application of foreigners who are on short-term (temporary) visa in the Philippines cannot be accepted. Please apply at the Japanese Embassy /Consulate General with jurisdiction over the area in which the applicant resides or over the country of which the applicant’s passport was issued.

[NOTICE]
Size of document for application should be A4 size only. If document is other size, please submit copy that is already adjusted in A4 size from its original and without staples or pasting pages. Applicants are exempted from submitting (4) and (5) Indicated above if they can submit old/valid passports with used Japan visa.
It is applicant’s responsibility to ensure that he/she meet the requirements for the grant of a visa. Submission of any supporting documents not listed above is encouraged (e.g. applicant’s economic or social ties with the Philippines, urgent reasons for visit: medical certificate, wedding
invitation).

References

Consular Fees: here

finger tapping

Light finger tapping is a custom for thanking the tea master or tea server for tea. After a person’s cup is filled, that person may knock their bent index and middle fingers (or some similar variety of finger tapping) on the table to express gratitude to the person who served the tea. Although this custom is common in southern Chinese culture such as the Cantonese, in other parts of China it is only acceptable if for some reason you cannot actually say thank you at that moment, for example if you are in the middle of talking with someone else at the table.

This custom is said to have originated in the Qing Dynasty when Emperor Qian Long would travel in disguise through the empire. Servants were told not to reveal their master’s identity. One day in a restaurant, the emperor, after pouring himself a cup of tea, filled a servant’s cup as well. To that servant it was a huge honour to have the emperor pour him a cup of tea. Out of reflex he wanted to kneel and express his thanks. He could not kneel and kowtow to the emperor since that would reveal the emperor’s identity so he bent his fingers on the table to express his gratitude and respect to the emperor.

The bent fingers for knocking are technically supposed to be three to signify a bowing servant. One is the head and the other two are the arms.

It should be noted that in formal tea ceremonies nodding of the head and/or saying “thank you” is more appropriate.