Skip to content

Instantly share code, notes, and snippets.

View biancalpadilla's full-sized avatar

Bianca Padilla biancalpadilla

View GitHub Profile
[
{
"id": 329441,
"order_id": 239344,
"product_id": 1180,
"variant_id": 10703,
"order_address_id": 237073,
"name": "Abena Boost Booster Pads",
"sku": "4035-BG20", // "BG" == McKesson UOM
"upc": "796433843368",
{
"b2b_key": "mZ... <**--removed--**>",
"bill_to_name": "Carewell",
"developer_account": "<**--removed--**>",
"identity": "CA... <**--removed--**>",
"shared_secret": "Bf... <**--removed--**>",
"ship_to_address": {
"name": "Jan<**--removed--**>",
"street": "61<**--removed--**>",
"street_line_3": "",
@biancalpadilla
biancalpadilla / receipt
Created June 15, 2020 19:15
POSTMARK EXAMPLES, available in curl, Ruby, C#, PHP, Node.js
# Copy and paste this into terminal
curl "https://api.postmarkapp.com/email/withTemplate" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: TOKEN" \
-d '{
"From": "sender@example.com",
"To": "recipient@example.com",
"TemplateAlias": "receipt",
# Copy and paste this into terminal
curl "https://api.postmarkapp.com/email/withTemplate" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: TOKEN" \
-d '{
"From": "sender@example.com",
"To": "recipient@example.com",
"TemplateAlias": "receipt",
var mail = "test@test.com";
//username is public API Key
var url = "https://bpi.briteverify.com/emails.json?address="+mail+"&username=";
$.ajax({
url: url,
dataType: "jsonp",
success: function(data){
var status = data.status;
if(status === 'valid') {
console.log('success')
def address_verification(order)
shipping = Bigcommerce.find_shipping(order.id).first
address = verify_address(shipping)
unless address['deliverability'] == 'deliverable' ||
address['deliverability'] == 'deliverable_unnecessary_unit'
notes = order.staff_notes + "\n" + footnotes(address)
Bigcommerce.update_staff_notes(order.id, notes)
Bigcommerce.update_order_status_id(order.id, ENV['manual_verification'])
end
/* 1. Open HTML Editor
2. Search for (Ctrl/Command + F) "description-table-responsive"
3. Delete everything above that line
4. Copy the following code
5. Close HTML Editor
6. Edit using normal editor such as adding bullet points using the bullet point button.
*/
<div class="description-container">
<div class="row description-row">
<div class="col-md-8 col-sm-12 description-section-1">
@biancalpadilla
biancalpadilla / custom_logger.rb
Created August 28, 2018 21:23 — forked from kinopyo/custom_logger.rb
Custom logger file in Rails
# lib/custom_logger.rb
class CustomLogger < Logger
def format_message(severity, timestamp, progname, msg)
"#{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n"
end
end
logfile = File.open("#{Rails.root}/log/custom.log", 'a') # create log file
logfile.sync = true # automatically flushes data to file
CUSTOM_LOGGER = CustomLogger.new(logfile) # constant accessible anywhere
@biancalpadilla
biancalpadilla / application_controller.rb
Last active September 6, 2018 01:20
bigcommerce omniauth
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
after_action :set_header_for_iframe
helper_method :current_store
helper_method :current_connection
private
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" style="background:#f9f9f9!important">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<title>{{subject}}</title>
<style>