{"id":19312110,"url":"https://github.com/bigcommerce/bigpay-client-js","last_synced_at":"2025-04-05T06:08:31.471Z","repository":{"id":32459035,"uuid":"67574095","full_name":"bigcommerce/bigpay-client-js","owner":"bigcommerce","description":"Bigpay client-side library","archived":false,"fork":false,"pushed_at":"2025-03-26T12:01:42.000Z","size":4797,"stargazers_count":2,"open_issues_count":5,"forks_count":48,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-03-29T05:09:10.395Z","etag":null,"topics":["bigpay","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigcommerce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-07T05:11:45.000Z","updated_at":"2025-03-26T12:01:45.000Z","dependencies_parsed_at":"2023-10-03T13:01:10.266Z","dependency_job_id":"d8347dfa-d18c-4140-92d1-a12ef8ebfbc7","html_url":"https://github.com/bigcommerce/bigpay-client-js","commit_stats":{"total_commits":307,"total_committers":42,"mean_commits":7.309523809523809,"dds":0.6254071661237786,"last_synced_commit":"ca2d85bf941e670d71f819b5c4d135383b8c8143"},"previous_names":[],"tags_count":101,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigpay-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigpay-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigpay-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigcommerce%2Fbigpay-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigcommerce","download_url":"https://codeload.github.com/bigcommerce/bigpay-client-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294539,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigpay","javascript"],"created_at":"2024-11-10T00:32:54.622Z","updated_at":"2025-04-05T06:08:31.456Z","avatar_url":"https://github.com/bigcommerce.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bigpay-client.js\n\n[![Build Status](https://circleci.com/gh/bigcommerce/bigpay-client-js.svg?style=svg)](https://circleci.com/gh/bigcommerce/bigpay-client-js)\n\nbigpay-client.js is a client-side library for posting payment data to BigPay.\n\n## Usage\n\nIn `checkout.js`\n```js\nimport { createClient } from 'bigpay-client';\nimport { getPaymentData } from './payment';\n\nconst client = createClient({\n    host: 'https://payments.bigcommerce.com',\n});\n\nconst data = getPaymentData();\n\nclient.submitPayment(data, (error, response) =\u003e {\n    if (error) {\n        throw error;\n    }\n\n    console.log(response);\n});\n```\n\nIn `payment.js`\n```js\nexport default function getPaymentData() {\n    return {\n        authToken: 'aaa.bbb.ccc',\n        billingAddress: {\n            addressLine1: '1-3 Smail St',\n            addressLine2: 'Ultimo',\n            city: 'Sydney',\n            company: 'BigCommerce',\n            country: 'Australia',\n            countryCode: 'AU',\n            firstName: 'Foo',\n            lastName: 'Bar',\n            phone: '98765432',\n            postCode: '2007',\n            provinceCode: 'NSW',\n            province: 'New South Wales',\n        },\n        cart: {\n            currency: 'AUD',\n            grandTotal: {\n                integerAmount: 12000,\n            },\n            handling: {\n                integerAmount: 0,\n            },\n            shipping: {\n                integerAmount: 1000,\n            },\n            subtotal: {\n                integerAmount: 10000,\n            },\n            taxTotal: {\n                integerAmount: 1000,\n            },\n            items: [\n                {\n                    id: '123',\n                    integerAmount: 10000,\n                    integerAmountAfterDiscount: 10000,\n                    integerDiscount: 0,\n                    integerTax: 1000,\n                    integerUnitPrice: 10000,\n                    integerUnitPriceAfterDiscount: 10000,\n                    name: 'Cheese',\n                    quantity: 1,\n                    sku: '123456789',\n                    type: 'ItemPhysicalEntity',\n                },\n            ],\n        },\n        customer: {\n            customerId: '123',\n            email: 'email@bigcommerce.com',\n            firstName: 'Foo',\n            lastName: 'Bar',\n            name: 'Foo Bar',\n            phoneNumber: '98765432',\n        },\n        order: {\n            currency: 'AUD',\n            grandTotal: {\n                integerAmount: 12000,\n            },\n            handling: {\n                integerAmount: 0,\n            },\n            orderId: '123',\n            shipping: {\n                integerAmount: 1000,\n            },\n            subtotal: {\n                integerAmount: 10000,\n            },\n            taxTotal: {\n                integerAmount: 1000,\n            },\n            token: 'abc123',\n        },\n        payment: {\n            ccCvv: '123',\n            ccExpiry: {\n                month: 1,\n                year: 2018,\n            },\n            ccName: 'Foo Bar',\n            ccNumber: '4007000000027',\n            ccCustomerCode: 'XYZ',\n        },\n        paymentMethod: {\n            id: 'paypalprous',\n            type: 'PAYMENT_TYPE_API',\n        },\n        quoteMeta: {\n            request: {\n                deviceSessionId: 'xyz123',\n                geoCountryCode: 'AU',\n                sessionHash: 'abc123',\n            },\n        },\n        shippingAddress: {\n            addressLine1: '685 Market St',\n            addressLine2: 'Third Floor',\n            city: 'San Francisco',\n            company: 'BigCommerce',\n            country: 'United States',\n            countryCode: 'US',\n            firstName: 'Joe',\n            lastName: 'Bar',\n            phone: '98765432',\n            postCode: '94105',\n            provinceCode: 'CA',\n            province: 'California',\n        },\n        source: 'bcapp-checkout-uco',\n        store: {\n            cartLink: '/cart',\n            checkoutLink: '/checkout',\n            countryCode: 'AU',\n            currencyCode: 'AUD',\n            orderConfirmationLink: '/order-confirmation',\n            shopPath: '/',\n            storeHash: 's123456789',\n            storeId: '100',\n            storeLanguage: 'en-AU',\n            storeName: 'Test Store',\n        },\n    };\n}\n```\n\n## Development\n\n```sh\nnpm install\n```\n\nLink with other projects:\n\nInside `bigpay-client-js`\n\n```sh\nnpm link\nnpm build -- --watch\n```\n\nOther project(s):\n\n```sh\nnpm link @bigcommerce/bigpay-client\nnpm run dev\n```\n\nTo run unit tests:\n\n```sh\nnpm test\n```\n\nTo release a new version:\n\n```sh\nnpm run release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigpay-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigcommerce%2Fbigpay-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigcommerce%2Fbigpay-client-js/lists"}