-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(payment): PAYPAL-4937 Update PaymentRequestSender with new request to proxy server #2754
Open
bc-nick
wants to merge
6
commits into
bigcommerce:master
Choose a base branch
from
bc-nick:PAYPAL-4937
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+365
−2
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
74aa351
feat(payment): PAYPAL-4937 updated PaymentMethodRequestSender by addi…
bc-nick 508e965
feat(payment): PAYPAL-4937 updated interface
bc-nick 7afaa0f
feat(payment): PAYPAL-4937 updates after review
bc-nick 01ba966
feat(payment): PAYPAL-4937 updates after review
bc-nick a14e11b
feat(payment): PAYPAL-4937 added loadPaymentWalletWithInitializationD…
bc-nick 98337a4
feat(payment): PAYPAL-4937 updates related to new requirements
bc-nick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 19 additions & 0 deletions
19
packages/core/src/payment/headless-payment-methods.mock.ts
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,19 @@ | ||
import { HeadlessPaymentMethod } from './headless-payment'; | ||
|
||
export const initializationData = { | ||
merchantId: '100000', | ||
paymentButtonStyles: { | ||
checkoutTopButtonStyles: { color: 'blue', label: 'checkout', height: '36' }, | ||
}, | ||
}; | ||
|
||
export const encodedInitializationData = btoa(JSON.stringify(initializationData)); | ||
|
||
export function getHeadlessPaymentMethod(): HeadlessPaymentMethod { | ||
return { | ||
paymentWalletWithInitializationData: { | ||
clientToken: 'clientToken', | ||
initializationData: encodedInitializationData, | ||
}, | ||
}; | ||
} |
9 changes: 9 additions & 0 deletions
9
packages/core/src/payment/headless-payment/headless-payment-method-config.ts
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,9 @@ | ||
import { HeadlessPaymentMethodType } from './headless-payment-method-type'; | ||
|
||
const HeadlessPaymentMethodConfig: Record<string, HeadlessPaymentMethodType> = { | ||
paypalcommerce: HeadlessPaymentMethodType.PAYPALCOMMERCE, | ||
paypalcommercecredit: HeadlessPaymentMethodType.PAYPALCOMMERCECREDIT, | ||
braintree: HeadlessPaymentMethodType.BRAINTREE, | ||
}; | ||
|
||
export default HeadlessPaymentMethodConfig; |
7 changes: 7 additions & 0 deletions
7
packages/core/src/payment/headless-payment/headless-payment-method-response.ts
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 @@ | ||
import HeadlessPaymentMethod from './headless-payment-method'; | ||
|
||
export interface HeadlessPaymentMethodResponse { | ||
data: { | ||
site: HeadlessPaymentMethod; | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/core/src/payment/headless-payment/headless-payment-method-type.ts
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,5 @@ | ||
export enum HeadlessPaymentMethodType { | ||
PAYPALCOMMERCE = 'paypalcommerce.paypal', | ||
PAYPALCOMMERCECREDIT = 'paypalcommerce.paypalcredit', | ||
BRAINTREE = 'braintree.paypal', | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/core/src/payment/headless-payment/headless-payment-method.ts
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 @@ | ||
export default interface HeadlessPaymentMethod { | ||
paymentWalletWithInitializationData: { | ||
clientToken?: string; | ||
// INFO:: initializationData given in base64 format | ||
initializationData?: string; | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/core/src/payment/headless-payment/headless-payment-request-options.ts
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,5 @@ | ||
import { RequestOptions } from '../../common/http-request'; | ||
|
||
export default interface HeadlessPaymentRequestOptions extends RequestOptions { | ||
body: { entityId: string }; | ||
} |
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,6 @@ | ||
export { default as HeadlessPaymentMethod } from './headless-payment-method'; | ||
export { default as HeadlessPaymentMethodConfig } from './headless-payment-method-config'; | ||
export { default as HeadlessPaymentRequestOptions } from './headless-payment-request-options'; | ||
|
||
export { HeadlessPaymentMethodType } from './headless-payment-method-type'; | ||
export { HeadlessPaymentMethodResponse } from './headless-payment-method-response'; |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move this to
headless-payment
?