-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* @flow */ | ||
import type { LazyExport } from "../types"; | ||
import { getAxoComponent, type AXOComponent } from "../zoid/axo"; | ||
|
||
export const AXO: LazyExport<AXOComponent> = { | ||
__get__: getAxoComponent, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* @flow */ | ||
/** @jsx node */ | ||
/* eslint max-lines: 0 */ | ||
|
||
import { loadConnectScript } from "@paypal/connect-loader-component"; | ||
import { getClientID, getClientMetadataID } from "@paypal/sdk-client/src"; | ||
// eslint-disable-next-line flowtype/no-weak-types | ||
export type AXOComponent = any; | ||
|
||
export function getAxoComponent(): AXOComponent { | ||
const cmid = getClientMetadataID(); | ||
const clientID = getClientID(); | ||
// this will change to whatever options we received | ||
// from the merchant | ||
try { | ||
return loadConnectScript({ cmid, clientID }); | ||
} catch (error) { | ||
return new Error(error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/* @flow */ | ||
|
||
export * from "./component"; |