Skip to content

Instantly share code, notes, and snippets.

View brandingConsumer
import React, { useMemo, useContext } from 'react';
import { Image } from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { View } from 'react-native';
import { SvgWithCss } from 'react-native-svg';
import { BrandingContext } from 'contexts';
import { actions, selectors } from 'store/cards';
import styles from './styles';
View AppBranding
import { createAppContainer } from 'react-navigation';
import { Provider as StoreProvider } from 'react-redux';
import React from 'react';
import store from 'store';
import Navigation from 'navigation';
import { BrandingProvider } from 'contexts';
const AppContainer = createAppContainer(Navigation);
View BrandingProvider
import React, { createContext } from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import { split, trimEnd, toNumber } from 'lodash';
import colors from 'res/colors';
import { selectors } from 'store/branding';
import { hexToHSL } from 'utils/helpers';
export const BrandingContext = createContext({});
View gist:9f5a15453d765f13964710c5846bf654
onAuthorize: function(data, actions)
{
return actions.payment.execute().then(function()
{
// Show a confirmation message to the buyer
window.alert('Thank you for your purchase!');
});
}
View gist:a9e620d40d13768861fc6ff8a77bd62b
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '30.11',
currency: 'USD',
details: {
subtotal: '30.00',
tax: '0.07',
shipping: '0.03',
View gist:3ad9034881cb8fa95f3ca23a95c1ed71
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '0.01',
currency: 'USD'
}
}]
});
}
View gist:6485f4af4d7228dfff368efa8de7fc10
<div id="paypal-button"></div>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
paypal.Button.render({
// Configure environment
env: 'sandbox',
client: {
sandbox: 'demo_sandbox_client_id',
production: 'demo_production_client_id'
},
View gist:7bf28f1aeb608393d6e932d8f9453da5
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01 ?AWSAccessKeyId=AKIAJKYFSJU7PEXAMPLE
&Action=AuthorizeOnBillingAgreement
&AmazonBillingAgreementId=C01-1234567-1234567
&AuthorizationAmount.Amount=10
&AuthorizationAmount.CurrencyCode=USD
&AuthorizationReferenceId=test_authorize_1
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&SellerId=YOUR_SELLER_ID_HERE
&SellerAuthorizationNote=ForNovemberOrder
&SellerOrderAttributes.SellerOrderId=testSellerOrderId
View gist:bf0c48f589ba611ee8517c2caae053f7
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01?AWSAccessKeyId=AKIAJKYFSJU7PEXAMPLE
&AmazonBillingAgreementId=C01-8824045-7416542
&Action=ValidateBillingAgreement
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&SellerId=YOUR_SELLER_ID_HERE
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2013-12-11T10%3A38%3A44.000Z
&Version=2013-01-01
&Signature=gP11oEBaaiQdASWsLDyid18Wn%2BB%2FKZQQtKgpHCtDHdc%3D
View gist:8448c5d2194facba04002be1eb400826
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01?
AWSAccessKeyId=AKIAJKYFSJU7PEXAMPLE
&AmazonBillingAgreementId=C01-8824045-7416542
&Action=SetBillingAgreementDetails
&BillingAgreementAttributes.PlatformId=PLATFORM_ID_HERE
&BillingAgreementAttributes.SellerNote=APPROVE LITE APPROVE HEAVY
&BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformati
on=Example Customer Info
&BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName=Test Store Name
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
You can’t perform that action at this time.